Fix integral error calculations in PID controller, and change coefficients for airship and hot air balloon.

This commit is contained in:
Avi Weinstock
2021-07-06 16:52:12 -04:00
parent 0a57bf4367
commit 1a60ebd5db
3 changed files with 31 additions and 38 deletions

View File

@ -1173,14 +1173,7 @@ fn handle_spawn_airship(
fn pure_z(sp: Vec3<f32>, pv: Vec3<f32>) -> f32 { (sp - pv).z }
let agent = comp::Agent::default()
.with_destination(pos)
.with_position_pid_controller(comp::PidController::new(
kp,
ki,
kd,
Vec3::zero(),
0.0,
pure_z,
));
.with_position_pid_controller(comp::PidController::new(kp, ki, kd, pos, 0.0, pure_z));
builder = builder.with(agent);
}
builder.build();