mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 15:57:35 +08:00
Commander: make RC override multicopter only
AAs discussed in the devcall this functionality is only useful for rotary-wing (multicopter) flying since it's a big safety hazard to accidentally bring a fixed wing out of an auto mode e.g. a mission and fly away in a straight line or into an obstacle.
This commit is contained in:
@@ -1825,6 +1825,7 @@ Commander::run()
|
||||
// abort auto mode or geofence reaction if sticks are moved significantly
|
||||
// but only if not in a low battery handling action
|
||||
const bool not_in_low_battery_reaction = _battery_warning < battery_status_s::BATTERY_WARNING_CRITICAL;
|
||||
const bool is_rotary_wing = status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING;
|
||||
const bool manual_mode_before_geofence =
|
||||
main_state_before_rtl == commander_state_s::MAIN_STATE_MANUAL ||
|
||||
main_state_before_rtl == commander_state_s::MAIN_STATE_ALTCTL ||
|
||||
@@ -1837,7 +1838,7 @@ Commander::run()
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_AUTO_MISSION ||
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_AUTO_LOITER;
|
||||
|
||||
if (rc_override != 0 && not_in_low_battery_reaction
|
||||
if (rc_override != 0 && is_rotary_wing && not_in_low_battery_reaction
|
||||
&& (in_auto_mode || (_geofence_warning_action_on && manual_mode_before_geofence))) {
|
||||
// transition to previous state if sticks are touched
|
||||
if ((_last_sp_man.timestamp != sp_man.timestamp) &&
|
||||
|
||||
Reference in New Issue
Block a user