Skip to content
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

Reduce vulnerability of EKF-GSF yaw estimator to GPS glitches #15819

Merged
merged 5 commits into from Nov 16, 2020

Conversation

priseborough
Copy link
Contributor

@priseborough priseborough commented Nov 16, 2020

Improves behaviour reported here #15813

Replay of log provided with issue shows the EKF-GSF stops updating its yaw estimate during a higher period of reported GPS velocity error and resets the yaw estimation when the glitch finishes:

Before:
Screen Shot 2020-11-16 at 12 22 28 pm

After:
Screen Shot 2020-11-16 at 12 22 42 pm

GPS reported velocity accuracy:
Screen Shot 2020-11-16 at 12 22 57 pm

The second layer of protection added is use of a velocity innovation magnitude from the bank of EKF's in the yaw estimator that is obtained using the same weightings that are used to derive the yaw estimate. For operation with non fly forward vehicle types, this needs to be below 2 m/s which has been set to be just over the value achieved by this log with noisy GPS when not glitching, eg:

Screen Shot 2020-11-16 at 12 30 18 pm

Checking another copter log with a good GPS and where yaw was aligned by flying away from the pilot shows that a value of below 1.0 is achieved during the initial convergence, so the value of 2 will be OK for now and can be adjusted later.
Screen Shot 2020-11-16 at 12 34 11 pm

TODO: testing of EKF2 changes.

Only apply to non fly forward vehicle, eg copters, because magnitude of velocity innovation produced by plane launches is TBD.
Only apply to non fly forward vehicle, eg copters, because magnitude of velocity innovation produced by plane launches is TBD.
@priseborough priseborough self-assigned this Nov 16, 2020
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! thanks for fixing this Paul. Grant and I will fly the changes soon

@priseborough
Copy link
Contributor Author

Testing after rebase on #15820 and running with the --force-ekf2 option to enable ekf2 use showed that the emergency yaw reset did not occur for the EKF2 instance:

TOGCS: EKF3 IMU0 buffs IMU=19 OBS=7 OF=17 EN:17 dt=0.0120
TOGCS: EKF3 IMU1 buffs IMU=19 OBS=7 OF=17 EN:17 dt=0.0120
TOGCS: EKF3 IMU0 initialised
TOGCS: EKF3 IMU1 initialised
TOGCS: EKF2 IMU0 initial yaw alignment complete
TOGCS: EKF2 IMU1 initial yaw alignment complete
TOGCS: EKF3 IMU0 initial yaw alignment complete
TOGCS: EKF3 IMU1 initial yaw alignment complete
TOGCS: EKF2 IMU0 tilt alignment complete
TOGCS: EKF2 IMU1 tilt alignment complete
TOGCS: EKF3 IMU0 tilt alignment complete
TOGCS: EKF3 IMU1 tilt alignment complete
TOGCS: EKF2 IMU0 origin set
TOGCS: EKF2 IMU1 origin set
TOGCS: EKF3 IMU0 origin set
TOGCS: EKF3 IMU1 origin set
TOGCS: EKF3 IMU0 is using GPS
TOGCS: EKF3 IMU1 is using GPS
TOGCS: EKF2 IMU0 is using GPS
TOGCS: EKF2 IMU1 is using GPS
TOGCS: EKF3 IMU0 in-flight yaw alignment complete
TOGCS: EKF3 IMU1 in-flight yaw alignment complete
TOGCS: EKF2 IMU0 in-flight yaw alignment complete
TOGCS: EKF2 IMU1 in-flight yaw alignment complete
TOGCS: EKF3 lane switch 1
TOGCS: EKF3 lane switch 0
TOGCS: EKF3 lane switch 1
TOGCS: EKF3 lane switch 0
TOGCS: EKF3 lane switch 1
TOGCS: EKF3 lane switch 0
TOGCS: EKF3 lane switch 1
TOGCS: EKF3 lane switch 0
TOGCS: EKF3 lane switch 1
TOGCS: EKF3 lane switch 0

@tridge tridge merged commit 248ef92 into ArduPilot:master Nov 16, 2020
@rmackay9
Copy link
Contributor

Sorry to be a nag but I really would like it if we could avoid any EKF3 changes that conflict with my ekf pos source PR. I understand this is an important fix but the issue has been there for a while and so I'm a little confused as to why this went in first.

@tridge
Copy link
Contributor

tridge commented Nov 16, 2020

Sorry to be a nag but I really would like it if we could avoid any EKF3 changes that conflict with my ekf pos source PR. I understand this is an important fix but the issue has been there for a while and so I'm a little confused as to why this went in first.

because it is a "fly into a tree if you have a M6 GPS". I thought it was important to get the fix in soon.
The rebase of your PR on master to remove the conflict is very simple, here is a branch with it done:
https://github.com/tridge/ardupilot/tree/ekf-pos-source2

@priseborough priseborough deleted the pr-yawEstimatorGpsGlitch branch November 16, 2020 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants