Fixed a new() issue
where it took in a PID rather than a pid::PID rather than a pid::PID Version Bump to 0.2.2
This commit is contained in:
Generated
+1
-1
@@ -22,7 +22,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rnavp"
|
name = "rnavp"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rnavp"
|
name = "rnavp"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
publish = ["gitea"]
|
publish = ["gitea"]
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ impl<T: motor::Driver + motor::Sensor> Controller<T> {
|
|||||||
.set_speed_and_direction(motor_command, self.current_direction);
|
.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 {
|
Controller {
|
||||||
motor: motor,
|
motor: motor,
|
||||||
max_speed: max_speed,
|
max_speed: max_speed,
|
||||||
pid: pid,
|
pid: pid::PID::new(config),
|
||||||
current_direction: Direction::CCW,
|
current_direction: Direction::CCW,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user