mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Clarify rates control code
This commit is contained in:
parent
7a62229125
commit
476f24f774
@ -137,10 +137,12 @@ void controlRate() {
|
||||
}
|
||||
|
||||
Vector ratesFiltered = ratesFilter.update(rates);
|
||||
Vector error = ratesTarget - ratesFiltered;
|
||||
|
||||
torqueTarget.x = rollRatePID.update(ratesTarget.x - ratesFiltered.x, dt); // un-normalized "torque"
|
||||
torqueTarget.y = pitchRatePID.update(ratesTarget.y - ratesFiltered.y, dt);
|
||||
torqueTarget.z = yawRatePID.update(ratesTarget.z - ratesFiltered.z, dt);
|
||||
// Calculate desired torque, where 0 - no torque, 1 - maximum possible torque
|
||||
torqueTarget.x = rollRatePID.update(error.x, dt);
|
||||
torqueTarget.y = pitchRatePID.update(error.y, dt);
|
||||
torqueTarget.z = yawRatePID.update(error.z, dt);
|
||||
}
|
||||
|
||||
void controlTorque() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user