Skip to content

fixed altitude estimator error estimation #10367

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

Merged

Conversation

RomanLut
Copy link
Contributor

ISSUE:

The signed difference is currently used to update the error estimation in the altitude estimator. A large negative difference incorrectly reduces the error, while it should actually increase the error.

Explanation: The difference gpsAltResudual should be passed through fabsf() to ensure that the error magnitude is always positive, preventing incorrect reduction of the error when the difference is negative.

IS:

const float gpsAltResudual = posEstimator.gps.pos.z - posEstimator.est.pos.z;
ctx->newEPV = updateEPE(posEstimator.est.epv, ctx->dt, MAX(posEstimator.gps.epv, gpsAltResudual), positionEstimationConfig()->w_z_gps_p);

SHOULD:

ctx->newEPV = updateEPE(posEstimator.est.epv, ctx->dt, MAX(posEstimator.gps.epv, fabsf(gpsAltResudual)), positionEstimationConfig()->w_z_gps_p);

@sensei-hacker sensei-hacker merged commit c5febe2 into iNavFlight:master Sep 18, 2024
21 checks passed
@MrD-RC MrD-RC added this to the 8.0 milestone Nov 19, 2024
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.

3 participants