Trait rrtk::FeedbackMotor
source · pub trait FeedbackMotor {
// Required methods
fn get_state(&mut self) -> Datum<State>;
fn set_acceleration(&mut self, acceleration: f32);
fn set_velocity(&mut self, velocity: f32);
fn set_position(&mut self, position: f32);
// Provided method
fn follow_motion_profile(&mut self, motion_profile: MotionProfile) { ... }
}Expand description
A trait for motors with some form of feedback, regardless if we can see it or not.
Required Methods§
sourcefn get_state(&mut self) -> Datum<State>
fn get_state(&mut self) -> Datum<State>
Get the motor’s current acceleration, velocity, and position and the time at which they were recorded.
sourcefn set_acceleration(&mut self, acceleration: f32)
fn set_acceleration(&mut self, acceleration: f32)
Make the motor run at a given acceleration.
sourcefn set_velocity(&mut self, velocity: f32)
fn set_velocity(&mut self, velocity: f32)
Make the motor run at a given velocity.
sourcefn set_position(&mut self, position: f32)
fn set_position(&mut self, position: f32)
Make the mootr go to a given position.