Position estimator position and velocity corrections fix #11270
+24
−19
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.
User description
Should provide a fix for #10360, #10391, #10893 and #11049.
See #11049 (comment) for explanation and reason for change.
HITL testing shows the estimate instability is fixed with the PR changes. Not easy to flight test given the odd set of circumstances need to trigger the problem in the first place.
INAV_EST_CORR_LIMIT_VALUEmay need tweaking. It corresponds to around 40m residual error for x/y position at the default loop rate.PR Type
Bug fix
Description
Fix position estimator instability by directly resetting estimates instead of accumulating corrections
Add correction limiting to prevent excessive estimate adjustments per loop iteration
Constrain uncertainty estimates to prevent unbounded growth
Simplify velocity decay calculation and improve code clarity
Diagram Walkthrough
File Walkthrough
navigation_pos_estimator.c
Correct estimate initialization and add correction limitssrc/main/navigation/navigation_pos_estimator.c
to directly resetting position and velocity to GPS values
corrections within
INAV_EST_CORR_LIMIT_VALUEbounds0.0f -operations
unbounded growth
inttouint8_tfor typeconsistency
navigation_pos_estimator_private.h
Define correction limit constantsrc/main/navigation/navigation_pos_estimator_private.h
INAV_EST_CORR_LIMIT_VALUEset to 2.0f to limitmaximum position/velocity correction per loop iteration
position at default loop rate