From d985887468435fd28ed5d07d82149a8ea417c88c Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 14 Oct 2020 21:23:40 -0400 Subject: [PATCH] ekf2: use new Param<> reset method --- src/modules/ekf2/EKF2.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/ekf2/EKF2.cpp b/src/modules/ekf2/EKF2.cpp index 53e689e6c4..92f958b472 100644 --- a/src/modules/ekf2/EKF2.cpp +++ b/src/modules/ekf2/EKF2.cpp @@ -416,12 +416,9 @@ void EKF2::Run() if ((_vehicle_status.arming_state != vehicle_status_s::ARMING_STATE_ARMED) && (_invalid_mag_id_count > 100)) { // the sensor ID used for the last saved mag bias is not confirmed to be the same as the current sensor ID // this means we need to reset the learned bias values to zero - _param_ekf2_magbias_x.set(0.f); - _param_ekf2_magbias_x.commit_no_notification(); - _param_ekf2_magbias_y.set(0.f); - _param_ekf2_magbias_y.commit_no_notification(); - _param_ekf2_magbias_z.set(0.f); - _param_ekf2_magbias_z.commit_no_notification(); + _param_ekf2_magbias_x.reset(); + _param_ekf2_magbias_y.reset(); + _param_ekf2_magbias_z.reset(); _param_ekf2_magbias_id.set(magnetometer.device_id); _param_ekf2_magbias_id.commit();