SensorRangeFinder: add distBottom function to get the vertical distance

This commit is contained in:
bresch
2020-04-03 11:01:23 +02:00
committed by Mathieu Bresciani
parent a998da1781
commit 572ad2df0a
5 changed files with 26 additions and 6 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ void Ekf::resetHeight()
// reset the vertical position
if (_control_status.flags.rng_hgt) {
const float new_pos_down = _hgt_sensor_offset - _range_sensor.getRange() * _range_sensor.getCosTilt();
const float new_pos_down = _hgt_sensor_offset - _range_sensor.getDistBottom();
// update the state and associated variance
_state.pos(2) = new_pos_down;