Skip to Content
VectorLib

OdomSensors

vectorlib::OdomSensors — fields, methods, parameters and return types.


pub struct OdomSensors

The sensors used for odometry.

LemLib stores pointers so unused sensors can be nullptr; here they are Options.

View source

Fields

Prop

Type

Methods

Prop

Type

new

pub fn new(
        vertical1: Option<TrackingWheel>,
        vertical2: Option<TrackingWheel>,
        horizontal1: Option<TrackingWheel>,
        horizontal2: Option<TrackingWheel>,
        imu: Option<InertialSensor>,
    ) -> Self

Create the sensor set. Pass None for a sensor you don't have (LemLib's nullptr).




let sensors = OdomSensors::new(
    Some(vertical),   // vertical tracking wheel
    None,             // vertical tracking wheel 2, None as we don't have a second one
    Some(horizontal), // horizontal tracking wheel
    None,             // horizontal tracking wheel 2, None as we don't have a second one
    Some(InertialSensor::new(peripherals.port_10)), // inertial sensor
);

Parameters

Prop

Type

Returns

Self

View source

new_custom

pub fn new_custom(
        vertical1: Option<TrackingWheel>,
        vertical2: Option<TrackingWheel>,
        horizontal1: Option<TrackingWheel>,
        horizontal2: Option<TrackingWheel>,
        imu: Option<Box<dyn ImuDevice>>,
    ) -> Self

Like OdomSensors::new, but with any ImuDevice (for the simulator or custom hardware).

Parameters

Returns

Self

View source