-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
AP_NavEKF3: revert to primary compass on ground #29300
base: master
Are you sure you want to change the base?
AP_NavEKF3: revert to primary compass on ground #29300
Conversation
82f8181
to
e02757a
Compare
need to check we don't get an issue with the copter option to save offsets from EKF on disarm, make sure that still works, and saves right offsets for right compass |
e02757a
to
ac61dad
Compare
I have briefly tested in SITL that the offsets from EKF get saved properly. This happens because its saved before the vehicle actually disarms. The mag gets changed back to primary after saving the offsets. |
magFieldLearned = false; | ||
// reset body mag variances on next CovariancePrediction | ||
needMagBodyVarReset = true; | ||
return; |
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.
remove return
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.
looks good to me
@priseborough you OK with this? it matches what we do with primary lane
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.
looks good to me
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.
PR Overview
This PR adds an integration test to ensure that when the compass is temporarily switched due to a simulated failure in EKF3 during flight, it reverts to the primary compass once on the ground.
- Introduces the TestEKF3CompassFailover function to simulate compass failure and restoration.
- Updates the test sequence to include the new failure/recovery scenario within the existing tests2b block.
Reviewed Changes
File | Description |
---|---|
Tools/autotest/arducopter.py | Adds a new integration test to verify EKF3 compass failover behavior |
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
Tools/autotest/arducopter.py:2447
- [nitpick] Consider revising the docstring for clarity, e.g. 'Test if a switched compass reverts to the primary in EKF3 after disarming'.
'''Test if changed compasses goes back to primary in EKF3 on disarm'''
Tools/autotest/arducopter.py:2479
- The extra call to land_and_disarm() after 'Compass restored' may be redundant if the vehicle is already disarmed. If this is intentional, please add a comment to clarify its purpose.
self.land_and_disarm()
Revert to the primary compass if it was changed in flight. The compass might have changed because of landing in an area with high mag interference causing a timeout in the magfusion.
Its more than likely the user wants to go back to flying on the primary mag on subsequent takeoff.
Pushed on top of #29299