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
+2 -2
View File
@@ -1060,9 +1060,9 @@ hagl_max : Maximum height above ground (meters). NaN when limiting is not needed
void Ekf::get_ekf_ctrl_limits(float *vxy_max, float *vz_max, float *hagl_min, float *hagl_max)
{
// Calculate range finder limits
float rangefinder_hagl_min = _rng_min_distance;
float rangefinder_hagl_min = _rng_valid_min_val;
// Allow use of 75% of rangefinder maximum range to allow for angular motion
float rangefinder_hagl_max = 0.75f * _rng_max_distance;
float rangefinder_hagl_max = 0.75f * _rng_valid_max_val;
// Calculate optical flow limits
// Allow ground relative velocity to use 50% of available flow sensor range to allow for angular motion