Page 1 of 1

Optitrack with Crazyflie.

Posted: Wed Dec 06, 2017 6:34 am
by aldrinchua8
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!! :D

Re: Optitrack with Crazyflie.

Posted: Wed Dec 06, 2017 10:14 am
by arnaud
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.

Re: Optitrack with Crazyflie.

Posted: Thu Dec 07, 2017 12:06 am
by aldrinchua8
Thank you for this! will definitely try this! :D

Re: Optitrack with Crazyflie.

Posted: Thu Dec 07, 2017 8:43 am
by aldrinchua8
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.

Posted: Thu Dec 07, 2017 9:39 am
by arnaud
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.

Re: Optitrack with Crazyflie.

Posted: Fri Dec 22, 2017 4:19 am
by larry12193
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/