Struct TTwist3D

Inheritance Relationships

Base Type

Struct Documentation

struct TTwist3D : public mrpt::math::internal::ProvideStaticResize<TTwist3D>

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

Public Functions

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

Constructor from components

TTwist3D() = default

Default fast constructor. Initializes to zeros

inline double &operator[](size_t i)

Coordinate access using operator[]. Order: vx,vy,vz, wx, wy, wz

inline constexpr double operator[](size_t i) const

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

inline double &operator()(int row, int col)

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

See also

operator[]

inline constexpr double operator()(int row, int col) const

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

inline void operator*=(const double k)

Scale factor

template<typename Vector>
inline void asVector(Vector &v) const

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

Template Parameters:

Vector – It can be std::vector<double>, Eigen::VectorXd, etc.

template<typename Vector>
inline Vector asVector() const

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

template<typename VECTORLIKE>
inline void fromVector(const VECTORLIKE &v)

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

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)

See also

fromString

inline 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. The translational part of the pose is ignored

inline TTwist3D rotated(const mrpt::math::TPose3D &rot) const

Like rotate(), but returning a copy of the rotated twist.

Note

New in MRPT 2.3.2

void 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

Throws:

std::exception – On invalid format

Public Members

double vx = {.0}

Velocity components: X,Y (m/s)

double vy = {.0}
double vz = {.0}
double wx = {.0}

Angular velocity (rad/s)

double wy = {.0}
double wz = {.0}

Public Static Functions

template<typename Vector>
static inline TTwist3D FromVector(const Vector &v)

Builds from the first 6 elements of a vector-like object: [vx vy vz wx wy wz]

Template Parameters:

Vector – It can be std::vector<double>, Eigen::VectorXd, etc.

static inline TTwist3D FromString(const std::string &s)

Public Static Attributes

static constexpr std::size_t static_size = 6