Skip to content

Commit 4c2a49d

Browse files
committed
fix observation_variance unit mismatch in comparison
1 parent 0f15eea commit 4c2a49d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/modules/ekf2/EKF/aid_sources/gnss/gps_control.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,14 @@ void Ekf::controlGnssYawEstimator(estimator_aid_source3d_s &aid_src_vel)
378378
{
379379
// update yaw estimator velocity (basic sanity check on GNSS velocity data)
380380
const float vel_var = aid_src_vel.observation_variance[0];
381+
const float vel_accuracy = sqrtf(vel_var);
381382
const Vector2f vel_xy(aid_src_vel.observation);
382383

383384
if ((vel_var > 0.f)
384-
&& (vel_var < _params.ekf2_req_sacc)
385+
&& (vel_accuracy < _params.ekf2_req_sacc)
385386
&& vel_xy.isAllFinite()) {
386387

387-
_yawEstimator.fuseVelocity(vel_xy, vel_var, _control_status.flags.in_air);
388+
_yawEstimator.fuseVelocity(vel_xy, vel_accuracy, _control_status.flags.in_air);
388389

389390
// Try to align yaw using estimate if available
390391
if (((_params.ekf2_gps_ctrl & static_cast<int32_t>(GnssCtrl::VEL))

0 commit comments

Comments
 (0)