AP_NavEKF3: pos and vel resets default to user defined source #28693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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