MRPT  1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
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 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 operator*= (const double k)
 Scale factor. 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...
 

Static Public Member Functions

static TTwist2D FromString (const std::string &s)
 

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 144 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 97 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 148 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.

Referenced by FromString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromString()

static TTwist2D mrpt::math::TTwist2D::FromString ( const std::string &  s)
inlinestatic

Definition at line 111 of file TTwist2D.h.

References fromString().

Here is the call graph for this function:

◆ operator!=()

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

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

References omega, vx, and vy.

◆ operator*=()

void mrpt::math::TTwist2D::operator*= ( const double  k)
inline

Scale factor.

Definition at line 85 of file TTwist2D.h.

References omega, vx, and vy.

◆ operator==()

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

Definition at line 168 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 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 161 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

double mrpt::math::TTwist2D::omega {.0}

◆ vx

double mrpt::math::TTwist2D::vx {.0}

◆ vy

double mrpt::math::TTwist2D::vy {.0}



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7e629e01a Sat Dec 14 00:05:55 2019 +0100 at sáb dic 14 00:15:10 CET 2019