diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 2ecfbeaa0b867cdf638e38cb7bcb99635290e62b..6d2ca2139d8d797abe75c6bb8bd05bb081f037a9 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -730,17 +730,9 @@ bool handle_command(struct vehicle_status_s *status_local, const struct safety_s hil_state_t new_hil_state = (base_mode & VEHICLE_MODE_FLAG_HIL_ENABLED) ? vehicle_status_s::HIL_STATE_ON : vehicle_status_s::HIL_STATE_OFF; transition_result_t hil_ret = hil_state_transition(new_hil_state, status_pub, status_local, &mavlink_log_pub); - // Transition the arming state - bool cmd_arm = base_mode & VEHICLE_MODE_FLAG_SAFETY_ARMED; - - arming_ret = arm_disarm(cmd_arm, &mavlink_log_pub, "set mode command"); - - /* update home position on arming if at least 500 ms from commander start spent to avoid setting home on in-air restart */ - if (cmd_arm && (arming_ret == TRANSITION_CHANGED) && - (hrt_absolute_time() > (commander_boot_timestamp + INAIR_RESTART_HOLDOFF_INTERVAL))) { - - commander_set_home_position(*home_pub, *home, *local_pos, *global_pos, *attitude); - } + // We ignore base_mode & VEHICLE_MODE_FLAG_SAFETY_ARMED because + // the command VEHICLE_CMD_COMPONENT_ARM_DISARM should be used + // instead according to the latest mavlink spec. if (base_mode & VEHICLE_MODE_FLAG_CUSTOM_MODE_ENABLED) { /* use autopilot-specific mode */