mc_att_control: don't use main state for RATTITUDE

Instead of the state use the boolean flags.
This commit is contained in:
Julian Oes
2016-04-11 18:01:48 +02:00
parent 5c9713f05b
commit 1ad0ee0fae
3 changed files with 15 additions and 1 deletions
@@ -877,7 +877,7 @@ MulticopterAttitudeControl::task_main()
/* Check if we are in rattitude mode and the pilot is above the threshold on pitch
* or roll (yaw can rotate 360 in normal att control). If both are true don't
* even bother running the attitude controllers */
if (_vehicle_status.main_state == vehicle_status_s::MAIN_STATE_RATTITUDE) {
if (_v_control_mode.flag_control_rattitude_enabled) {
if (fabsf(_manual_control_sp.y) > _params.rattitude_thres ||
fabsf(_manual_control_sp.x) > _params.rattitude_thres) {
_v_control_mode.flag_control_attitude_enabled = false;