Odometry
Public functions and their Rust signatures.
set_sensors
pub fn set_sensors(sensors: OdomSensors, drivetrain: Drivetrain)Set the sensors to be used for odometry.
Parameters
Prop
Type
Returns
()get_pose
pub fn get_pose(radians: bool) -> PoseGet the pose of the robot.
radians—truefor theta in radians,falsefor degrees (LemLib defaultfalse)
Parameters
Prop
Type
Returns
Poseset_pose
pub fn set_pose(pose: Pose, radians: bool)Set the pose of the robot.
radians—trueif theta is in radians,falsefor degrees (LemLib defaultfalse)
Parameters
Prop
Type
Returns
()get_speed
pub fn get_speed(radians: bool) -> PoseGet the speed of the robot.
radians—truefor theta in radians,falsefor degrees (LemLib defaultfalse)
Parameters
Prop
Type
Returns
Poseget_local_speed
pub fn get_local_speed(radians: bool) -> PoseGet the local speed of the robot.
radians—truefor theta in radians,falsefor degrees (LemLib defaultfalse)
Parameters
Prop
Type
Returns
Poseestimate_pose
pub fn estimate_pose(time: f32, radians: bool) -> PoseEstimate the pose of the robot after a certain amount of time.
time— time in secondsradians—falsefor degrees,truefor radians (LemLib defaultfalse)
Parameters
Prop
Type
Returns
Poseupdate
pub fn update()Update the pose of the robot. Runs every 10 ms in the tracking task started by init.
Panics
If called before Chassis::calibrate(crate::Chassis::calibrate) has installed the
vertical tracking wheels. LemLib dereferences a null pointer in the same situation.
Returns
()init
pub fn init()Initialize odometry: start the tracking task (once).
Returns
()