MRPT  1.9.9
mrpt::math::TTwist2D Struct Reference

Detailed Description

2D twist: 2D velocity vector (vx,vy) + planar angular velocity (omega)

See also
mrpt::math::TTwist3D, mrpt::math::TPose2D

Definition at line 2145 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Types

enum  { static_size = 3 }
 

Public Member Functions

constexpr TTwist2D (double vx_, double vy_, double omega_)
 Constructor from components. More...
 
 TTwist2D ()
 Default fast constructor. More...
 
double & operator[] (size_t i)
 Coordinate access using operator[]. More...
 
constexpr const double & operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
void getAsVector (std::vector< double > &v) const
 Transformation into vector. More...
 
void rotate (const double ang)
 Transform the (vx,vy) components for a counterclockwise rotation of ang radians. More...
 
bool operator== (const TTwist2D &o) const
 
bool operator!= (const TTwist2D &o) const
 
mrpt::math::TPose2D operator* (const double dt) const
 Returns the pose increment of multiplying each twist component times "dt" seconds. More...
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[vx vy omega]", omega in deg/s) More...
 
std::string asString () const
 
void fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -45.0]" ) More...
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double vx
 Velocity components: X,Y (m/s) More...
 
double vy
 
double omega
 Angular velocity (rad/s) More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 2147 of file lightweight_geom_data.h.

Constructor & Destructor Documentation

◆ TTwist2D() [1/2]

constexpr mrpt::math::TTwist2D::TTwist2D ( double  vx_,
double  vy_,
double  omega_ 
)
inline

Constructor from components.

Definition at line 2157 of file lightweight_geom_data.h.

◆ TTwist2D() [2/2]

mrpt::math::TTwist2D::TTwist2D ( )
inline

Default fast constructor.

Initializes to garbage

Definition at line 2162 of file lightweight_geom_data.h.

Member Function Documentation

◆ asString() [1/2]

void mrpt::math::TTwist2D::asString ( std::string s) const

Returns a human-readable textual representation of the object (eg: "[vx vy omega]", omega in deg/s)

See also
fromString

Definition at line 98 of file lightweight_geom_data.cpp.

References mrpt::format(), omega, mrpt::RAD2DEG(), vx, and vy.

◆ asString() [2/2]

std::string mrpt::math::TTwist2D::asString ( ) const
inline

Definition at line 2214 of file lightweight_geom_data.h.

◆ fromString()

void mrpt::math::TTwist2D::fromString ( const std::string s)

Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -45.0]" )

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 102 of file lightweight_geom_data.cpp.

References ASSERTMSG_, mrpt::DEG2RAD(), omega, THROW_EXCEPTION, vx, and vy.

◆ getAsVector()

void mrpt::math::TTwist2D::getAsVector ( std::vector< double > &  v) const
inline

Transformation into vector.

Definition at line 2194 of file lightweight_geom_data.h.

References omega, vx, and vy.

◆ operator!=()

bool mrpt::math::TTwist2D::operator!= ( const TTwist2D o) const

Definition at line 126 of file lightweight_geom_data.cpp.

◆ operator*()

mrpt::math::TPose2D mrpt::math::TTwist2D::operator* ( const double  dt) const

Returns the pose increment of multiplying each twist component times "dt" seconds.

Definition at line 127 of file lightweight_geom_data.cpp.

References omega, vx, and vy.

◆ operator==()

bool mrpt::math::TTwist2D::operator== ( const TTwist2D o) const

Definition at line 122 of file lightweight_geom_data.cpp.

References omega, vx, and vy.

◆ operator[]() [1/2]

double& mrpt::math::TTwist2D::operator[] ( size_t  i)
inline

Coordinate access using operator[].

Order: vx,vy,vphi

Definition at line 2164 of file lightweight_geom_data.h.

References omega, vx, and vy.

◆ operator[]() [2/2]

constexpr const double& mrpt::math::TTwist2D::operator[] ( size_t  i) const
inline

Coordinate access using operator[].

Order: vx,vy,vphi

Definition at line 2179 of file lightweight_geom_data.h.

References omega, vx, and vy.

◆ rotate()

◆ size()

static size_t mrpt::math::TTwist2D::size ( )
inlinestatic

Definition at line 2227 of file lightweight_geom_data.h.

Referenced by mrpt::math::operator<<(), and mrpt::math::operator>>().

Member Data Documentation

◆ omega

◆ vx

◆ vy




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020