ekf2: format fixes

This commit is contained in:
Paul Riseborough
2017-05-03 08:37:14 +02:00
committed by Lorenz Meier
parent 1a2ef45a4b
commit b64e40b5da
+3 -1
View File
@@ -158,7 +158,8 @@ private:
float _acc_hor_filt = 0.0f; // low-pass filtered horizontal acceleration float _acc_hor_filt = 0.0f; // low-pass filtered horizontal acceleration
// Used to check, save and use learned magnetometer biases // Used to check, save and use learned magnetometer biases
hrt_abstime _last_invalid_magcal_us = 0; // last time the conditions for a valid ekf magnetometer cal were not met (usec) hrt_abstime _last_invalid_magcal_us =
0; // last time the conditions for a valid ekf magnetometer cal were not met (usec)
float _last_valid_mag_cal[3] = {}; // last valid XYZ magnetometer bias estimates (mGauss) float _last_valid_mag_cal[3] = {}; // last valid XYZ magnetometer bias estimates (mGauss)
bool _valid_cal_available[3] = {}; // true when an unsaved valid calibration for the XYZ magnetometer bias is available bool _valid_cal_available[3] = {}; // true when an unsaved valid calibration for the XYZ magnetometer bias is available
float _last_valid_variance[3] = {}; // variances for the last valid magnetometer XYZ bias estimates (mGauss**2) float _last_valid_variance[3] = {}; // variances for the last valid magnetometer XYZ bias estimates (mGauss**2)
@@ -1024,6 +1025,7 @@ void Ekf2::task_main()
// Don't record bias estimates to save later if variances are outside the valid range // Don't record bias estimates to save later if variances are outside the valid range
float max_var_allowed = 100.0f * _mag_bias_saved_variance.get(); float max_var_allowed = 100.0f * _mag_bias_saved_variance.get();
float min_var_allowed = 0.01f * _mag_bias_saved_variance.get(); float min_var_allowed = 0.01f * _mag_bias_saved_variance.get();
for (uint8_t axis_index = 0; axis_index <= 2; axis_index++) { for (uint8_t axis_index = 0; axis_index <= 2; axis_index++) {
if (status.covariances[axis_index + 19] > min_var_allowed if (status.covariances[axis_index + 19] > min_var_allowed
&& status.covariances[axis_index + 19] < max_var_allowed) { && status.covariances[axis_index + 19] < max_var_allowed) {