Skip to Content
VectorLib

Pose

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


pub struct Pose

A position and heading.

Units are inches. theta is degrees or radians depending on where the pose came from; the arithmetic operators only touch x and y and keep the left-hand side's theta, exactly as LemLib does.

View source

Fields

Prop

Type

Methods

Prop

Type

new

pub const fn new(x: f32, y: f32, theta: f32) -> Self

Create a new pose. LemLib's Pose(x, y) is Pose::new(x, y, 0.0).

Parameters

Prop

Type

Returns

Self

View source

lerp

pub fn lerp(self, other: Pose, t: f32) -> Pose

Linearly interpolate between two poses. Keeps this pose's theta.

Parameters

Prop

Type

Returns

Pose

View source

distance

pub fn distance(self, other: Pose) -> f32

Distance between two poses.

Parameters

Prop

Type

Returns

f32

View source

angle

pub fn angle(self, other: Pose) -> f32

Angle between two poses, in radians, standard position.

Parameters

Prop

Type

Returns

f32

View source

rotate

pub fn rotate(self, angle: f32) -> Pose

Rotate the pose's position by an angle (radians, counter-clockwise). Keeps theta.

Parameters

Prop

Type

Returns

Pose

View source