OdomSensors
vectorlib::OdomSensors — fields, methods, parameters and return types.
pub struct OdomSensorsThe sensors used for odometry.
LemLib stores pointers so unused sensors can be nullptr; here they are Options.
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>,
) -> SelfCreate 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
Selfnew_custom
pub fn new_custom(
vertical1: Option<TrackingWheel>,
vertical2: Option<TrackingWheel>,
horizontal1: Option<TrackingWheel>,
horizontal2: Option<TrackingWheel>,
imu: Option<Box<dyn ImuDevice>>,
) -> SelfLike OdomSensors::new, but with any ImuDevice (for the simulator or custom
hardware).
Parameters
Prop
Type
Returns
Self