-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add supervisor for the kalman estimator #458
Comments
This solution seems to work well in our flight arena. I also added parameters to set the maximum position and velocity that will trigger a reset of the kalman filter. Setting these parameters to 0.0 or a negative number will turn off the check. The only worry is what will happen in a larger system, we don't have the space to test it. One potential problem could be if a device is switched on far from the configured initial position (0, 0, 0 by default) and the filter starts to receive positioning data. When the estimated position changes a lot in a short period of time, the estimated velocity might exceed the accepted max velocity and trigger a reset. This process would repeat indefinitely but could be handled by setting the max velocity to 0.0. |
This is what could have happened with us today (see issue #506). Our arena was 18m x 12m x 6m (we were trying to test how large an arena we could cover with our UWB anchors), and the CF was placed near the far end of the arena around (17.5, 11.5, 0). |
@ntamas that sounds like a plausible explanation for #506. The "correct" solution to this problem is probably to set the initial position in the kalman filter (kalman.initialX, kalman.initialY, kalman.initialZ) to a position close to the actual CF location and then reset the kalman filter. |
FWIW I think that rate-limiting the Kalman filter reset attempts would also be a solution - it would still reset the Kalman filter once when the first position estimate arrives, but then it will back off for a short period, giving enough time for the Kalman filter to stabilize around the new position. |
There is some code in the kalman estimator that caps the current state to stay within some bounds.
crazyflie-firmware/src/modules/src/kalman_core.c
Lines 937 to 945 in 3112896
It seems as this causes crashes in some cases and we need a different solution.
The proposed solution is to introduce a kalman supervisor that resets the kalman filter if the state is off. One benefits of moving this into a new module is that it will be more obvious that the functionality exists, as opposed to the current solution where it is some what hidden in the kalman filter. Resetting the state instead of capping it should also be safer in terms of numerical stability.
The text was updated successfully, but these errors were encountered: