mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
enable ground effect zone when valid terrain estimate is available
This commit is contained in:
committed by
Roman Bapst
parent
aa36fa2dfd
commit
0c24aa6149
@@ -1253,10 +1253,6 @@ void Ekf2::run()
|
|||||||
if (vehicle_land_detected_updated) {
|
if (vehicle_land_detected_updated) {
|
||||||
if (orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &vehicle_land_detected) == PX4_OK) {
|
if (orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &vehicle_land_detected) == PX4_OK) {
|
||||||
_ekf.set_in_air_status(!vehicle_land_detected.landed);
|
_ekf.set_in_air_status(!vehicle_land_detected.landed);
|
||||||
|
|
||||||
if (_gnd_effect_deadzone.get() > 0.0f) {
|
|
||||||
_ekf.set_gnd_effect_flag(vehicle_land_detected.in_ground_effect);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1397,6 +1393,11 @@ void Ekf2::run()
|
|||||||
lpos.dist_bottom = _rng_gnd_clearance.get();
|
lpos.dist_bottom = _rng_gnd_clearance.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update ground effect flag based on terrain estimation
|
||||||
|
if (lpos.dist_bottom_valid && lpos.dist_bottom < _gnd_effect_deadzone.get()) {
|
||||||
|
_ekf.set_gnd_effect_flag(true);
|
||||||
|
}
|
||||||
|
|
||||||
lpos.dist_bottom_rate = -lpos.vz; // Distance to bottom surface (ground) change rate
|
lpos.dist_bottom_rate = -lpos.vz; // Distance to bottom surface (ground) change rate
|
||||||
|
|
||||||
_ekf.get_ekf_lpos_accuracy(&lpos.eph, &lpos.epv);
|
_ekf.get_ekf_lpos_accuracy(&lpos.eph, &lpos.epv);
|
||||||
|
|||||||
Reference in New Issue
Block a user