prevent RTL if already landing

This commit is contained in:
Jake Dahl
2018-07-25 13:45:49 -06:00
committed by Lorenz Meier
parent 7c84e77312
commit 130cdf25bf
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -520,7 +520,7 @@ MissionBlock::mission_item_to_position_setpoint(const mission_item_s &item, posi
// if already flying (armed and !landed) treat TAKEOFF like regular POSITION
if ((_navigator->get_vstatus()->arming_state == vehicle_status_s::ARMING_STATE_ARMED)
&& !_navigator->get_land_detected()->landed) {
&& !_navigator->get_land_detected()->landed && !_navigator->get_land_detected()->maybe_landed) {
sp->type = position_setpoint_s::SETPOINT_TYPE_POSITION;
+3 -2
View File
@@ -72,8 +72,9 @@ RTL::rtl_type() const
void
RTL::on_activation()
{
if (_navigator->get_land_detected()->landed) {
// for safety reasons don't go into RTL if landed
if (_navigator->get_land_detected()->landed
|| (_navigator->get_position_setpoint_triplet()->current.type == position_setpoint_s::SETPOINT_TYPE_LAND)) {
// for safety reasons don't go into RTL if landed or currently in landing
_rtl_state = RTL_STATE_LANDED;
} else if ((rtl_type() == RTL_LAND) && _navigator->on_mission_landing()) {