mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 03:03:33 +08:00
Fixed heading calculation, fixed heading controller
This commit is contained in:
@@ -179,7 +179,7 @@ __EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, flo
|
||||
pid->error_previous = error;
|
||||
}
|
||||
|
||||
float output = (error * pid->kp) + (i * pid->ki) + (d * pid->kd);
|
||||
float output = (pid->error_previous * pid->kp) + (i * pid->ki) + (d * pid->kd);
|
||||
|
||||
if (isfinite(output)) {
|
||||
pid->last_output = output;
|
||||
|
||||
Reference in New Issue
Block a user