Added check for offboard_control_signal_lost when switching to offboard mode with rc switch

This commit is contained in:
Diogo Machado
2014-01-29 15:39:58 +00:00
parent a037861ec2
commit 59a5f37b7f
+2 -2
View File
@@ -1478,8 +1478,8 @@ check_mode_switches(struct manual_control_setpoint_s *sp_man, struct vehicle_sta
if (!isfinite(sp_man->offboard_switch)) {
current_status->offboard_switch = OFFBOARD_SWITCH_NONE;
} else if (sp_man->offboard_switch > STICK_ON_OFF_LIMIT) {
current_status->offboard_switch = OFFBOARD_SWITCH_OFFBOARD;
} else if (sp_man->offboard_switch > STICK_ON_OFF_LIMIT && !status.offboard_control_signal_lost) {
current_status->offboard_switch = OFFBOARD_SWITCH_OFFBOARD;
} else {
current_status->offboard_switch = OFFBOARD_SWITCH_ONBOARD;