Problems with Kalman Filter

Discussions related to positioning systems where the position is calculated outside the Crazyflie and sent to the device using radio, including MoCap systems
Post Reply
suarez_ramon
Beginner
Posts: 1
Joined: Thu Jul 20, 2017 10:01 am

Problems with Kalman Filter

Post by suarez_ramon » Thu Jul 20, 2017 10:05 am

I am using the controller made by Mike Hamer (https://github.com/mikehamer/crazyflie- ... controller). Everything seems to be setup the correct way, the only problem I am having is that the output of the Kalman Filter implemented on board is very bad and diverges quickly after take off. Has anybody had this problem?

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

Re: Problems with Kalman Filter

Post by arnaud » Thu Jul 20, 2017 10:10 am

Since you are sending position update using the external position update port, you can look at the external position log variables to make sure the position really makes it to the Crazyflie. The log variables are defined there: https://github.com/bitcraze/crazyflie-f ... #L194-L198, they are named ext_pos.X/Y/Z.

It means the the estimated position is correct before takeoff? Do you start the crazyflie with the front facing X? (like so: https://www.bitcraze.io/getting-started ... m/#intro18)

RozDavid
Beginner
Posts: 2
Joined: Thu Oct 25, 2018 4:45 pm

Re: Problems with Kalman Filter

Post by RozDavid » Thu Oct 25, 2018 4:51 pm

Hi @arnaud, @suarez_ramon,

I have been stopped with the very same problem as Suarez did a year before. Did you managed to somehow solve the problem? I checked that the external position is send to the subscribed topic, but after logging the ext_pos.x/y/z variables I always get a constant zero for all of them.... FYI onboard imu measurement works well, but with constant drift that is why I would need the external update for the kalman filter.
An other detail, that I use the latest commit from Mike's custom firmware.

Do you have an idea where can the error hide? Suarez, did you managed to solve the problem?
Your answer would help me a lot!!

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

Re: Problems with Kalman Filter

Post by arnaud » Fri Oct 26, 2018 5:32 am

Since you are talking of topic I assume you are using Crazyflie with the ROS driver?

What topic are you using to send the position? As part of Crazyswarm there has been a full-pose update packet that is not compatible with the non-crazyswarm firmware, it might be that you are sending this packet instead of the position-only update packet that updates the extpos.x/y/z log variables.

RozDavid
Beginner
Posts: 2
Joined: Thu Oct 25, 2018 4:45 pm

Re: Problems with Kalman Filter

Post by RozDavid » Sat Oct 27, 2018 11:06 pm

Yes I am using the ROS driver, but instead of the Crazyswarm I use Michael Hamers branch for the crazyflie_ros package:
https://github.com/mikehamer/crazyflie- ... controller

If the crazyflie is accessed and added to the server for example under the name "cf", than I am sending the latest transform (at ros::Time(0) and not now) transforms from the Optitrack system through VRPN to the topic "cf/external_position".

As I echo the topic the data is streaming, but can not update the kalman filter measurement because, the ext_pos variable is still without value somehow in the firmware.

Do you have an idea, where can the root of the problem lie?
Could that be a problem, that with ros::time(0) the transform is not valid enough?
I mean this line in the control: https://github.com/mikehamer/crazyflie- ... new.c#L536

Thanks for your kind answer!

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

Re: Problems with Kalman Filter

Post by whoenig » Tue Oct 30, 2018 4:47 pm

Which ROS package are you using? The first link points to Mike's firmware, but not a fork of crazyflie_ros. It seems to me that perhaps there are some versioning issues (i.e., the data that is sent from the PC uses a different format than what's expected on the firmware side).

Post Reply