From 81c677683a2fbb5c737532bff5c6da999d9e41ee Mon Sep 17 00:00:00 2001 From: WT-MM Date: Tue, 8 Oct 2024 22:37:27 -0700 Subject: [PATCH] change command --- actuator/rust/robstride/src/bin/stand.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/actuator/rust/robstride/src/bin/stand.rs b/actuator/rust/robstride/src/bin/stand.rs index 36a11ea..4da1448 100644 --- a/actuator/rust/robstride/src/bin/stand.rs +++ b/actuator/rust/robstride/src/bin/stand.rs @@ -32,7 +32,7 @@ fn main() -> Result<(), Box> { // Create Motors instances with the port names let mut motors_1 = Motors::new("/dev/ttyCH341USB0", motors_map_1)?; - let mut motors_2 = Motors::new("/dev/ttyCH341USB1", motors_map_2)?; + // let mut motors_2 = Motors::new("/dev/ttyCH341USB1", motors_map_2)?; // Function to initialize motors let initialize_motors = |motors: &mut Motors| -> Result<(), Box> { @@ -53,7 +53,7 @@ fn main() -> Result<(), Box> { let set_location = |motors: &mut Motors, location: f32| -> Result<(), Box> { for id in 1..=5 { - motors.send_set_location(id, location)?; + motors.send_position_control(id, location, 5.0)?; std::thread::sleep(Duration::from_millis(50)); } motors.read_all_pending_responses()?; @@ -62,7 +62,7 @@ fn main() -> Result<(), Box> { // Initialize both groups of motors initialize_motors(&mut motors_1)?; - initialize_motors(&mut motors_2)?; + // initialize_motors(&mut motors_2)?; println!("Motors initialized and set to stand position."); @@ -70,13 +70,13 @@ fn main() -> Result<(), Box> { while running.load(Ordering::SeqCst) { std::thread::sleep(Duration::from_millis(50)); set_location(&mut motors_1, 0.0)?; - set_location(&mut motors_2, 0.0)?; + // set_location(&mut motors_2, 0.0)?; } // Reset motors on exit for id in 1..=5 { motors_1.send_reset(id)?; - motors_2.send_reset(id)?; + // motors_2.send_reset(id)?; std::thread::sleep(Duration::from_millis(50)); }