mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 16:43:34 +08:00
commander: added prearm check for geofence violation
- if geofence action is not none, then don't allow arming outside of geofence Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -86,6 +86,7 @@ public:
|
||||
bool esc_check = false;
|
||||
bool global_position = false;
|
||||
bool mission = false;
|
||||
bool geofence = false;
|
||||
};
|
||||
|
||||
static bool preArmCheck(orb_advert_t *mavlink_log_pub, const vehicle_status_flags_s &status_flags,
|
||||
|
||||
@@ -168,6 +168,14 @@ bool PreFlightCheck::preArmCheck(orb_advert_t *mavlink_log_pub, const vehicle_st
|
||||
}
|
||||
}
|
||||
|
||||
if (arm_requirements.geofence && status.geofence_violated) {
|
||||
if (report_fail) {
|
||||
mavlink_log_critical(mavlink_log_pub, "Arming denied, vehicle outside geofence");
|
||||
}
|
||||
|
||||
prearm_ok = false;
|
||||
}
|
||||
|
||||
// Arm Requirements: authorization
|
||||
// check last, and only if everything else has passed
|
||||
if (arm_requirements.arm_authorization && prearm_ok) {
|
||||
|
||||
Reference in New Issue
Block a user