EKF: Use common timeout test for reporting deadreckoning

Use a parameter to set the time-out threshold
Use a class variable for the time-out flag
Clean up comments
This commit is contained in:
Paul Riseborough
2017-03-15 07:57:38 +01:00
committed by Lorenz Meier
parent 6ac7e2f807
commit 040639837e
5 changed files with 33 additions and 44 deletions
+6 -1
View File
@@ -107,10 +107,15 @@ void Ekf::controlFusionModes()
controlAirDataFusion();
controlBetaFusion();
// for efficiency, fusion of direct state observations for position ad velocity is performed sequentially
// for efficiency, fusion of direct state observations for position and velocity is performed sequentially
// in a single function using sensor data from multiple sources (GPS, external vision, baro, range finder, etc)
controlVelPosFusion();
// report dead reckoning if we are no longer fusing measurements that constrain velocity drift
_is_dead_reckoning = (_time_last_imu - _time_last_pos_fuse > _params.no_aid_timeout_max)
&& (_time_last_imu - _time_last_vel_fuse > _params.no_aid_timeout_max)
&& (_time_last_imu - _time_last_of_fuse > _params.no_aid_timeout_max);
}
void Ekf::controlExternalVisionFusion()