Struct rex_ucph::Arlo [−][src]
pub struct Arlo { pub speed: Option<u8>, pub turn_speed: Option<u8>, pub step_time: Option<usize>, pub turn_time: Option<usize>, // some fields omitted }
Fields
speed: Option<u8>
turn_speed: Option<u8>
step_time: Option<usize>
turn_time: Option<usize>
Methods
impl Arlo
[src]
impl Arlo
pub fn new() -> Result<Self, sError>
[src]
pub fn new() -> Result<Self, sError>
pub fn new_port(port: &str) -> Result<Self, sError>
[src]
pub fn new_port(port: &str) -> Result<Self, sError>
pub fn go_diff(
&mut self,
power_left: u8,
power_right: u8,
dir_left: u8,
dir_right: u8
) -> String
[src]
pub fn go_diff(
&mut self,
power_left: u8,
power_right: u8,
dir_left: u8,
dir_right: u8
) -> String
Start left motor with motor power powerLeft (in [0;127]) and direction dirLeft (0=reverse, 1=forward) and right motor with motor power powerRight (in [0;127]) and direction dirRight (0=reverse, 1=forward).
NOTE: Does NOT use wheel encoders.
pub fn stop(&mut self) -> String
[src]
pub fn stop(&mut self) -> String
Send a stop command to stop motors. Sets the motor power on both wheels to zero.
NOTE: Does NOT use wheel encoders.
pub fn go(&mut self) -> String
[src]
pub fn go(&mut self) -> String
Send a go command for continuous forward driving using the wheel encoders
pub fn backward(&mut self) -> String
[src]
pub fn backward(&mut self) -> String
Send a backward command for continuous reverse driving using the wheel encoders
pub fn left(&mut self) -> String
[src]
pub fn left(&mut self) -> String
Send a rotate left command for continuous rotating left using the wheel encoders
pub fn right(&mut self) -> String
[src]
pub fn right(&mut self) -> String
Send a rotate right command for continuous rotating right using the wheel encoders
pub fn step_forward(&mut self) -> String
[src]
pub fn step_forward(&mut self) -> String
Send a step forward command for driving forward using the wheel encoders for a predefined amount of time
pub fn step_backward(&mut self) -> String
[src]
pub fn step_backward(&mut self) -> String
Send a step backward command for driving backward using the wheel encoders for a predefined amount of time
pub fn step_rotate_left(&mut self) -> String
[src]
pub fn step_rotate_left(&mut self) -> String
Send a step rotate left command for rotating left using the wheel encoders for a predefined amount of time
pub fn step_rotate_right(&mut self) -> String
[src]
pub fn step_rotate_right(&mut self) -> String
Send a step rotate right command for rotating right using the wheel encoders for a predefined amount of time
pub fn read_front_ping_sensor(&mut self) -> Result<usize, ()>
[src]
pub fn read_front_ping_sensor(&mut self) -> Result<usize, ()>
Read the front sonar ping sensor and return the measured range in milimeters [mm]
pub fn read_back_ping_sensor(&mut self) -> Result<usize, ()>
[src]
pub fn read_back_ping_sensor(&mut self) -> Result<usize, ()>
Read the back sonar ping sensor and return the measured range in milimeters [mm]
pub fn read_left_ping_sensor(&mut self) -> Result<usize, ()>
[src]
pub fn read_left_ping_sensor(&mut self) -> Result<usize, ()>
Read the left sonar ping sensor and return the measured range in milimeters [mm]
pub fn read_right_ping_sensor(&mut self) -> Result<usize, ()>
[src]
pub fn read_right_ping_sensor(&mut self) -> Result<usize, ()>
Read the right sonar ping sensor and return the measured range in milimeters [mm]
pub fn set_speed(&mut self, speed: u8) -> String
[src]
pub fn set_speed(&mut self, speed: u8) -> String
Speed must be a value in the range [0; 255]. This speed is used in commands based on using the wheel encoders.
pub fn set_turnspeed(&mut self, turn_speed: u8) -> String
[src]
pub fn set_turnspeed(&mut self, turn_speed: u8) -> String
Turnspeed must be a value in the range [0; 255]. This speed is used in commands based on using the wheel encoders.
pub fn set_step_time(&mut self, step_time: usize) -> String
[src]
pub fn set_step_time(&mut self, step_time: usize) -> String
steptime is the amount of miliseconds used in the step_forward and step_backwards commands.
pub fn set_turn_time(&mut self, step_time: usize) -> String
[src]
pub fn set_turn_time(&mut self, step_time: usize) -> String
turntime is the amount of miliseconds used in the step_rotate_left and step_rotate_right commands.
pub fn read_left_wheel_encoder(&mut self) -> usize
[src]
pub fn read_left_wheel_encoder(&mut self) -> usize
Reads the left wheel encoder counts since last reset_encoder_counts command. The encoder has 144 counts for one complete wheel revolution.
pub fn read_right_wheel_encoder(&mut self) -> usize
[src]
pub fn read_right_wheel_encoder(&mut self) -> usize
Reads the right wheel encoder counts since last clear reset_encoder_counts command. The encoder has 144 counts for one complete wheel revolution.
pub fn reset_encoder_counts(&mut self) -> String
[src]
pub fn reset_encoder_counts(&mut self) -> String
Reset the wheel encoder counts.