#include <mrpt/poses/CPoseOrPoint.h>
Public Member Functions | |
CPoseOrPoint () | |
double | distanceTo (const CPoseOrPoint &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 const math::CMatrixDouble & | getHomogeneousMatrix () const =0 |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation), or pose (translation+orientation). | |
virtual void | getHomogeneousMatrix (const math::CMatrixDouble *&ptrHM) const =0 |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation), or pose (translation+orientation). | |
void | getInverseHomogeneousMatrix (math::CMatrixDouble &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:. | |
Public Attributes | |
double | x |
The N-dimensional point coordinates. | |
double | y |
double | z |
Protected Attributes | |
bool | is3D |
Will be false for 2D points or poses, and true for 3D points or poses. |
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 560 of file CPoseOrPoint.h.
mrpt::poses::CPoseOrPoint::CPoseOrPoint | ( | ) | [inline] |
Definition at line 572 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 630 of file CPoseOrPoint.h.
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 640 of file CPoseOrPoint.h.
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 635 of file CPoseOrPoint.h.
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 645 of file CPoseOrPoint.h.
double mrpt::poses::CPoseOrPoint::distanceTo | ( | const CPoseOrPoint & | b | ) | const [inline] |
virtual void mrpt::poses::CPoseOrPoint::getHomogeneousMatrix | ( | const math::CMatrixDouble *& | ptrHM | ) | 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.
virtual const math::CMatrixDouble& mrpt::poses::CPoseOrPoint::getHomogeneousMatrix | ( | ) | 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.
void mrpt::poses::CPoseOrPoint::getInverseHomogeneousMatrix | ( | math::CMatrixDouble & | out_HM | ) | const |
Returns the corresponding inverse homogeneous transformation matrix for the point(translation), or pose (translation+orientation).
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] |
bool mrpt::poses::CPoseOrPoint::is3D [protected] |
Will be false for 2D points or poses, and true for 3D points or poses.
Definition at line 569 of file CPoseOrPoint.h.
Referenced by distanceTo(), and sqrDistanceTo().
double mrpt::poses::CPoseOrPoint::x |
The N-dimensional point coordinates.
Definition at line 577 of file CPoseOrPoint.h.
Referenced by distanceTo(), mrpt::slam::CRobotSimulator::GetOdometry(), mrpt::slam::CRobotSimulator::GetRealPose(), and sqrDistanceTo().
double mrpt::poses::CPoseOrPoint::y |
Definition at line 577 of file CPoseOrPoint.h.
Referenced by distanceTo(), mrpt::slam::CRobotSimulator::GetOdometry(), mrpt::slam::CRobotSimulator::GetRealPose(), and sqrDistanceTo().
double mrpt::poses::CPoseOrPoint::z |
Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:25:04 EST 2009 |