-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
AHRS: add pre-arm check that attitudes are consistent #10575
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I just have a little concern about what append if we don't have DCM ? Will the check failed ?
4c47d2a
to
e301076
Compare
On Wed, 20 Feb 2019, Randy Mackay wrote:
yes, indeed.. i think because it's so rarely called and only when disarmed it's probably not worth the optimisation. txs though
Mmmm... not entirely true IIRC, we do go through this when we try to arm.
But this isn't tight-looping code, I'll certainly grant you that :-)
|
e301076
to
9277151
Compare
I've made a minor fix to make DCM return true if it's the only AHRS. This was causing some example sketches to fail. I've also done some more testing in which I've made it display the roll, pitch and yaw difference between the main EKF and a hard-coded fake EKF with roll/pitch/yaw of 0/0/0 and I'm convinced that this check will not incorrectly every say the attitudes match when they don't. |
Merged, thanks! |
This PR adds and changes two pre-arm checks to resolve this issue which stems from a crash of a vehicle running Copter-3.6.6 where the backup EKF flipped over while the vehicle was disarmed (probably because the user ran a compass calibration but did not reboot the board because the pre-arm compass checks were disabled).
This has been tested in SITL by adding some debug and then setting these parameters to throw off some of the attitude estimates.
To make the roll/pitch check fail I adjusted the accelerometer offsets as follows:
To make the yaw check fail I set the compass offsets as follows:
Picture of some SITL testing