aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Jansen <jnsn.johan@gmail.com>2015-03-08 14:51:59 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-04-20 09:14:12 +0200
commit4654d0f4fcf5d76bdd0f186c013ed1e349d08053 (patch)
tree8682dd732fcf806061ca0b21b19f2f8f119d5148
parentb70138c631985fe09a3f373a3084346811199878 (diff)
downloadpx4-firmware-4654d0f4fcf5d76bdd0f186c013ed1e349d08053.tar.gz
px4-firmware-4654d0f4fcf5d76bdd0f186c013ed1e349d08053.tar.bz2
px4-firmware-4654d0f4fcf5d76bdd0f186c013ed1e349d08053.zip
Commander: Enter ARMING_STATE_STANDBY_ERROR by default if preflight has failed
-rw-r--r--src/modules/commander/state_machine_helper.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp
index e1d2d72d1..58a123adf 100644
--- a/src/modules/commander/state_machine_helper.cpp
+++ b/src/modules/commander/state_machine_helper.cpp
@@ -78,11 +78,11 @@ static const int ERROR = -1;
// code for those checks.
static const bool arming_transitions[vehicle_status_s::ARMING_STATE_MAX][vehicle_status_s::ARMING_STATE_MAX] = {
// INIT, STANDBY, ARMED, ARMED_ERROR, STANDBY_ERROR, REBOOT, IN_AIR_RESTORE
- { /* vehicle_status_s::ARMING_STATE_INIT */ true, true, false, false, false, false, false },
+ { /* vehicle_status_s::ARMING_STATE_INIT */ true, true, false, false, true, false, false },
{ /* vehicle_status_s::ARMING_STATE_STANDBY */ true, true, true, true, false, false, false },
{ /* vehicle_status_s::ARMING_STATE_ARMED */ false, true, true, false, false, false, true },
{ /* vehicle_status_s::ARMING_STATE_ARMED_ERROR */ false, false, true, true, false, false, false },
- { /* vehicle_status_s::ARMING_STATE_STANDBY_ERROR */ true, true, false, true, true, false, false },
+ { /* vehicle_status_s::ARMING_STATE_STANDBY_ERROR */ true, true, true, true, true, false, false },
{ /* vehicle_status_s::ARMING_STATE_REBOOT */ true, true, false, false, true, true, true },
{ /* vehicle_status_s::ARMING_STATE_IN_AIR_RESTORE */ false, false, false, false, false, false, false }, // NYI
};
@@ -215,6 +215,7 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s
mavlink_log_critical(mavlink_fd, "NOT ARMING: Sensors not operational.");
feedback_provided = true;
valid_transition = false;
+ new_arming_state = vehicle_status_s::ARMING_STATE_STANDBY_ERROR;
}
// Finish up the state transition