Skip to content
Snippets Groups Projects
Commit 24dc3169 authored by Beat Küng's avatar Beat Küng
Browse files

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.
parent cf666562
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -110,7 +110,10 @@ private:
(ParamInt<px4::params::COM_POS_FS_GAIN>) _failsafe_pos_gain,
(ParamInt<px4::params::COM_LOW_BAT_ACT>) _low_bat_action,
(ParamFloat<px4::params::COM_DISARM_LAND>) _disarm_when_landed_timeout
(ParamFloat<px4::params::COM_DISARM_LAND>) _disarm_when_landed_timeout,
(ParamInt<px4::params::MC_AIRMODE>) _airmode,
(ParamInt<px4::params::RC_MAP_ARM_SW>) _rc_map_arm_switch
)
const int64_t POSVEL_PROBATION_MIN = 1_s; /**< minimum probation duration (usec) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment