aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-04-19 23:15:51 +0200
committerLorenz Meier <lm@inf.ethz.ch>2015-04-20 09:14:14 +0200
commitc92afb99b66eacad5e2069dd8ea735ff86dabc61 (patch)
treec040494f8daed5052a67696fbfb9afce7e40dccf
parent554719c78fe4e0e07e56bc7a57877340924d0d92 (diff)
downloadpx4-firmware-c92afb99b66eacad5e2069dd8ea735ff86dabc61.tar.gz
px4-firmware-c92afb99b66eacad5e2069dd8ea735ff86dabc61.tar.bz2
px4-firmware-c92afb99b66eacad5e2069dd8ea735ff86dabc61.zip
Prearm check: provide user instruction to power cycle if things look good
-rw-r--r--src/modules/commander/state_machine_helper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp
index ccfc7a986..c7dabee7e 100644
--- a/src/modules/commander/state_machine_helper.cpp
+++ b/src/modules/commander/state_machine_helper.cpp
@@ -217,6 +217,14 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s
status->arming_state = vehicle_status_s::ARMING_STATE_STANDBY_ERROR;
}
+ /* Check if we are trying to arm, checks look good but we are in STANDBY_ERROR */
+ if (status->arming_state == vehicle_status_s::ARMING_STATE_STANDBY_ERROR &&
+ new_arming_state == vehicle_status_s::ARMING_STATE_ARMED &&
+ status->condition_system_sensors_initialized) {
+ mavlink_log_critical(mavlink_fd, "Preflight check now OK, power cycle before arming");
+ feedback_provided = true;
+ }
+
// Finish up the state transition
if (valid_transition) {
armed->armed = new_arming_state == vehicle_status_s::ARMING_STATE_ARMED || new_arming_state == vehicle_status_s::ARMING_STATE_ARMED_ERROR;