MRPT  2.0.4
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
mrpt::math::TTwist3D Struct Reference

Detailed Description

3D twist: 3D velocity vector (vx,vy,vz) + angular velocity (wx,wy,wz)

See also
mrpt::math::TTwist2D, mrpt::math::TPose3D

Definition at line 18 of file TTwist3D.h.

#include <mrpt/math/TTwist3D.h>

Inheritance diagram for mrpt::math::TTwist3D:

Public Types

enum  { static_size = 6 }
 

Public Member Functions

constexpr TTwist3D (double vx_, double vy_, double vz_, double wx_, double wy_, double wz_)
 Constructor from components. More...
 
 TTwist3D ()=default
 Default fast constructor. More...
 
double & operator[] (size_t i)
 Coordinate access using operator[]. More...
 
constexpr double operator[] (size_t i) const
 
double & operator() (int row, int col)
 (i,0) access operator (provided for API compatibility with matrices). More...
 
constexpr double operator() (int row, int col) const
 
void operator*= (const double k)
 Scale factor. More...
 
template<typename VECTORLIKE >
void asVector (VECTORLIKE &v) const
 Transformation into vector [vx vy vz wx wy wz]. More...
 
template<typename VECTORLIKE >
VECTORLIKE asVector () const
 
template<typename VECTORLIKE >
void fromVector (const VECTORLIKE &v)
 Sets from a vector [vx vy vz wx wy wz]. More...
 
bool operator== (const TTwist3D &o) const
 
bool operator!= (const TTwist3D &o) const
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[vx vy vz wx wy wz]", omegas in deg/s) More...
 
std::string asString () const
 
void rotate (const mrpt::math::TPose3D &rot)
 Transform all 6 components for a change of reference frame from "A" to another frame "B" whose rotation with respect to "A" is given by rot. More...
 
void fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[vx vy vz wx wy wz]" ) 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 TTwist3D FromString (const std::string &s)
 

Public Attributes

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 20 of file TTwist3D.h.

Constructor & Destructor Documentation

◆ TTwist3D() [1/2]

constexpr mrpt::math::TTwist3D::TTwist3D ( double  vx_,
double  vy_,
double  vz_,
double  wx_,
double  wy_,
double  wz_ 
)
inline

Constructor from components.

Definition at line 31 of file TTwist3D.h.

◆ TTwist3D() [2/2]

mrpt::math::TTwist3D::TTwist3D ( )
default

Default fast constructor.

Initializes to zeros

Member Function Documentation

◆ asString() [1/2]

void TTwist3D::asString ( std::string &  s) const

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

See also
fromString

Definition at line 24 of file Twist3D.cpp.

References mrpt::format(), mrpt::RAD2DEG(), vx, vy, vz, wx, wy, and wz.

Here is the call graph for this function:

◆ asString() [2/2]

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

Definition at line 135 of file TTwist3D.h.

◆ asVector() [1/2]

template<typename VECTORLIKE >
void mrpt::math::TTwist3D::asVector ( VECTORLIKE &  v) const
inline

Transformation into vector [vx vy vz wx wy wz].

Definition at line 108 of file TTwist3D.h.

◆ asVector() [2/2]

template<typename VECTORLIKE >
VECTORLIKE mrpt::math::TTwist3D::asVector ( ) const
inline

Definition at line 114 of file TTwist3D.h.

◆ cols()

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

Definition at line 66 of file TPoseOrPoint.h.

◆ fromString()

void TTwist3D::fromString ( const std::string &  s)

Set the current object value from a string generated by 'asString' (eg: "[vx vy vz wx wy wz]" )

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 30 of file Twist3D.cpp.

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

Referenced by FromString().

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

◆ FromString()

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

Definition at line 154 of file TTwist3D.h.

References fromString().

Here is the call graph for this function:

◆ fromVector()

template<typename VECTORLIKE >
void mrpt::math::TTwist3D::fromVector ( const VECTORLIKE &  v)
inline

Sets from a vector [vx vy vz wx wy wz].

Definition at line 123 of file TTwist3D.h.

References ASSERT_EQUAL_.

◆ operator!=()

bool TTwist3D::operator!= ( const TTwist3D o) const

Definition at line 61 of file Twist3D.cpp.

◆ operator()() [1/2]

double& mrpt::math::TTwist3D::operator() ( int  row,
int  col 
)
inline

(i,0) access operator (provided for API compatibility with matrices).

See also
operator[]

Definition at line 83 of file TTwist3D.h.

References ASSERT_EQUAL_.

◆ operator()() [2/2]

constexpr double mrpt::math::TTwist3D::operator() ( int  row,
int  col 
) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 89 of file TTwist3D.h.

References ASSERT_EQUAL_.

◆ operator*=()

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

Scale factor.

Definition at line 96 of file TTwist3D.h.

References vx, vy, vz, wx, wy, and wz.

◆ operator==()

bool TTwist3D::operator== ( const TTwist3D o) const

Definition at line 56 of file Twist3D.cpp.

References vx, vy, vz, wx, wy, and wz.

◆ operator[]() [1/2]

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

Coordinate access using operator[].

Order: vx,vy,vz, wx, wy, wz

Definition at line 39 of file TTwist3D.h.

References vx, vy, vz, wx, wy, and wz.

◆ operator[]() [2/2]

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 60 of file TTwist3D.h.

References vx, vy, vz, wx, wy, and wz.

◆ resize()

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

throws if attempted to resize to incorrect length

Definition at line 70 of file TPoseOrPoint.h.

◆ rotate()

void TTwist3D::rotate ( const mrpt::math::TPose3D rot)

Transform all 6 components for a change of reference frame from "A" to another frame "B" whose rotation with respect to "A" is given by rot.

The translational part of the pose is ignored

Definition at line 43 of file Twist3D.cpp.

References mrpt::math::TPose3D::getRotationMatrix(), R, vx, vy, vz, wx, wy, and wz.

Here is the call graph for this function:

◆ rows()

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

Definition at line 65 of file TPoseOrPoint.h.

◆ size()

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

Definition at line 67 of file TPoseOrPoint.h.

Member Data Documentation

◆ vx

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

Velocity components: X,Y (m/s)

Definition at line 26 of file TTwist3D.h.

Referenced by asString(), operator*=(), operator==(), operator[](), and rotate().

◆ vy

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

Definition at line 26 of file TTwist3D.h.

Referenced by asString(), operator*=(), operator==(), operator[](), and rotate().

◆ vz

double mrpt::math::TTwist3D::vz {.0}

Definition at line 26 of file TTwist3D.h.

Referenced by asString(), operator*=(), operator==(), operator[](), and rotate().

◆ wx

double mrpt::math::TTwist3D::wx {.0}

Angular velocity (rad/s)

Definition at line 28 of file TTwist3D.h.

Referenced by asString(), operator*=(), operator==(), operator[](), and rotate().

◆ wy

double mrpt::math::TTwist3D::wy {.0}

Definition at line 28 of file TTwist3D.h.

Referenced by asString(), operator*=(), operator==(), operator[](), and rotate().

◆ wz

double mrpt::math::TTwist3D::wz {.0}

Definition at line 28 of file TTwist3D.h.

Referenced by asString(), operator*=(), operator==(), operator[](), and rotate().




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 44b1e7295 Fri Jun 5 12:35:25 2020 +0200 at vie jun 5 12:45:10 CEST 2020