Skip to content

fix(ekf2): fix observation_variance unit mismatch in comparison#27044

Open
AkaiEurus wants to merge 1 commit intoPX4:mainfrom
AkaiEurus:pr-fix-observation-variance-unit-mismatch
Open

fix(ekf2): fix observation_variance unit mismatch in comparison#27044
AkaiEurus wants to merge 1 commit intoPX4:mainfrom
AkaiEurus:pr-fix-observation-variance-unit-mismatch

Conversation

@AkaiEurus
Copy link
Copy Markdown
Contributor

Solved Problem

This PR fixes a units mismatch in Ekf::controlGnssYawEstimator().
Previously, the code used aid_src_vel.observation_variance[0] (vel_var, in m^2/s^2) as if it were a 1-sigma speed accuracy (m/s):

  • compared directly against EKF2_REQ_SACC (m/s)
  • passed directly to EKFGSF_yaw::fuseVelocity(), which expects 1-sigma accuracy (m/s)

Changelog Entry

For release notes:

Bugfix: fix observation_variance unit mismatch in comparison

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a GNSS velocity units mismatch in Ekf::controlGnssYawEstimator() so the EKF-GSF yaw estimator receives and validates GNSS speed accuracy in the correct units (m/s) instead of variance (m²/s²).

Changes:

  • Convert GNSS velocity observation variance to 1-sigma velocity accuracy using sqrtf().
  • Compare 1-sigma accuracy against EKF2_REQ_SACC (m/s) instead of comparing variance to a speed threshold.
  • Pass 1-sigma accuracy (m/s) into EKFGSF_yaw::fuseVelocity() as expected by its API.

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.

2 participants