mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 12:30:34 +08:00
commander: enforce yaw-airmode to have an arming switch mapped
Yaw airmode w/o arming switch is most likely not what you want and will lead to surprising results.
This commit is contained in:
@@ -1526,6 +1526,13 @@ Commander::run()
|
||||
|
||||
param_get(_param_takeoff_finished_action, &takeoff_complete_act);
|
||||
|
||||
/* check for unsafe Airmode settings: yaw airmode requires the use of an arming switch */
|
||||
if (_airmode.get() == 2 && _rc_map_arm_switch.get() == 0) {
|
||||
_airmode.set(1); // change to roll/pitch airmode
|
||||
_airmode.commit();
|
||||
mavlink_log_critical(&mavlink_log_pub, "Yaw Airmode requires the use of an Arm Switch")
|
||||
}
|
||||
|
||||
param_init_forced = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user