Copter: Add Smart RTL or LAND to the fence action

This commit is contained in:
murata 2021-01-31 11:34:21 +09:00 committed by Randy Mackay
parent a97786c01d
commit 17f285b68f

View File

@ -64,6 +64,12 @@ void Copter::fence_check()
set_mode(Mode::Number::LAND, ModeReason::FENCE_BREACHED);
}
break;
case AC_FENCE_ACTION_SMART_RTL_OR_LAND:
// Try SmartRTL, if that fails, Land
if (!set_mode(Mode::Number::SMART_RTL, ModeReason::FENCE_BREACHED)) {
set_mode(Mode::Number::LAND, ModeReason::FENCE_BREACHED);
}
break;
}
}
}