Skip to Content
VectorLib

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

()

View source

get_pose

pub fn get_pose(radians: bool) -> Pose

Get the pose of the robot.

  • radians — true for theta in radians, false for degrees (LemLib default false)

Parameters

Prop

Type

Returns

Pose

View source

set_pose

pub fn set_pose(pose: Pose, radians: bool)

Set the pose of the robot.

  • radians — true if theta is in radians, false for degrees (LemLib default false)

Parameters

Prop

Type

Returns

()

View source

get_speed

pub fn get_speed(radians: bool) -> Pose

Get the speed of the robot.

  • radians — true for theta in radians, false for degrees (LemLib default false)

Parameters

Prop

Type

Returns

Pose

View source

get_local_speed

pub fn get_local_speed(radians: bool) -> Pose

Get the local speed of the robot.

  • radians — true for theta in radians, false for degrees (LemLib default false)

Parameters

Prop

Type

Returns

Pose

View source

estimate_pose

pub fn estimate_pose(time: f32, radians: bool) -> Pose

Estimate the pose of the robot after a certain amount of time.

  • time — time in seconds
  • radians — false for degrees, true for radians (LemLib default false)

Parameters

Prop

Type

Returns

Pose

View source

update

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

()

View source

init

pub fn init()

Initialize odometry: start the tracking task (once).

Returns

()

View source