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

AP_NavEKF3: pos and vel resets default to user defined source #28693

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Nov 21, 2024

This resolves issue #27729 by using the user defined position or velocity source (e.g. EK3_SRCx_POSXY, EK3_SRCx_VELXY) whenever the caller does not specify the source.

This solution is a minimal-change solution to the problem. Another possible solution would be to remove ResetVelocity and ResetPosition's xxxResetSoiurce argument completely and instead always just use the user defined source.

This has been lightly tested in SITL to confirm that it resolves the issue. Below are before and after screen shots of SITL testing where the Vicon has been turned 90degrees from reality.

Before we see terrible behaviour (even worse than described in the issue) where the lane switches every 7 seconds and the vehicle resets to the GPS location. This results in the vehicle flying an ever expanding circle around the target at full speed
before-map-and-console

After we see nearly twitch-less transitions between Optical flow and External Nav. The two vehicles shown are the EKF's estimated position and the actual position and their positions are stable
after-map-and-console

@rmackay9 rmackay9 force-pushed the ekf-reset-source-fix branch 2 times, most recently from 1f8795f to 76194b1 Compare November 22, 2024 07:08
@priseborough
Copy link
Contributor

TXS @rmackay9

@@ -73,6 +93,26 @@ void NavEKF3_core::ResetVelocity(resetDataSource velResetSource)
// resets position states to last GPS measurement or to zero if in constant position mode
void NavEKF3_core::ResetPosition(resetDataSource posResetSource)
{
// if reset source is not specified thenn use the user defined position source
Copy link
Contributor

@peterbarker peterbarker Nov 26, 2024

Choose a reason for hiding this comment

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

Suggested change
// if reset source is not specified thenn use the user defined position source
// if reset source is not specified then use the user-defined position source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, I'll try to remember to fix this on my next pass through the code

@tridge tridge merged commit 9902274 into ArduPilot:master Nov 26, 2024
99 checks passed
@rmackay9 rmackay9 deleted the ekf-reset-source-fix branch November 26, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pending
Development

Successfully merging this pull request may close these issues.

5 participants