mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 22:30:34 +08:00
Navigator: add terrain collision avoidance logic for Mission/RTL
Avoid flying into terrain using the distance sensor. Enable through the parameter NAV_MIN_GND_DIST. Only active during commanded descents with vz>0 (to prevent climb-aways), excluding landing and VTOL transitions. It changes the altitude setpoint in the triplet to maintain the current altitude and republish the triplet. We also change the mission item altitude used for acceptance calculations to prevent getting stuck in a loop. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -104,6 +104,11 @@ void RtlDirect::on_active()
|
||||
set_rtl_item();
|
||||
}
|
||||
|
||||
if (_rtl_state == RTLState::LOITER_HOLD) { //TODO: rename _rtl_state to _rtl_state_next
|
||||
//check for terrain collision and update altitude if needed
|
||||
updateAltToAvoidTerrainCollisionAndRepublishTriplet(_mission_item);
|
||||
}
|
||||
|
||||
if (_rtl_state == RTLState::LAND && _param_rtl_pld_md.get() > 0) {
|
||||
// Need to update the position and type on the current setpoint triplet.
|
||||
_navigator->get_precland()->on_active();
|
||||
|
||||
Reference in New Issue
Block a user