mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 14:20:35 +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:
@@ -1733,6 +1733,7 @@ Commander::run()
|
||||
_arm_requirements.esc_check = _param_escs_checks_required.get();
|
||||
_arm_requirements.global_position = !_param_arm_without_gps.get();
|
||||
_arm_requirements.mission = _param_arm_mission_required.get();
|
||||
_arm_requirements.geofence = _param_geofence_action.get() > geofence_result_s::GF_ACTION_NONE;
|
||||
|
||||
/* flight mode slots */
|
||||
_flight_mode_slots[0] = _param_fltmode_1.get();
|
||||
@@ -2114,6 +2115,7 @@ Commander::run()
|
||||
|
||||
/* start geofence result check */
|
||||
_geofence_result_sub.update(&_geofence_result);
|
||||
_status.geofence_violated = _geofence_result.geofence_violated;
|
||||
|
||||
const bool in_low_battery_failsafe = _battery_warning > battery_status_s::BATTERY_WARNING_LOW;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user