-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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_AHRS: prevent DCM fallback when losing GPS #25408
Conversation
DCM fallback should only occur when GPS stops fusing, not when it is lost completely.
This is probably OK but we should be sure that there is no change in the Copter's reported position when we gain/lose GPS. For extra points we should test the behaviour when using a non-GPS sensor for position estimation (e.g. visual odometry/vicon). |
You mean the Plane's reported position? This is all under an if block than only runs for Plane and Rover. I'll see about testing these cases, but I need to learn about them and how to sim them first. |
Thinking about this more, you're right that I probably should be checking if it has any kind of device that can provide |
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.
I wounder if it should also check fly_forward
, that would restrict this change of behavior to only VTOL modes on plane.
For some reason, in my testing (though that's been limited), killing GPS only seems to trigger DCM fallback in hover. Haven't tested on a real bird in forward flight though. I'll give the fly_forward check some thought though. If I do that, I'd rather go the extra step of fully disallowing DCM in hover, like Copter does always. |
During my no-GPS testing with a fixed-wing - mostly flying fixed wing AUTO mode, the plane would fallback to DCM within a few seconds of me turning off the GPS - it was very annoying because I was trying to test EKF dead-reckoning. |
That is because EKF does not throw its toys out of the pram if Everything we can do to minimize the scope of the change means less testing and fewer edge cases. |
Tridge recommends this approach because it's vehicle-dependent: |
I like Tridge's approach better. Closing |
DCM is particularly bad during hover modes and should only be used when the EKF cannot safely do its job. Currently, losing the GPS during VTOL takeoff triggers an unnecessary DCM fallback.
This PR changes the
const_pos_mode
flag check so that it only triggers fallback if that happens despite having GPS.