LemLib  0.4.7
An easy to use and feature-rich PROS template
Loading...
Searching...
No Matches
lemlib::Pose Class Reference

Public Member Functions

 Pose (float x, float y, float theta=0)
 Create a new pose. More...
 
Pose operator+ (const Pose &other)
 Add a pose to this pose. More...
 
Pose operator- (const Pose &other)
 Subtract a pose from this pose. More...
 
float operator* (const Pose &other)
 Multiply a pose by this pose. More...
 
Pose operator* (const float &other)
 Multiply a pose by a float. More...
 
Pose operator/ (const float &other)
 Divide a pose by a float. More...
 
Pose lerp (Pose other, float t)
 Linearly interpolate between two poses. More...
 
float distance (Pose other)
 Get the distance between two poses. More...
 
float angle (Pose other)
 Get the angle between two poses. More...
 
Pose rotate (float angle)
 Rotate a pose by an angle. More...
 

Public Attributes

float x
 x value
 
float y
 y value
 
float theta
 theta value
 

Constructor & Destructor Documentation

◆ Pose()

lemlib::Pose::Pose ( float  x,
float  y,
float  theta = 0 
)

Create a new pose.

Parameters
xcomponent
ycomponent
thetaheading. Defaults to 0

Member Function Documentation

◆ angle()

float lemlib::Pose::angle ( Pose  other)

Get the angle between two poses.

Parameters
otherthe other pose
Returns
float in radians

◆ distance()

float lemlib::Pose::distance ( Pose  other)

Get the distance between two poses.

Parameters
otherthe other pose
Returns
float

◆ lerp()

Pose lemlib::Pose::lerp ( Pose  other,
float  t 
)

Linearly interpolate between two poses.

Parameters
otherthe other pose
tt value
Returns
Pose

◆ operator*() [1/2]

Pose lemlib::Pose::operator* ( const float &  other)

Multiply a pose by a float.

Parameters
otherfloat
Returns
Pose

◆ operator*() [2/2]

float lemlib::Pose::operator* ( const Pose other)

Multiply a pose by this pose.

Parameters
otherother pose
Returns
Pose

◆ operator+()

Pose lemlib::Pose::operator+ ( const Pose other)

Add a pose to this pose.

Parameters
otherother pose
Returns
Pose

◆ operator-()

Pose lemlib::Pose::operator- ( const Pose other)

Subtract a pose from this pose.

Parameters
otherother pose
Returns
Pose

◆ operator/()

Pose lemlib::Pose::operator/ ( const float &  other)

Divide a pose by a float.

Parameters
otherfloat
Returns
Pose

◆ rotate()

Pose lemlib::Pose::rotate ( float  angle)

Rotate a pose by an angle.

Parameters
angleangle in radians
Returns
Pose

The documentation for this class was generated from the following file: