diff --git a/Cargo.lock b/Cargo.lock index 9db6f06..f40d17d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,7 +22,7 @@ dependencies = [ [[package]] name = "rnavp" -version = "0.2.1" +version = "0.2.2" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index aab01b3..de19f76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rnavp" -version = "0.2.1" +version = "0.2.2" edition = "2024" publish = ["gitea"] diff --git a/src/core/logic/motor.rs b/src/core/logic/motor.rs index 81a98a1..52124a1 100644 --- a/src/core/logic/motor.rs +++ b/src/core/logic/motor.rs @@ -40,11 +40,11 @@ impl Controller { .set_speed_and_direction(motor_command, self.current_direction); } - pub fn new(motor: T, max_speed: Speed, pid: pid::PID) -> Self { + pub fn new(motor: T, max_speed: Speed, config: pid::Config) -> Self { Controller { motor: motor, max_speed: max_speed, - pid: pid, + pid: pid::PID::new(config), current_direction: Direction::CCW, } }