Using Optitrack MoCap, but no ROS

Firmware/software/electronics/mechanics
Post Reply
jcampbell97330
Beginner
Posts: 2
Joined: Wed Apr 01, 2020 7:32 pm

Using Optitrack MoCap, but no ROS

Post by jcampbell97330 »

Hello,

I have an Optitrack motion capture system that I would like to use to send X,Y,Z data to my Crazyflie 2.1 all through Windows. I do not have access to ROS or Linux. Is this possible? If so, what steps are needed?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Using Optitrack MoCap, but no ROS

Post by kristoffer »

Hi!

I have never used an Optitrack system but I have done it with a Qualisys system and assume the process will be similar. The easiest way is to do it in python.

First step is to find a python connection for the Optitrack system where you get the position of the Crazyflie.
Second step is to feed the position to the Crazyflie using send_extpos() funciton the https://github.com/bitcraze/crazyflie-l ... pos.py#L46 . If you have the full pose (as position + quaternion) you can push it in with send_extpose()

There is an example script for qualisys system that might give you some inspiration https://github.com/bitcraze/crazyflie-l ... mmander.py
jcampbell97330
Beginner
Posts: 2
Joined: Wed Apr 01, 2020 7:32 pm

Re: Using Optitrack MoCap, but no ROS

Post by jcampbell97330 »

Thank you, kristoffer. This should get me started. Optitrack has a Python sample client that returns position plus the quaternion.

Is the flow deck hardware required for this to work?

Do I need to recompile the Crazyflie with "ESTIMATOR=kalman" in config.mk in order to force the kalman filter as the default estimator? (found this from another similar thread)
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Using Optitrack MoCap, but no ROS

Post by kristoffer »

Great! Please consider sharing a simple example script if you get it to work.

No, the flow deck is not required. Flow together with absolute positioning may even confuse the kalman estimator, it is better to not use them at the same time.

You can either force the Kalman estimator to be used, or use the stock firmware and switch to the kalman estimator via a parameter as I did in the qualisys example https://github.com/bitcraze/crazyflie-f ... #L253-L262

You may also have to tweak the std deviation for the quaternions you send to the kalman filter https://github.com/bitcraze/crazyflie-l ... er.py#L251 depending on how much noise you get in the measurements.
Post Reply