mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 00:13:35 +08:00
Prearm check: provide user instruction to power cycle if things look good
This commit is contained in:
@@ -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;
|
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
|
// Finish up the state transition
|
||||||
if (valid_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;
|
armed->armed = new_arming_state == vehicle_status_s::ARMING_STATE_ARMED || new_arming_state == vehicle_status_s::ARMING_STATE_ARMED_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user