22 static_assert(std::is_trivially_copyable_v<TTwist3D>);
36 m.
rows() == 1 && m.
cols() == 6,
"Wrong size of vector in ::fromString");
37 for (
int i = 0; i < 3; i++) (*
this)[i] = m(0, i);
38 for (
int i = 0; i < 3; i++) (*
this)[3 + i] =
DEG2RAD(m(0, 3 + i));
48 vx =
R(0, 0) * t.
vx +
R(0, 1) * t.
vy +
R(0, 2) * t.
vz;
49 vy =
R(1, 0) * t.
vx +
R(1, 1) * t.
vy +
R(1, 2) * t.
vz;
50 vz =
R(2, 0) * t.
vx +
R(2, 1) * t.
vy +
R(2, 2) * t.
vz;
52 wx =
R(0, 0) * t.
wx +
R(0, 1) * t.
wy +
R(0, 2) * t.
wz;
53 wy =
R(1, 0) * t.
wx +
R(1, 1) * t.
wy +
R(1, 2) * t.
wz;
54 wz =
R(2, 0) * t.
wx +
R(2, 1) * t.
wy +
R(2, 2) * t.
wz;
66 for (
size_t i = 0; i < o.
size(); i++) in >> o[i];
72 for (
size_t i = 0; i < o.
size(); i++)
out << o[i];
#define THROW_EXCEPTION(msg)
std::string std::string format(std::string_view fmt, ARGS &&... args)
void getRotationMatrix(mrpt::math::CMatrixDouble33 &R) const
3D twist: 3D velocity vector (vx,vy,vz) + angular velocity (wx,wy,wz)
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, CMatrixD::Ptr &pObj)
This base provides a set of functions for maths stuff.
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[vx vy vz wx wy wz]" ) ...
bool operator!=(const TTwist3D &o) const
constexpr double DEG2RAD(const double x)
Degrees to radians.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
bool fromMatlabStringFormat(const std::string &s, mrpt::optional_ref< std::ostream > dump_errors_here=std::nullopt)
Reads a matrix from a string in Matlab-like format, for example: "[1 0 2; 0 4 -1]" The string must st...
size_type rows() const
Number of rows in the matrix.
size_type cols() const
Number of columns in the matrix.
constexpr std::size_t size() const
double wx
Angular velocity (rad/s)
Virtual base class for "archives": classes abstracting I/O streams.
double vx
Velocity components: X,Y (m/s)
mrpt::vision::TStereoCalibResults out
void rotate(const mrpt::math::TPose3D &rot)
Transform all 6 components for a change of reference frame from "A" to another frame "B" whose rotati...
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &s, const CVectorFloat &a)
constexpr double RAD2DEG(const double x)
Radians to degrees.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
std::string asString() const
bool operator==(const TTwist3D &o) const