Optitrack with Crazyflie.

Discussions about quadcopters/multi-rotors
Post Reply
aldrinchua8
Beginner
Posts: 5
Joined: Thu Sep 28, 2017 1:41 pm

Optitrack with Crazyflie.

Post by aldrinchua8 » Wed Dec 06, 2017 6:34 am

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

arnaud
Bitcraze
Posts: 1281
Joined: Tue Feb 06, 2007 12:36 pm

Re: Optitrack with Crazyflie.

Post by arnaud » Wed Dec 06, 2017 10:14 am

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.

aldrinchua8
Beginner
Posts: 5
Joined: Thu Sep 28, 2017 1:41 pm

Re: Optitrack with Crazyflie.

Post by aldrinchua8 » Thu Dec 07, 2017 12:06 am

Thank you for this! will definitely try this! :D

aldrinchua8
Beginner
Posts: 5
Joined: Thu Sep 28, 2017 1:41 pm

Re: Optitrack with Crazyflie.

Post by aldrinchua8 » Thu Dec 07, 2017 8:43 am

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!!!

arnaud
Bitcraze
Posts: 1281
Joined: Tue Feb 06, 2007 12:36 pm

Re: Optitrack with Crazyflie.

Post by arnaud » Thu Dec 07, 2017 9:39 am

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.

Post Reply