mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 03:20:34 +08:00
guard against invalid yawmode values
This commit is contained in:
@@ -189,8 +189,9 @@ Mission::on_active()
|
||||
}
|
||||
|
||||
/* see if we need to update the current yaw heading for rotary wing types */
|
||||
if (_navigator->get_vstatus()->is_rotary_wing
|
||||
if (_navigator->get_vstatus()->is_rotary_wing
|
||||
&& _param_yawmode.get() != MISSION_YAWMODE_NONE
|
||||
&& _param_yawmode.get() < MISSION_YAWMODE_MAX
|
||||
&& _mission_type != MISSION_TYPE_NONE) {
|
||||
heading_sp_update();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ public:
|
||||
MISSION_YAWMODE_NONE = 0,
|
||||
MISSION_YAWMODE_FRONT_TO_WAYPOINT = 1,
|
||||
MISSION_YAWMODE_FRONT_TO_HOME = 2,
|
||||
MISSION_YAWMODE_BACK_TO_HOME = 3
|
||||
MISSION_YAWMODE_BACK_TO_HOME = 3,
|
||||
MISSION_YAWMODE_MAX = 4
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user