mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
fixed baro offset calculation
- do not subtract the height sensor offset variable when computing the baro offset from the local origin. The baro height offset is calculated when baro is not fused and so the height sensor offset used in that case is associated to another sensor and has nothing to do with the baro. Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
parent
39983a7d55
commit
182ea43445
@ -766,7 +766,7 @@ void Ekf::controlHeightFusion()
|
||||
local_time_step = math::constrain(local_time_step, 0.0f, 1.0f);
|
||||
|
||||
// apply a 10 second first order low pass filter to baro offset
|
||||
float offset_rate_correction = 0.1f * (_baro_sample_delayed.hgt - _hgt_sensor_offset + _state.pos(
|
||||
float offset_rate_correction = 0.1f * (_baro_sample_delayed.hgt + _state.pos(
|
||||
2) - _baro_hgt_offset);
|
||||
_baro_hgt_offset += local_time_step * math::constrain(offset_rate_correction, -0.1f, 0.1f);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user