Arming with IO working now

This commit is contained in:
Julian Oes 2013-06-14 16:04:23 +02:00
parent 90f5e30f2a
commit 5b21362e1f
2 changed files with 9 additions and 6 deletions

View File

@ -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;

View File

@ -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;