mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ekf2: fix dist bottom constraint
This commit is contained in:
parent
acc647c518
commit
b23d8244f0
@ -711,8 +711,8 @@ void EKF2::PublishLocalPosition(const hrt_abstime ×tamp)
|
||||
float terrain_vpos = _ekf.getTerrainVertPos();
|
||||
|
||||
// Distance to bottom surface (ground) in meters
|
||||
// constrain the distance to ground to _rng_gnd_clearance
|
||||
lpos.dist_bottom = math::min(terrain_vpos - lpos.z, _param_ekf2_min_rng.get());
|
||||
// constrain the distance to ground to _rng_gnd_clearance
|
||||
lpos.dist_bottom = math::max(terrain_vpos - lpos.z, _param_ekf2_min_rng.get());
|
||||
|
||||
if (!_had_valid_terrain) {
|
||||
_had_valid_terrain = lpos.dist_bottom_valid;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user