RIT VEXU Core API
Loading...
Searching...
No Matches
Twist2d Class Reference

#include <twist2d.h>

Public Member Functions

constexpr Twist2d ()
 
 Twist2d (const double &dx, const double &dy, const double &dtheta)
 
 Twist2d (const Eigen::Vector3d &twist_vector)
 
double dx () const
 
double dy () const
 
double dtheta () const
 
bool operator== (const Twist2d &other) const
 
Twist2d operator* (const double &scalar) const
 
Twist2d operator/ (const double &scalar) const
 

Friends

std::ostream & operator<< (std::ostream &os, const Twist2d &twist)
 

Detailed Description

Class representing a difference between two poses, more specifically a distance along an arc from a pose.

Assumes conventional cartesian coordinate system: Looking down at the coordinate plane, +X is right +Y is up +Theta is counterclockwise

Constructor & Destructor Documentation

◆ Twist2d() [1/3]

Twist2d::Twist2d ( )
constexpr

Default Constructor for Twist2d

◆ Twist2d() [2/3]

Twist2d::Twist2d ( const double & dx,
const double & dy,
const double & dtheta )

Constructs a twist with given translation and angle deltas.

Parameters
dxthe linear dx component.
dythe linear dy component.
dthetathe angular dtheta component.

◆ Twist2d() [3/3]

Twist2d::Twist2d ( const Eigen::Vector3d & twist_vector)

Constructs a twist with given translation and angle deltas.

Parameters
twist_vectorvector of the form [dx, dy, dtheta]

Member Function Documentation

◆ dtheta()

double Twist2d::dtheta ( ) const

Returns the angular dtheta component.

Returns
the angular dtheta component.

◆ dx()

double Twist2d::dx ( ) const

Returns the linear dx component.

Returns
the linear dx component.

◆ dy()

double Twist2d::dy ( ) const

Returns the linear dy component.

Returns
the linear dy component.

◆ operator*()

Twist2d Twist2d::operator* ( const double & scalar) const

Multiplies this twist by a scalar.

Parameters
scalarthe scalar value to multiply by.

◆ operator/()

Twist2d Twist2d::operator/ ( const double & scalar) const

Divides this twist by a scalar.

Parameters
scalarthe scalar value to divide by.

◆ operator==()

bool Twist2d::operator== ( const Twist2d & other) const

Compares this to another twist.

Parameters
otherthe other twist to compare to.
Returns
true if each of the components are within 1e-9 of each other.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Twist2d & twist )
friend

Sends a twist to an output stream. Ex. std::cout << twist;

prints "Twist2d[dx: (value), dy: (value), drad: (radians)]"

Sends a twist to an output stream. Ex. std::cout << twist;

prints "Twist2d[x: (value), y: (value), rad: (radians), deg: (degrees)]"


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