guard against invalid yawmode values

This commit is contained in:
Thomas Gubler 2015-12-28 11:14:03 +01:00
parent ea1439c627
commit 2af066bc6a
2 changed files with 4 additions and 2 deletions

View File

@ -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();
}

View File

@ -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: