Trait rrtk::SimpleEncoder

source ·
pub trait SimpleEncoder: Encoder {
    // Required methods
    fn get_simple_encoder_data_ref(&self) -> &SimpleEncoderData;
    fn get_simple_encoder_data_mut(&mut self) -> &mut SimpleEncoderData;
    fn device_update(&mut self) -> Datum<f32>;

    // Provided method
    fn update(&mut self) { ... }
}
Expand description

An encoder trait that does the calculus for you. You just need to supply a position, velocity, or acceleration, and the others will be calculated.

Required Methods§

source

fn get_simple_encoder_data_ref(&self) -> &SimpleEncoderData

Get an immutable reference to the object’s SimpleEncoderData object.

source

fn get_simple_encoder_data_mut(&mut self) -> &mut SimpleEncoderData

Get a mutable reference to the object’s SimpleEncoderData object.

source

fn device_update(&mut self) -> Datum<f32>

Get a new position, velocity, or acceleration from the encoder along with a time.

Provided Methods§

source

fn update(&mut self)

Get a new position, velocity, or acceleration from the encoder, calculate the others, and write it all the the object’s SimpleEncoderData.

Implementors§