Optitrack with Crazyflie.
-
- Beginner
- Posts: 6
- Joined: Thu Sep 28, 2017 1:41 pm
Optitrack with Crazyflie.
Good Day! I would just like to ask what is the best data streaming protocol is for linking the optitrack in windows to ROS in ubuntu? I believe the mocap_optitrack poses some problems when data is sent from windows to ubuntu. The usual data streaming protocol that I observed is the VRPN. I would just like to ask if how was you experience with VRPN. Also It seems that natnet sdk isn't the best for linking windows and ubuntu. Thanks!!
Re: Optitrack with Crazyflie.
Hi,
We have no experience with any of these protocols at Bitcraze but we have used ZMQ multiple times for multiple projects and always have had good experience with it. Zmq is supported by virtually all programming language and on local network the latency is supposed to be very good too.
This might not fit your need, but my neophyte approach would be to make a small program for the windows computer getting the pose and pushing it to a ZMQ socket (as json object), and a small ROS node in python that gets data from the ZMQ socket and push it in ROS.
We have no experience with any of these protocols at Bitcraze but we have used ZMQ multiple times for multiple projects and always have had good experience with it. Zmq is supported by virtually all programming language and on local network the latency is supposed to be very good too.
This might not fit your need, but my neophyte approach would be to make a small program for the windows computer getting the pose and pushing it to a ZMQ socket (as json object), and a small ROS node in python that gets data from the ZMQ socket and push it in ROS.
-
- Beginner
- Posts: 6
- Joined: Thu Sep 28, 2017 1:41 pm
Re: Optitrack with Crazyflie.
Thank you for this! will definitely try this!
-
- Beginner
- Posts: 6
- Joined: Thu Sep 28, 2017 1:41 pm
Re: Optitrack with Crazyflie.
Hi, I would just like to ask if I could use the coordinates that I get using natnet sdk and integrate it with ZMQ? Thanks!!!
Re: Optitrack with Crazyflie.
I have no experience with this particular SDK but it seems to be a c/c++ interface so it should be possible. For an example of what I am normally doing I put some code in a github gist: https://gist.github.com/ataffanel/948b8 ... 96febe917d.
It is a C++ program that gets the position and button state of a HTC Vive controllers using the openVR API and pushes it to a zmq PUSH socket as json: https://gist.github.com/ataffanel/948b8 ... pp-L77-L78
On the other side, I can get position and buttons in a python program from a zmq PULL socket and use the information to move a Crazyflie: https://gist.github.com/ataffanel/948b8 ... rab-py-L42
This is a bit different to what you want to achieve, but it is a good example of how zmq can be used to transfer messages from a C++ program on windows to a python program on linux. Any side can be restarted and zmq will automatically reconnect the socket.
It is a C++ program that gets the position and button state of a HTC Vive controllers using the openVR API and pushes it to a zmq PUSH socket as json: https://gist.github.com/ataffanel/948b8 ... pp-L77-L78
On the other side, I can get position and buttons in a python program from a zmq PULL socket and use the information to move a Crazyflie: https://gist.github.com/ataffanel/948b8 ... rab-py-L42
This is a bit different to what you want to achieve, but it is a good example of how zmq can be used to transfer messages from a C++ program on windows to a python program on linux. Any side can be restarted and zmq will automatically reconnect the socket.
-
- Beginner
- Posts: 7
- Joined: Tue Oct 17, 2017 7:32 pm
Re: Optitrack with Crazyflie.
I've had great success with the ROS optitrack package from CRI group
https://github.com/crigroup/optitrack
I was streaming data over wifi and was able to achieve some pretty cool stuff. See my post about a ball-in-a-cup playing quadcopter I made using the optitrack for position feedback here.
https://lawrencepapincak.wordpress.com/ ... ll-in-cup/
https://github.com/crigroup/optitrack
I was streaming data over wifi and was able to achieve some pretty cool stuff. See my post about a ball-in-a-cup playing quadcopter I made using the optitrack for position feedback here.
https://lawrencepapincak.wordpress.com/ ... ll-in-cup/