barometer does not special height sensor offset because a barometer

offset from the local origin is calculated if the primary source for
height is not baro

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman
2017-06-15 09:10:43 +02:00
committed by ChristophTobler
parent c5d464b821
commit 5036967343
+3 -3
View File
@@ -724,10 +724,10 @@ void Ekf::controlHeightFusion()
setControlBaroHeight();
_fuse_height = true;
// we have just switched to using baro height, calculate height sensor offset such that current
// measurment matches our current height estimate
// we have just switched to using baro height, we don't need to set a height sensor offset
// since we track a separate _baro_hgt_offset
if (_control_status_prev.flags.baro_hgt != _control_status.flags.baro_hgt) {
_hgt_sensor_offset = _baro_sample_delayed.hgt - _baro_hgt_offset + _state.pos(2);
_hgt_sensor_offset = 0.0f;
}
}
}