mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 22:13:33 +08:00
mission: be more intelligent about saying that we are on a mission landing
- previously the decision of being on a landing pattern was taken by just looking at the current mission index. However, even if the current mission index indicates a landing pattern the vehicle could be at an arbitrary location, far from being established on the pattern. Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -225,8 +225,10 @@ void RTL::on_activation()
|
||||
// For safety reasons don't go into RTL if landed.
|
||||
_rtl_state = RTL_STATE_LANDED;
|
||||
|
||||
} else if ((_destination.type == RTL_DESTINATION_MISSION_LANDING) && _navigator->on_mission_landing()) {
|
||||
} else if ((_destination.type == RTL_DESTINATION_MISSION_LANDING) && _navigator->getMissionLandingInProgress()) {
|
||||
// RTL straight to RETURN state, but mission will takeover for landing.
|
||||
_rtl_state = RTL_STATE_RETURN;
|
||||
|
||||
|
||||
} else if ((global_position.alt < _destination.alt + _param_rtl_return_alt.get()) || _rtl_alt_min) {
|
||||
|
||||
@@ -239,7 +241,10 @@ void RTL::on_activation()
|
||||
_rtl_state = RTL_STATE_RETURN;
|
||||
}
|
||||
|
||||
setInitialClimbDone(_rtl_state != RTL_STATE_CLIMB);
|
||||
|
||||
set_rtl_item();
|
||||
|
||||
}
|
||||
|
||||
void RTL::on_active()
|
||||
@@ -476,6 +481,7 @@ void RTL::advance_rtl()
|
||||
|
||||
switch (_rtl_state) {
|
||||
case RTL_STATE_CLIMB:
|
||||
setInitialClimbDone(true);
|
||||
_rtl_state = RTL_STATE_RETURN;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user