Browse Source

fixed_airspeed_healthy_bug

master
CarlOlsson 9 years ago
parent
commit
ee7d7aeb8a
  1. 11
      EKF/airspeed_fusion.cpp
  2. 2
      EKF/estimator_interface.h

11
EKF/airspeed_fusion.cpp

@ -163,9 +163,9 @@ void Ekf::fuseAirspeed()
} }
// calculate measurement innovation // Calculate measurement innovation
_airspeed_innov = v_tas_pred - _airspeed_innov = v_tas_pred -
_airspeed_sample_delayed.true_airspeed; // This is TAS, maybe we should indicate that in some way _airspeed_sample_delayed.true_airspeed;
// Calculate the innovation variance // Calculate the innovation variance
_airspeed_innov_var = 1.0f / SK_TAS[0]; _airspeed_innov_var = 1.0f / SK_TAS[0];
@ -173,13 +173,16 @@ void Ekf::fuseAirspeed()
// Compute the ratio of innovation to gate size // Compute the ratio of innovation to gate size
_tas_test_ratio = sq(_airspeed_innov) / (sq(fmaxf(_params.tas_innov_gate, 1.0f)) * _airspeed_innov_var); _tas_test_ratio = sq(_airspeed_innov) / (sq(fmaxf(_params.tas_innov_gate, 1.0f)) * _airspeed_innov_var);
// if the innocation consistency check fails then don't fuse the sample and indicate bad airspeed health // If the innovation consistency check fails then don't fuse the sample and indicate bad airspeed health
if (_tas_test_ratio > 1.0f) { if (_tas_test_ratio > 1.0f) {
_airspeed_healthy = false; _airspeed_healthy = false;
return; return;
} }
else {
_airspeed_healthy = true;
}
// airspeed measurement sample has passed check so record it // Airspeed measurement sample has passed check so record it
_time_last_arsp_fuse = _time_last_imu; _time_last_arsp_fuse = _time_last_imu;

2
EKF/estimator_interface.h

@ -262,7 +262,7 @@ protected:
struct map_projection_reference_s _pos_ref = {}; // Contains WGS-84 position latitude and longitude (radians) struct map_projection_reference_s _pos_ref = {}; // Contains WGS-84 position latitude and longitude (radians)
bool _mag_healthy; // computed by mag innovation test bool _mag_healthy; // computed by mag innovation test
float _airspeed_healthy; // computed by airspeed innovation test bool _airspeed_healthy; // computed by airspeed innovation test
float _yaw_test_ratio; // yaw innovation consistency check ratio float _yaw_test_ratio; // yaw innovation consistency check ratio
float _mag_test_ratio[3]; // magnetometer XYZ innovation consistency check ratios float _mag_test_ratio[3]; // magnetometer XYZ innovation consistency check ratios
float _vel_pos_test_ratio[6]; // velocity and position innovation consistency check ratios float _vel_pos_test_ratio[6]; // velocity and position innovation consistency check ratios

Loading…
Cancel
Save