TR-mbed 1.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Pose2D Class Reference

#include <Pose2D.h>

Public Member Functions

 Pose2D (double x, double y, double angleRadians)
 
Pose2D minus (Pose2D other)
 
Pose2D interpolate (Pose2D other, double fractionThis)
 

Public Attributes

double x
 
double y
 
double angleRadians
 

Detailed Description

The Pose2D class represents a 2D position and orientation, including x and y coordinates and a heading. It is used to represent the Chassis's position and heading.

Constructor & Destructor Documentation

◆ Pose2D()

Pose2D::Pose2D ( double  x,
double  y,
double  angleRadians 
)

Creates a new Pose2D object from the specified position and orientation

Parameters
xThe x-coordinate of the position in meters
yThe y-coordinate of the position in meters
angleRadiansThe CCW-positive angle in radians

Member Function Documentation

◆ interpolate()

Pose2D Pose2D::interpolate ( Pose2D  other,
double  fractionThis 
)

Finds a new Pose2D that is a specific fraction of the way between this Pose2D and another. For example, if this Pose2D is x = 1, y = 4, rotation = PI/2, and the other Pose2D is x = 3, y = 3, rotation = PI/6, then interpolating with fractionThis = 1/4 would be x = 2.5, y = 3.25, rotation = PI/4.

Parameters
otherThe Pose2D to interpolate from
fractionThisWhat fraction (0 to 1) of the way from the other Pose2D to this Pose2D; 1 would just return this Pose2D, and 0 would return the other Pose2D
Returns
The Pose2D that is the specified fraction between this and the other Pose2D

◆ minus()

Pose2D Pose2D::minus ( Pose2D  other)

Subtracts another position and orientation from this position and orientation

Parameters
otherThe Pose2D to subtract
Returns
A new Pose2D representing the difference between this Pose2D and the other Pose2d

Member Data Documentation

◆ angleRadians

double Pose2D::angleRadians

◆ x

double Pose2D::x

◆ y

double Pose2D::y

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