forked from Archive/PX4-Autopilot
Arming with IO working now
This commit is contained in:
parent
90f5e30f2a
commit
5b21362e1f
|
@ -728,12 +728,11 @@ PX4IO::io_set_arming_state()
|
|||
} else {
|
||||
clear |= PX4IO_P_SETUP_ARMING_FMU_ARMED;
|
||||
}
|
||||
// TODO fix this
|
||||
// if (armed.ready_to_arm) {
|
||||
// set |= PX4IO_P_SETUP_ARMING_IO_ARM_OK;
|
||||
// } else {
|
||||
// clear |= PX4IO_P_SETUP_ARMING_IO_ARM_OK;
|
||||
// }
|
||||
if (safety.ready_to_arm) {
|
||||
set |= PX4IO_P_SETUP_ARMING_IO_ARM_OK;
|
||||
} else {
|
||||
clear |= PX4IO_P_SETUP_ARMING_IO_ARM_OK;
|
||||
}
|
||||
|
||||
if (vstatus.flag_external_manual_override_ok) {
|
||||
set |= PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE_OK;
|
||||
|
|
|
@ -70,6 +70,7 @@ int arming_state_transition(int status_pub, struct vehicle_status_s *current_sta
|
|||
if (current_state->arming_state == ARMING_STATE_STANDBY) {
|
||||
ret = OK;
|
||||
safety->armed = false;
|
||||
safety->ready_to_arm = false;
|
||||
}
|
||||
break;
|
||||
case ARMING_STATE_STANDBY:
|
||||
|
@ -82,6 +83,7 @@ int arming_state_transition(int status_pub, struct vehicle_status_s *current_sta
|
|||
if (current_state->condition_system_sensors_initialized) {
|
||||
ret = OK;
|
||||
safety->armed = false;
|
||||
safety->ready_to_arm = true;
|
||||
} else {
|
||||
mavlink_log_critical(mavlink_fd, "Rej. STANDBY state, sensors not initialized");
|
||||
}
|
||||
|
@ -115,6 +117,7 @@ int arming_state_transition(int status_pub, struct vehicle_status_s *current_sta
|
|||
|| current_state->arming_state == ARMING_STATE_ARMED_ERROR) {
|
||||
ret = OK;
|
||||
safety->armed = false;
|
||||
safety->ready_to_arm = false;
|
||||
}
|
||||
break;
|
||||
case ARMING_STATE_REBOOT:
|
||||
|
@ -126,6 +129,7 @@ int arming_state_transition(int status_pub, struct vehicle_status_s *current_sta
|
|||
|
||||
ret = OK;
|
||||
safety->armed = false;
|
||||
safety->ready_to_arm = false;
|
||||
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue