mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:38:52 +08:00
run arm authorization as last pre-arm check, as it used to be implemented
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -1089,15 +1089,6 @@ bool prearm_check(orb_advert_t *mavlink_log_pub, const vehicle_status_flags_s &s
|
|||||||
prearm_ok = false;
|
prearm_ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Arm Requirements: authorization
|
|
||||||
// check last, and only if everything else has passed
|
|
||||||
if ((arm_requirements & ARM_REQ_ARM_AUTH_BIT) && prearm_ok) {
|
|
||||||
if (arm_auth_check() != vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED) {
|
|
||||||
// feedback provided in arm_auth_check
|
|
||||||
prearm_ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status_flags.avoidance_system_required && !status_flags.avoidance_system_valid) {
|
if (status_flags.avoidance_system_required && !status_flags.avoidance_system_valid) {
|
||||||
if (prearm_ok && reportFailures) {
|
if (prearm_ok && reportFailures) {
|
||||||
mavlink_log_critical(mavlink_log_pub, "Arming denied! Avoidance system not ready");
|
mavlink_log_critical(mavlink_log_pub, "Arming denied! Avoidance system not ready");
|
||||||
@@ -1114,6 +1105,15 @@ bool prearm_check(orb_advert_t *mavlink_log_pub, const vehicle_status_flags_s &s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Arm Requirements: authorization
|
||||||
|
// check last, and only if everything else has passed
|
||||||
|
if ((arm_requirements & ARM_REQ_ARM_AUTH_BIT) && prearm_ok) {
|
||||||
|
if (arm_auth_check() != vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED) {
|
||||||
|
// feedback provided in arm_auth_check
|
||||||
|
prearm_ok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return prearm_ok;
|
return prearm_ok;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user