9 #ifndef CPOSE3DROTVEC_H 10 #define CPOSE3DROTVEC_H 75 const double vx,
const double vy,
const double vz,
const double x,
76 const double y,
const double z)
144 out_HM.set_unsafe(0, 3,
m_coords[0]);
145 out_HM.set_unsafe(1, 3,
m_coords[1]);
146 out_HM.set_unsafe(2, 3,
m_coords[2]);
147 out_HM.set_unsafe(3, 0, 0);
148 out_HM.set_unsafe(3, 1, 0);
149 out_HM.set_unsafe(3, 2, 0);
150 out_HM.set_unsafe(3, 3, 1);
194 this->m_rotvec[0] = aux[0];
195 this->m_rotvec[1] = aux[1];
196 this->m_rotvec[2] = aux[2];
198 this->m_coords[0] = m.get_unsafe(0, 3);
199 this->m_coords[1] = m.get_unsafe(1, 3);
200 this->m_coords[2] = m.get_unsafe(2, 3);
204 const double x,
const double y,
const double z,
const double yaw = 0,
205 const double pitch = 0,
const double roll = 0);
212 double& out_pitch)
const;
222 double lx,
double ly,
double lz,
double& gx,
double& gy,
double& gz,
238 local_point.
x, local_point.
y, local_point.
z, global_point.
x,
239 global_point.
y, global_point.
z);
250 const double gx,
const double gy,
const double gz,
double& lx,
251 double& ly,
double& lz,
264 out_jacobian_drvtC_drvtA =
nullptr,
266 out_jacobian_drvtC_drvtB =
nullptr);
353 const double x0,
const double y0,
const double z0,
const double vx,
354 const double vy,
const double vz)
369 template <
class ARRAYORVECTOR>
387 template <
class ARRAYORVECTOR>
400 template <
class ARRAYORVECTOR>
424 throw std::runtime_error(
425 "CPose3DRotVec::operator[]: Index of bounds.");
445 throw std::runtime_error(
446 "CPose3DRotVec::operator[]: Index of bounds.");
475 if (!m.fromMatlabStringFormat(
s))
479 "Wrong size of vector in ::fromString");
480 for (
int i = 0; i < 3; i++)
m_coords[i] = m.get_unsafe(0, i);
481 for (
int i = 0; i < 3; i++)
m_rotvec[i] = m.get_unsafe(0, 3 + i);
539 static inline bool empty() {
return false; }
544 throw std::logic_error(
546 "Try to change the size of CPose3DRotVec to %u.",
547 static_cast<unsigned>(
n)));
553 std::ostream&
operator<<(std::ostream& o,
const CPose3DRotVec&
p);
557 CPose3DRotVec
operator-(
const CPose3DRotVec&
p);
559 bool operator==(
const CPose3DRotVec& p1,
const CPose3DRotVec& p2);
560 bool operator!=(
const CPose3DRotVec& p1,
const CPose3DRotVec& p2);
CPose3DRotVec(const double vx, const double vy, const double vz, const double x, const double y, const double z)
Constructor with initilization of the pose.
static CPose3DRotVec exp(const mrpt::math::CArrayDouble< 6 > &vect)
Exponentiate a Vector in the SE(3) Lie Algebra to generate a new CPose3DRotVec (static method)...
double x() const
Common members of all points & poses classes.
CPose3DRotVec operator+(const CPose3DRotVec &b) const
The operator is the pose compounding operator.
void changeCoordinatesReference(const CPose3DRotVec &p)
makes: this = p (+) this
const double & operator[](unsigned int i) const
void composePoint(const mrpt::math::TPoint3D local_point, mrpt::math::TPoint3D &global_point) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
void asString(std::string &s) const
Returns a human-readable textual representation of the object: "[x y z rx ry rz]".
const type_value & getPoseMean() const
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void inverse()
Convert this pose into its inverse, saving the result in itself.
void setFromValues(const double x0, const double y0, const double z0, const double vx, const double vy, const double vz)
Set the pose from a 3D position (meters) and yaw/pitch/roll angles (radians) - This method recomputes...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
void setFromXYZAndAngles(const double x, const double y, const double z, const double yaw=0, const double pitch=0, const double roll=0)
CPose3DRotVec getInverse() const
Compute the inverse of this pose and return the result.
CPose3DRotVec operator-(const CPose3DRotVec &b) const
Compute .
#define THROW_EXCEPTION(msg)
GLdouble GLdouble GLdouble GLdouble q
void setToNaN() override
Set all data fields to quiet NaN.
void addComponents(const CPose3DRotVec &p)
Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" ...
void getHomogeneousMatrix(mrpt::math::CMatrixDouble44 &out_HM) const
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (t...
void setFromTransformationMatrix(const mrpt::math::CMatrixDouble44 &m)
double & operator[](unsigned int i)
void inverseComposePoint(const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr) const
Computes the 3D point L such as .
const mrpt::math::CMatrixDouble33 getRotationMatrix() const
void ln(mrpt::math::CArrayDouble< 6 > &out_ln) const
Take the logarithm of the 3x4 matrix defined by this pose, generating the corresponding vector in the...
CPose3DRotVec type_value
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[x y z yaw pitch roll]"...
A numeric matrix of compile-time fixed size.
void getAs6Vector(ARRAYORVECTOR &vec6) const
Gets pose as an array with these 6 elements: [x y z vx vy vz] where v{xyz} is the rotation vector and...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
void setFrom6Vector(const ARRAYORVECTOR &vec6)
Set pose from an array with these 6 elements: [x y z vx vy vz] where v{xyz} is the rotation vector an...
void sphericalCoordinates(const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch) const
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object...
bool operator!=(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
double value_type
The type of the elements.
CPose2D operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
void operator*=(const double s)
Scalar multiplication of x,y,z,vx,vy,vz.
A base class for representing a pose in 2D or 3D.
mrpt::math::CArrayDouble< 3 > rotVecFromRotMat(const math::CMatrixDouble44 &m)
Create a vector with 3 components according to the input transformation matrix (only the rotation wil...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
double x
X,Y,Z coordinates.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
GLsizei const GLchar ** string
A class used to store a 2D point.
A class used to store a 3D point.
static void resize(const size_t n)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
type_value & getPoseMean()
CPose3DRotVec(TConstructorFlags_Poses constructor_dummy_param)
Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument...
size_t size(const MATRIXLIKE &m, const int dim)
mrpt::math::CArrayDouble< 3 > ln_rotation() const
Take the logarithm of the 3x3 rotation matrix part of this pose, generating the corresponding vector ...
bool operator==(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
CPose3DRotVec(const mrpt::math::CArrayDouble< 6 > &v)
Constructor with initilization of the pose from a vector [w1 w2 w3 x y z].
CPose3DRotVec & operator+=(const CPose3DRotVec &b)
Make (b can be "this" without problems)
mrpt::math::CArrayDouble< 3 > m_rotvec
The rotation vector [vx,vy,vz].
void toQuatXYZ(CPose3DQuat &q) const
Convert this RVT into a quaternion + XYZ.
mrpt::math::CMatrixDouble44 getHomogeneousMatrixVal() const
const double & const_reference
void inverseComposeFrom(const CPose3DRotVec &A, const CPose3DRotVec &B)
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary objec...
void composeFrom(const CPose3DRotVec &A, const CPose3DRotVec &B, mrpt::math::CMatrixFixedNumeric< double, 6, 6 > *out_jacobian_drvtC_drvtA=nullptr, mrpt::math::CMatrixFixedNumeric< double, 6, 6 > *out_jacobian_drvtC_drvtB=nullptr)
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids th...
CPose3DRotVec(const CPose3DRotVec &o)
Copy constructor.
std::ptrdiff_t difference_type
CPose3DRotVec & operator=(const CPose3DRotVec &o)
Copy operator.
CPose3DRotVec(const double *vec6)
Constructor from an array with these 6 elements: [w1 w2 w3 x y z] where r{ij} are the entries of the ...
static size_type max_size()
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ...
#define ASSERTMSG_(f, __ERROR_MSG)
void getAsVector(ARRAYORVECTOR &v) const
Like getAs6Vector() but for dynamic size vectors (required by base class CPoseOrPoint) ...
CPose3DRotVec()
Default constructor, with all the coordinates set to zero.
std::string asString() const
std::ostream & operator<<(std::ostream &o, const CPoint< DERIVEDCLASS > &p)
Dumps a point as a string [x,y] or [x,y,z].
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].