diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index dbca9614db..3524ac49bd 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -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; } diff --git a/src/modules/commander/Commander.hpp b/src/modules/commander/Commander.hpp index 1cb4d171af..ad56a8dca7 100644 --- a/src/modules/commander/Commander.hpp +++ b/src/modules/commander/Commander.hpp @@ -110,7 +110,10 @@ private: (ParamInt) _failsafe_pos_gain, (ParamInt) _low_bat_action, - (ParamFloat) _disarm_when_landed_timeout + (ParamFloat) _disarm_when_landed_timeout, + + (ParamInt) _airmode, + (ParamInt) _rc_map_arm_switch ) const int64_t POSVEL_PROBATION_MIN = 1_s; /**< minimum probation duration (usec) */