Struct TTwist2D
Defined in File TTwist2D.h
Inheritance Relationships
Base Type
public mrpt::math::internal::ProvideStaticResize< TTwist2D >(Template Struct ProvideStaticResize)
Struct Documentation
-
struct TTwist2D : public mrpt::math::internal::ProvideStaticResize<TTwist2D>
2D twist: 2D velocity vector (vx,vy) + planar angular velocity (omega)
See also
Public Functions
-
inline constexpr TTwist2D(double vx_, double vy_, double omega_)
Constructor from components
-
TTwist2D() = default
Default fast constructor. Initializes to zeros
-
inline double &operator[](size_t i)
Coordinate access using operator[]. Order: vx,vy,vphi
-
inline constexpr double operator[](size_t i) const
Coordinate access using operator[]. Order: vx,vy,vphi
-
template<typename Vector>
inline void asVector(Vector &v) const Gets the twist as a vector of doubles.
- 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.
-
void rotate(const double ang)
Transform the (vx,vy) components for a counterclockwise rotation of
angradians.
-
inline TTwist2D rotated(const double ang) const
Like rotate(), but returning a copy of the rotated twist.
Note
New in MRPT 2.3.2
-
mrpt::math::TPose2D operator*(const double dt) const
Returns the pose increment of multiplying each twist component times “dt” seconds.
-
inline void operator*=(const double k)
Scale factor
-
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: “[vx
vy omega]”, omega in deg/s)
See also
-
inline std::string asString() const
Public Members
-
double vx = {.0}
Velocity components: X,Y (m/s)
-
double vy = {.0}
-
double omega = {.0}
Angular velocity (rad/s)
Public Static Functions
Public Static Attributes
-
static constexpr std::size_t static_size = 3
-
inline constexpr TTwist2D(double vx_, double vy_, double omega_)