Sending external position data

Post here to get support
Post Reply
mlac
Beginner
Posts: 5
Joined: Tue Mar 20, 2018 5:31 am

Sending external position data

Post by mlac »

Hi,
I am using crazyflie 2.0 without LPS. I am trying to send external data from a python client using a motion capture system (optitrack) in my lab.
Whenever I try to send external position, the quad is restarting. In my python client, I am sending external position as follows: `cf.loc.send_extpos([0, 0, 0])`. If I remove this line of code, the quad does not restart and continues to log data properly.
Also, It seems that the kalman filter is not working properly. I get x = 0 and y = 0. z is always identical the barometer measurement. I wonder if these issues are related. If possible, could you please provide details on how to enable the kalman filter? I have seen in some other posts that I have to set ESTIMATOR=kalman in the config.mk. I don't have a file named "config.mk". Instead, I have "config.mk.example" (in /tools/make).
I am building my project from eclipse ( using the VM ). Could this be a problem?

Any help is appreciated! Please let me know if you need more information.
Regards!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Sending external position data

Post by arnaud »

You do not have the kalman filter enabled which explains why you are not getting any positions. You should create tools/make/config.mk or rename config.mk.example into config.mk. Then you can add ESTIMATOR=kalman, then run 'make clean', 'make', 'make cload' in the console and you should have a Crazyflie with Kalman filter enabled. 'make clean' is required each time you modify the config.mk file.

The Crazyflie should never crash (famous last word ...) so this is a bug. I created a ticket for it: https://github.com/bitcraze/crazyflie-f ... issues/342.
mlac
Beginner
Posts: 5
Joined: Tue Mar 20, 2018 5:31 am

Re: Sending external position data

Post by mlac »

Thanks for the quick reply. I enabled the kalman filter as you said. I quickly tested it without the motion capture system, and I can now see the position values drift quickly. I think the problem is solved, but I will test it tonight at the lab using the motion capture system; and I will update you with the result.

Again thank you!
Amir_94
Beginner
Posts: 12
Joined: Wed May 23, 2018 10:55 pm

Re: Sending external position data

Post by Amir_94 »

Hi,

May not be very related to your question but i'm also trying to send external position data to Optitrack. Is there a tutorial on how to approach this method of Localization. On Optitrack website it's recommended to use NatNet SDK . Is this what you did?

Thanks
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Sending external position data

Post by whoenig »

If you use ROS, you can use crazyflie_ros (https://github.com/whoenig/crazyflie_ros) or the crazyswarm (https://github.com/USC-ACTLab/crazyswarm). Both have been used successfully with OptiTrack and come with some (limited) documentation on how to use it.

If you use python, a good approach might be VRPN - OptiTrack (and VICON) have VRPN servers build-in, and there are VRPN python modules (https://github.com/vrpn/vrpn/wiki).
Post Reply