mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 14:51:15 +08:00
fix(fw_attitude_control): correct turn coordination
This commit is contained in:
@@ -310,9 +310,6 @@ void FixedwingAttitudeControl::Run()
|
||||
const float yawrate_ff = CONSTANTS_ONE_G * q1 / V;
|
||||
const float pitchrate_ff = q1 * yawrate_ff / (1.f - 2.f * q_current(1) * q_current(1) - 2.f * q_current(2) * q_current(2));
|
||||
|
||||
body_rates_setpoint(1) += pitchrate_ff;
|
||||
body_rates_setpoint(2) += yawrate_ff;
|
||||
|
||||
// Limit turn coordination to normal flight envelope
|
||||
const float cos_tilt = 1.f - 2.f * (q_current(1) * q_current(1) + q_current(2) * q_current(2));
|
||||
const float tilt = acosf(math::constrain((cos_tilt), -1.f, 1.f));
|
||||
|
||||
Reference in New Issue
Block a user