Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Oct 13, 2024
1 parent 7b7559f commit ab49a07
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions actuator/rust/robstride/src/bin/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
continue;
}
let position: f32 = parts[1].parse()?;
controller.set_position(test_id, position);
let _ = controller.set_position(test_id, position);
println!("Set target position to {}", position);
}
"v" => {
Expand All @@ -95,23 +95,25 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
continue;
}
let velocity: f32 = parts[1].parse()?;
controller.set_velocity(test_id, velocity);
let _ = controller.set_velocity(test_id, velocity);
println!("Set target velocity to {}", velocity);
}
"t" => {
if parts.len() != 2 {
println!("Usage: t <torque>");
continue;
}
let torque: f32 = parts[1].parse()?;
controller.set_torque(test_id, torque);
let _ = controller.set_torque(test_id, torque);
println!("Set target torque to {}", torque);
}
"kp" => {
if parts.len() != 2 {
println!("Usage: kp <kp>");
continue;
}
let kp: f32 = parts[1].parse()?;
controller.set_kp(test_id, kp);
let _ = controller.set_kp(test_id, kp);
println!("Set KP for motor {} to {}", test_id, kp);
}
"kd" => {
Expand All @@ -120,11 +122,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
continue;
}
let kd: f32 = parts[1].parse()?;
controller.set_kd(test_id, kd);
let _ = controller.set_kd(test_id, kd);
println!("Set KD for motor {} to {}", test_id, kd);
}
"zero" | "z" => {
controller.add_motor_to_zero(test_id);
let _ = controller.add_motor_to_zero(test_id);
println!("Added motor {} to zero list", test_id);
}
"get_feedback" | "g" => {
Expand Down

0 comments on commit ab49a07

Please sign in to comment.