mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 20:30:35 +08:00
add RC kill switch
This commit is contained in:
committed by
Lorenz Meier
parent
c802b86acc
commit
8cb472af31
@@ -2284,6 +2284,18 @@ int commander_thread_main(int argc, char *argv[])
|
||||
mavlink_log_critical(mavlink_fd, "main state transition denied");
|
||||
}
|
||||
|
||||
/* check throttle kill switch */
|
||||
int prevLockdown = armed.lockdown;
|
||||
if (sp_man.kill_switch == manual_control_setpoint_s::SWITCH_POS_ON) {
|
||||
/* set lockdown flag */
|
||||
armed.lockdown = TRUE;
|
||||
} else {
|
||||
armed.lockdown = FALSE;
|
||||
}
|
||||
if (prevLockdown != armed.lockdown) {
|
||||
warnx("armed.lockdown: %d\n", armed.lockdown);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!status.rc_input_blocked && !status.rc_signal_lost) {
|
||||
mavlink_log_critical(mavlink_fd, "MANUAL CONTROL LOST (at t=%llums)", hrt_absolute_time() / 1000);
|
||||
|
||||
Reference in New Issue
Block a user