aboutsummaryrefslogtreecommitdiff
path: root/apps/commander/state_machine_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/commander/state_machine_helper.c')
-rw-r--r--apps/commander/state_machine_helper.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/commander/state_machine_helper.c b/apps/commander/state_machine_helper.c
index 68b4bbe30..f1de99e4d 100644
--- a/apps/commander/state_machine_helper.c
+++ b/apps/commander/state_machine_helper.c
@@ -304,8 +304,11 @@ int do_arming_state_update(int status_pub, struct vehicle_status_s *current_stat
bool valid_transition = false;
int ret = ERROR;
+ warnx("Current state: %d, requested state: %d", current_status->arming_state, new_state);
+
if (current_status->arming_state == new_state) {
warnx("Arming state not changed");
+ valid_transition = true;
} else {
@@ -333,6 +336,12 @@ int do_arming_state_update(int status_pub, struct vehicle_status_s *current_stat
} else {
mavlink_log_critical(mavlink_fd, "REJ. STANDBY arming state, sensors not init.");
}
+
+ } else if (current_status->arming_state == ARMING_STATE_ARMED) {
+
+ current_status->flag_system_armed = false;
+ mavlink_log_critical(mavlink_fd, "Switched to STANDBY arming state");
+ valid_transition = true;
}
break;