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 19 of file TTwist2D.h.

#include <mrpt/math/TTwist2D.h>

Inheritance diagram for mrpt::math::TTwist2D:

Public Types

enum  { static_size = 3 }
 

Public Member Functions

constexpr TTwist2D (double vx_, double vy_, double omega_)
 Constructor from components. More...
 
 TTwist2D ()=default
 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 asVector (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...
 
constexpr std::size_t rows () const
 
constexpr std::size_t cols () const
 
constexpr std::size_t size () const
 
void resize (std::size_t n)
 throws if attempted to resize to incorrect length More...
 

Public Attributes

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 21 of file TTwist2D.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 31 of file TTwist2D.h.

◆ TTwist2D() [2/2]

mrpt::math::TTwist2D::TTwist2D ( )
default

Default fast constructor.

Initializes to zeros

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 156 of file TPoseOrPoint.cpp.

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

Here is the call graph for this function:

◆ asString() [2/2]

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

Definition at line 88 of file TTwist2D.h.

◆ asVector()

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

Transformation into vector.

Definition at line 68 of file TTwist2D.h.

References omega, vx, and vy.

◆ cols()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TTwist2D >::cols ( ) const
inlineinherited

Definition at line 57 of file TPoseOrPoint.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 160 of file TPoseOrPoint.cpp.

References ASSERTMSG_, mrpt::math::CMatrixDynamic< T >::cols(), mrpt::DEG2RAD(), mrpt::math::MatrixVectorBase< Scalar, Derived >::fromMatlabStringFormat(), omega, mrpt::math::CMatrixDynamic< T >::rows(), THROW_EXCEPTION, vx, and vy.

Here is the call graph for this function:

◆ operator!=()

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

Definition at line 184 of file TPoseOrPoint.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 185 of file TPoseOrPoint.cpp.

References omega, vx, and vy.

◆ operator==()

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

Definition at line 180 of file TPoseOrPoint.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 38 of file TTwist2D.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 53 of file TTwist2D.h.

References omega, vx, and vy.

◆ resize()

void mrpt::math::internal::ProvideStaticResize< TTwist2D >::resize ( std::size_t  n)
inlineinherited

throws if attempted to resize to incorrect length

Definition at line 61 of file TPoseOrPoint.h.

◆ rotate()

void mrpt::math::TTwist2D::rotate ( const double  ang)

Transform the (vx,vy) components for a counterclockwise rotation of ang radians.

Definition at line 173 of file TPoseOrPoint.cpp.

References vx, and vy.

Referenced by mrpt::poses::CRobot2DPoseEstimator::getCurrentEstimate(), mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentGTVelLocal(), mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentOdometricVelLocal(), mrpt::kinematics::CVehicleSimulVirtualBase::simulateOneTimeStep(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().

Here is the caller graph for this function:

◆ rows()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TTwist2D >::rows ( ) const
inlineinherited

Definition at line 56 of file TPoseOrPoint.h.

◆ size()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TTwist2D >::size ( ) const
inlineinherited

Definition at line 58 of file TPoseOrPoint.h.

Member Data Documentation

◆ omega

◆ vx

◆ vy




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019