forked from Archive/PX4-Autopilot
ekf: extract range finder noise computation
This commit is contained in:
parent
97b2947416
commit
064518f57a
|
@ -930,8 +930,9 @@ private:
|
|||
|
||||
void updateGroundEffect();
|
||||
|
||||
// return an estimation of the GPS altitude variance
|
||||
// return an estimation of the sensor altitude variance
|
||||
float getGpsHeightVariance();
|
||||
float getRngHeightVariance() const;
|
||||
|
||||
// calculate the measurement variance for the optical flow sensor
|
||||
float calcOptFlowMeasVar();
|
||||
|
|
|
@ -1361,6 +1361,14 @@ void Ekf::updateBaroHgtBias()
|
|||
}
|
||||
}
|
||||
|
||||
float Ekf::getRngHeightVariance() const
|
||||
{
|
||||
const float dist_dependant_var = sq(_params.range_noise_scaler * _range_sensor.getDistBottom());
|
||||
const float var = sq(_params.range_noise) + dist_dependant_var;
|
||||
const float var_sat = fmaxf(var, 0.01f);
|
||||
return var_sat;
|
||||
}
|
||||
|
||||
void Ekf::updateGroundEffect()
|
||||
{
|
||||
if (_control_status.flags.in_air && !_control_status.flags.fixed_wing) {
|
||||
|
|
Loading…
Reference in New Issue