EKF: Consolidate range finder checking

This brings all the range finder data checks (excluding innovation consistency checks) into one place and eliminates the need to perform range checking external to the library.
The hard coded optical flow tilt limit is changed to use the same value as the range finder.
Variable names are changed to make a clear distinction between the max/min values calculated by the stuck range check and the max/min valid values for the sensor.
This commit is contained in:
Paul Riseborough
2018-07-12 18:20:50 +02:00
committed by Lorenz Meier
parent e1661a92c3
commit 4d59c834eb
5 changed files with 53 additions and 30 deletions
+4 -4
View File
@@ -237,8 +237,8 @@ public:
// set sensor limitations reported by the rangefinder
void set_rangefinder_limits(float min_distance, float max_distance)
{
_rng_min_distance = min_distance;
_rng_max_distance = max_distance;
_rng_valid_min_val = min_distance;
_rng_valid_max_val = max_distance;
}
// set sensor limitations reported by the optical flow sensor
@@ -429,8 +429,8 @@ protected:
float _air_density{CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C}; // air density (kg/m**3)
// Sensor limitations
float _rng_min_distance{0.0f}; ///< minimum distance that the rangefinder can measure (m)
float _rng_max_distance{0.0f}; ///< maximum distance that the rangefinder can measure (m)
float _rng_valid_min_val{0.0f}; ///< minimum distance that the rangefinder can measure (m)
float _rng_valid_max_val{0.0f}; ///< maximum distance that the rangefinder can measure (m)
float _flow_max_rate{0.0f}; ///< maximum angular flow rate that the optical flow sensor can measure (rad/s)
float _flow_min_distance{0.0f}; ///< minimum distance that the optical flow sensor can operate at (m)
float _flow_max_distance{0.0f}; ///< maximum distance that the optical flow sensor can operate at (m)