#include <mrpt/poses/CPoseOrPoint.h>
Public Member Functions | |
CPoseOrPoint () | |
double | x () const |
Get the X coordinate. | |
double | y () const |
Get the Y coordinate. | |
double | z () const |
Get the Z coordinate. | |
virtual void | x (const double x_) |
Set the X coordinate. | |
virtual void | y (const double y_) |
Set the Y coordinate. | |
virtual void | z (const double z_) |
Set the Z coordinate. | |
virtual void | x_incr (const double Ax) |
Increment the X coordinate. | |
virtual void | y_incr (const double Ay) |
Increment the Y coordinate. | |
virtual void | z_incr (const double Az) |
Increment the Z coordinate. | |
bool | is3DPoseOrPoint () const |
Return true for poses or points with a Z component, false otherwise. | |
double | distanceTo (const CPoseOrPoint &b) const |
Returns the euclidean distance to another pose/point:. | |
double | distanceTo (const mrpt::math::TPoint3D &b) const |
Returns the euclidean distance to another pose/point:. | |
double | sqrDistanceTo (const CPoseOrPoint &b) const |
Returns the squared euclidean distance to another pose/point:. | |
double | norm () const |
Returns the euclidean norm of vector: ![]() | |
virtual void | operator*= (const double &s)=0 |
Scalar multiplication. | |
virtual void | getAsVector (vector_double &v) const =0 |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation). | |
vector_double | getAsVectorVal () const |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation). | |
CMatrixDouble44 | getHomogeneousMatrixVal () const |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). | |
virtual void | getHomogeneousMatrix (CMatrixDouble44 &out_HM) const =0 |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). | |
void | getInverseHomogeneousMatrix (math::CMatrixDouble44 &out_HM) const |
Returns the corresponding inverse homogeneous transformation matrix for the point(translation), or pose (translation+orientation). | |
double | distance2DTo (double ax, double ay) const |
Returns the 2D distance from this pose/point to another given by its coordinates:. | |
double | distance3DTo (double ax, double ay, double az) const |
Returns the 3D distance from this pose/point to another given by its coordinates:. | |
double | distance2DToSquare (double ax, double ay) const |
Returns the square of the 2D distance from this pose/point to another given by its coordinates:. | |
double | distance3DToSquare (double ax, double ay, double az) const |
Returns the square of the the 3D distance from this pose/point to another given by its coordinates:. | |
Protected Attributes | |
bool | m_is3D |
Will be false for 2D points or poses, and true for 3D points or poses. | |
double | m_x |
double | m_y |
double | m_z |
The x y and z coordinates of the point or pose. |
The common part defined in this base is the N-dimensional (N=2,3) position vector. The existence of orientation angles is left to derived classes. In this class euclidean distance methods and operators are implemented.
For more information and examples, refer to the 2D/3D Geometry tutorial in the wiki.
There are two class of spatial representation classes:
Operators: There are operators defined for the pose compounding (+) and inverse pose compounding (-) of poses and points. For example, let "a" and "b" be 2D or 3D poses. Then "a+b" returns the resulting pose of "moving b" from "a"; and "b-a" returns the pose of "b" as it is seen "from a". They can be mixed points and poses, being 2D or 3D, in these operators, with the following results:
a \ b | Pose | Point |
Pose | Pose | Point |
Point | Pose | Point |
a \ b | Pose | Point |
Pose | Pose | Pose |
Point | Point | Point |
a \ b | 2D | 3D |
2D | 2D | 3D |
3D | 3D | 3D |
Homogeneous transfomation matrix | Spatial representation | ||||||||||||||||
|
![]() |
Homogeneous transfomation matrix | Spatial representation | ||||||||||||||||
|
![]() |
Homogeneous transfomation matrix | Spatial representation | ||||||||||||||||
|
![]() |
Homogeneous transfomation matrix | Spatial representation | ||||||||||||||||
where: cy = cos Yaw ; sy = sin Yaw cp = cos Pitch ; sp = sin Pitch cr = cos Roll ; sr = sin Roll |
|
Definition at line 564 of file CPoseOrPoint.h.
mrpt::poses::CPoseOrPoint::CPoseOrPoint | ( | ) | [inline] |
Definition at line 574 of file CPoseOrPoint.h.
double mrpt::poses::CPoseOrPoint::distance2DTo | ( | double | ax, | |
double | ay | |||
) | const [inline] |
Returns the 2D distance from this pose/point to another given by its coordinates:.
Definition at line 663 of file CPoseOrPoint.h.
References mrpt::utils::square().
double mrpt::poses::CPoseOrPoint::distance2DToSquare | ( | double | ax, | |
double | ay | |||
) | const [inline] |
Returns the square of the 2D distance from this pose/point to another given by its coordinates:.
Definition at line 673 of file CPoseOrPoint.h.
References mrpt::utils::square().
double mrpt::poses::CPoseOrPoint::distance3DTo | ( | double | ax, | |
double | ay, | |||
double | az | |||
) | const [inline] |
Returns the 3D distance from this pose/point to another given by its coordinates:.
Definition at line 668 of file CPoseOrPoint.h.
References mrpt::utils::square().
double mrpt::poses::CPoseOrPoint::distance3DToSquare | ( | double | ax, | |
double | ay, | |||
double | az | |||
) | const [inline] |
Returns the square of the the 3D distance from this pose/point to another given by its coordinates:.
Definition at line 678 of file CPoseOrPoint.h.
References mrpt::utils::square().
double mrpt::poses::CPoseOrPoint::distanceTo | ( | const mrpt::math::TPoint3D & | b | ) | const [inline] |
Returns the euclidean distance to another pose/point:.
Definition at line 604 of file CPoseOrPoint.h.
References mrpt::utils::square(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
double mrpt::poses::CPoseOrPoint::distanceTo | ( | const CPoseOrPoint & | b | ) | const [inline] |
Returns the euclidean distance to another pose/point:.
Definition at line 595 of file CPoseOrPoint.h.
References m_is3D, m_x, m_y, m_z, and mrpt::utils::square().
virtual void mrpt::poses::CPoseOrPoint::getAsVector | ( | vector_double & | v | ) | const [pure virtual] |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation).
Implemented in mrpt::poses::CPoint2D, mrpt::poses::CPoint3D, mrpt::poses::CPose2D, and mrpt::poses::CPose3D.
vector_double mrpt::poses::CPoseOrPoint::getAsVectorVal | ( | ) | const [inline] |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation).
Definition at line 632 of file CPoseOrPoint.h.
virtual void mrpt::poses::CPoseOrPoint::getHomogeneousMatrix | ( | CMatrixDouble44 & | out_HM | ) | const [pure virtual] |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
Implemented in mrpt::poses::CPoint2D, mrpt::poses::CPoint3D, mrpt::poses::CPose2D, and mrpt::poses::CPose3D.
CMatrixDouble44 mrpt::poses::CPoseOrPoint::getHomogeneousMatrixVal | ( | ) | const [inline] |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
Definition at line 642 of file CPoseOrPoint.h.
void mrpt::poses::CPoseOrPoint::getInverseHomogeneousMatrix | ( | math::CMatrixDouble44 & | out_HM | ) | const |
Returns the corresponding inverse homogeneous transformation matrix for the point(translation), or pose (translation+orientation).
bool mrpt::poses::CPoseOrPoint::is3DPoseOrPoint | ( | ) | const [inline] |
Return true for poses or points with a Z component, false otherwise.
Definition at line 591 of file CPoseOrPoint.h.
double mrpt::poses::CPoseOrPoint::norm | ( | ) | const |
Returns the euclidean norm of vector: .
virtual void mrpt::poses::CPoseOrPoint::operator*= | ( | const double & | s | ) | [pure virtual] |
Scalar multiplication.
Implemented in mrpt::poses::CPoint, mrpt::poses::CPose2D, and mrpt::poses::CPose3D.
double mrpt::poses::CPoseOrPoint::sqrDistanceTo | ( | const CPoseOrPoint & | b | ) | const [inline] |
Returns the squared euclidean distance to another pose/point:.
Definition at line 613 of file CPoseOrPoint.h.
References m_is3D, m_x, m_y, m_z, and mrpt::utils::square().
virtual void mrpt::poses::CPoseOrPoint::x | ( | const double | x_ | ) | [inline, virtual] |
Set the X coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 581 of file CPoseOrPoint.h.
double mrpt::poses::CPoseOrPoint::x | ( | ) | const [inline] |
Get the X coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 577 of file CPoseOrPoint.h.
Referenced by mrpt::slam::CPointsMap::insertPoint().
virtual void mrpt::poses::CPoseOrPoint::x_incr | ( | const double | Ax | ) | [inline, virtual] |
Increment the X coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 585 of file CPoseOrPoint.h.
virtual void mrpt::poses::CPoseOrPoint::y | ( | const double | y_ | ) | [inline, virtual] |
Set the Y coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 582 of file CPoseOrPoint.h.
double mrpt::poses::CPoseOrPoint::y | ( | ) | const [inline] |
Get the Y coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 578 of file CPoseOrPoint.h.
Referenced by mrpt::slam::CPointsMap::insertPoint().
virtual void mrpt::poses::CPoseOrPoint::y_incr | ( | const double | Ay | ) | [inline, virtual] |
Increment the Y coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 586 of file CPoseOrPoint.h.
virtual void mrpt::poses::CPoseOrPoint::z | ( | const double | z_ | ) | [inline, virtual] |
Set the Z coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 583 of file CPoseOrPoint.h.
double mrpt::poses::CPoseOrPoint::z | ( | ) | const [inline] |
Get the Z coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 579 of file CPoseOrPoint.h.
Referenced by mrpt::slam::CPointsMap::insertPoint().
virtual void mrpt::poses::CPoseOrPoint::z_incr | ( | const double | Az | ) | [inline, virtual] |
Increment the Z coordinate.
Reimplemented in mrpt::poses::CPose3D.
Definition at line 587 of file CPoseOrPoint.h.
bool mrpt::poses::CPoseOrPoint::m_is3D [protected] |
Will be false for 2D points or poses, and true for 3D points or poses.
Definition at line 570 of file CPoseOrPoint.h.
Referenced by distanceTo(), and sqrDistanceTo().
double mrpt::poses::CPoseOrPoint::m_x [protected] |
double mrpt::poses::CPoseOrPoint::m_y [protected] |
double mrpt::poses::CPoseOrPoint::m_z [protected] |
The x y and z coordinates of the point or pose.
Definition at line 571 of file CPoseOrPoint.h.
Referenced by distanceTo(), and sqrDistanceTo().
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:21:34 EDT 2009 |