|
|
|
@ -33,6 +33,9 @@ void Copter::failsafe_radio_on_event()
@@ -33,6 +33,9 @@ void Copter::failsafe_radio_on_event()
|
|
|
|
|
case FS_THR_ENABLED_ALWAYS_LAND: |
|
|
|
|
desired_action = Failsafe_Action_Land; |
|
|
|
|
break; |
|
|
|
|
case FS_THR_ENABLED_AUTO_RTL_OR_RTL: |
|
|
|
|
desired_action = Failsafe_Action_Auto_DO_LAND_START; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
desired_action = Failsafe_Action_Land; |
|
|
|
|
} |
|
|
|
@ -170,6 +173,9 @@ void Copter::failsafe_gcs_on_event(void)
@@ -170,6 +173,9 @@ void Copter::failsafe_gcs_on_event(void)
|
|
|
|
|
case FS_GCS_ENABLED_ALWAYS_LAND: |
|
|
|
|
desired_action = Failsafe_Action_Land; |
|
|
|
|
break; |
|
|
|
|
case FS_GCS_ENABLED_AUTO_RTL_OR_RTL: |
|
|
|
|
desired_action = Failsafe_Action_Auto_DO_LAND_START; |
|
|
|
|
break; |
|
|
|
|
default: // if an invalid parameter value is set, the fallback is RTL
|
|
|
|
|
desired_action = Failsafe_Action_RTL; |
|
|
|
|
} |
|
|
|
@ -336,6 +342,18 @@ void Copter::set_mode_SmartRTL_or_RTL(ModeReason reason)
@@ -336,6 +342,18 @@ void Copter::set_mode_SmartRTL_or_RTL(ModeReason reason)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Sets mode to Auto and jumps to DO_LAND_START, as set with AUTO_RTL param
|
|
|
|
|
// This can come from failsafe or RC option
|
|
|
|
|
void Copter::set_mode_auto_do_land_start_or_RTL(ModeReason reason) |
|
|
|
|
{ |
|
|
|
|
if (copter.mode_auto.jump_to_landing_sequence_auto_RTL(reason)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gcs().send_text(MAV_SEVERITY_WARNING, "Trying RTL Mode"); |
|
|
|
|
set_mode_RTL_or_land_with_pause(reason); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Copter::should_disarm_on_failsafe() { |
|
|
|
|
if (ap.in_arming_delay) { |
|
|
|
|
return true; |
|
|
|
@ -383,6 +401,10 @@ void Copter::do_failsafe_action(Failsafe_Action action, ModeReason reason){
@@ -383,6 +401,10 @@ void Copter::do_failsafe_action(Failsafe_Action action, ModeReason reason){
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case Failsafe_Action_Auto_DO_LAND_START: |
|
|
|
|
set_mode_auto_do_land_start_or_RTL(reason); |
|
|
|
|
AP_Notify::events.failsafe_mode_change = 1; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if GRIPPER_ENABLED == ENABLED |
|
|
|
|