mirror of
https://github.com/okalachev/flix.git
synced 2026-01-11 13:36:43 +00:00
More clean yaw error calculation
This commit is contained in:
@@ -123,7 +123,8 @@ void controlAttitude() {
|
|||||||
ratesTarget.y = pitchPID.update(error.y, dt);
|
ratesTarget.y = pitchPID.update(error.y, dt);
|
||||||
|
|
||||||
if (yawMode == YAW) {
|
if (yawMode == YAW) {
|
||||||
ratesTarget.z = yawPID.update(wrapAngle(attitudeTarget.getYaw() - attitude.getYaw()), dt);
|
float yawError = wrapAngle(attitudeTarget.getYaw() - attitude.getYaw());
|
||||||
|
ratesTarget.z = yawPID.update(yawError, dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user