mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 19:00:35 +08:00
add constraint to ground distance to avoid values below rng_gnd_clearance (#7662)
This commit is contained in:
committed by
Paul Riseborough
parent
a6c682ce50
commit
bc951f6f15
@@ -942,6 +942,12 @@ void Ekf2::run()
|
||||
lpos.dist_bottom_valid = _ekf.get_terrain_valid();
|
||||
_ekf.get_terrain_vert_pos(&terrain_vpos);
|
||||
lpos.dist_bottom = terrain_vpos - pos[2]; // Distance to bottom surface (ground) in meters
|
||||
|
||||
// constrain the distance to ground to _params->rng_gnd_clearance
|
||||
if (lpos.dist_bottom < _params->rng_gnd_clearance) {
|
||||
lpos.dist_bottom = _params->rng_gnd_clearance;
|
||||
}
|
||||
|
||||
lpos.dist_bottom_rate = -velocity[2]; // Distance to bottom surface (ground) change rate
|
||||
lpos.surface_bottom_timestamp = now; // Time when new bottom surface found
|
||||
|
||||
|
||||
Reference in New Issue
Block a user