mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 11:51:35 +08:00
mc_att_control: don't use main state for RATTITUDE
Instead of the state use the boolean flags.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user