-
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
Cut motor thrust permanently after a tumble #470
Conversation
What about keeping this functionality passive until taking off and activating it when leaving the ground? |
|
This change improves several issues with the current tumble detector: 1. The old detector was only enabled if the Kalman filter was initially enabled. If one switched dynamically to a different state estimator, this important safety feature did not engage. 2. The old detector triggered by angle, which is an estimated value. If the state estimator diverged, no tumble was detected. The new solution relies on the accelerometer instead, a direct sensor measurement. 3. The old detector was not sticky, i.e., a user might pick up a CF and it starts spinning again, see issue bitcraze#258. The new version triggers an emergencyStop instead. The emergency stop can be reset and read using the new parameter stabilizer.stop. 4. Smaller fixes: a) Add more #ifdef guards to only compile actually enabled code. b) Interface clean-ups This replaces the PR bitcraze#470. This change has been tested on a bench test and with the Crazyswarm.
Thanks and sorry for the lack of response; I would have needed some more time to finish this off, but I'm glad that there's a proper solution now! (For the record, @krichardsson meant PR #481, not PR #482). |
This PR is related to #258 and the discussion therein. It extends the current tumble detector such that:
I'm not fully satisfied with the PR yet; the current implementation would also detect a tumble if you hold the Crazyflie upside down for a while before takeoff, and would block the takeoff itself. I'm not sure what the best way would be to address it - we could either extend the tumble detector in
sitAwTuTest()
to also require significant motor thrust (not only a significant roll / pitch angle), or check the motor thrust insitAwPreThrustUpdateCallOut()
and don't set thesitAwMotorThrustCut
flag if the motors are not running. Suggestions are appreciated.