![]() |
MoveG 1.0.0
A modern C++ library for Robotics
|
Class representing a pose in 3D space. More...
#include <pose_lib.h>
Collaboration diagram for MoveG::Pose:Public Member Functions | |
| Pose () noexcept | |
| Default constructor. | |
| Pose (const Eigen::Vector3d &position, const Eigen::Quaterniond &orientation) | |
| Constructor with position and quaternion orientation. | |
| Pose (const Eigen::Vector3d &position, const Eigen::Matrix3d &rotation_matrix) | |
| Constructor with position and rotation matrix. | |
| Pose (const Eigen::Affine3d &transformation) | |
| Constructor with affine transformation. | |
| Pose (const Eigen::Vector3d &position, const Rotation &orientation) | |
| Constructor with position and Rotation object. | |
| Pose (const Eigen::Matrix4d &homogeneousT) | |
| Constructor with homogeneous transformation matrix 4x4. | |
| ~Pose () | |
| Destructor. | |
| Pose (const Pose &other) | |
| Copy constructor. | |
| Pose (Pose &&other) noexcept | |
| Move constructor. | |
| Pose & | operator= (const Pose &other) |
| Copy assignment operator. | |
| Pose & | operator= (Pose &&other) noexcept |
| Move assignment operator. | |
| Eigen::Vector3d | getPosition () const |
| Gets the position. | |
| Eigen::Quaterniond | getQuaternion () const |
| Gets the orientation quaternion. | |
| Eigen::Matrix3d | getRotationMatrix () const |
| Gets the rotation matrix. | |
| Eigen::Affine3d | getAffineTransformation () const |
| Gets the affine transformation. | |
| Eigen::Matrix4d | getHomogeneousT () const |
| Gets the homogeneous transformation matrix. | |
| double | getX () const |
| Gets the X coordinate of the position. | |
| double | getY () const |
| Gets the Y coordinate of the position. | |
| double | getZ () const |
| Gets the Z coordinate of the position. | |
| double | getQx () const |
| Gets the X component of the quaternion. | |
| double | getQy () const |
| Gets the Y component of the quaternion. | |
| double | getQz () const |
| Gets the Z component of the quaternion. | |
| double | getQw () const |
| Gets the W component of the quaternion. | |
| void | setPosition (const Eigen::Vector3d &position) |
| Sets the position. | |
| void | setOrientation (const Eigen::Quaterniond &orientation) |
| Sets the orientation via quaternion. | |
| void | setRotationMatrix (const Eigen::Matrix3d &rotation_matrix) |
| Sets the rotation matrix. | |
| void | setAffineTransformation (const Eigen::Affine3d &transformation) |
| Sets the affine transformation. | |
| void | setHomogeneousT (const Eigen::Matrix4d &homogeneousT) |
| Sets the homogeneous transformation matrix. | |
| double | positionDistance (const Pose &other) const |
| Calculates the Euclidean distance between the positions of two poses. | |
| double | orientationDistance (const Pose &other) const |
| Calculates the angular distance between the orientations of two poses. | |
| Pose | operator* (const Pose &other) const |
| Composition of two poses. | |
| Pose | inverse () const |
| Calculates the inverse of the pose. | |
| Pose | transformPose (const Pose &transform) const |
| Transforms this pose from one coordinate frame to another. | |
| Eigen::Vector3d | localToGlobal (const Eigen::Vector3d &local_point) const |
| Transforms a point from the pose's local frame to the global frame. | |
| Eigen::Vector3d | globalToLocal (const Eigen::Vector3d &global_point) const |
| Transforms a point from the global frame to the pose's local frame. | |
Static Private Member Functions | |
| static void | validateHomogeneousMatrix (const Eigen::Matrix4d &homogeneousT) |
| Validates a homogeneous transformation matrix. | |
Private Attributes | |
| Eigen::Vector3d | position_ |
| Position in 3D space. | |
| Eigen::Quaterniond | orientation_ |
| Orientation represented as quaternion. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Pose &pose) |
| Overloads the stream insertion operator. | |
Class representing a pose in 3D space.
The Pose class encapsulates a position and orientation in three-dimensional space. It uses Eigen for mathematical operations related to geometry.
Definition at line 34 of file pose_lib.h.
|
noexcept |
Default constructor.
Initializes the pose at position (0,0,0) with neutral orientation (identity quaternion).
Definition at line 14 of file pose_lib.cpp.
Referenced by inverse(), and operator*().
Here is the caller graph for this function:| MoveG::Pose::Pose | ( | const Eigen::Vector3d & | position, |
| const Eigen::Quaterniond & | orientation | ||
| ) |
Constructor with position and quaternion orientation.
| position | The position in space. |
| orientation | The quaternion representing the orientation. |
Definition at line 20 of file pose_lib.cpp.
| MoveG::Pose::Pose | ( | const Eigen::Vector3d & | position, |
| const Eigen::Matrix3d & | rotation_matrix | ||
| ) |
Constructor with position and rotation matrix.
| position | The position in space. |
| rotation_matrix | The 3x3 rotation matrix. |
Definition at line 27 of file pose_lib.cpp.
References orientation_.
|
explicit |
Constructor with affine transformation.
| transformation | The 3D affine transformation. |
Definition at line 34 of file pose_lib.cpp.
References orientation_.
| MoveG::Pose::Pose | ( | const Eigen::Vector3d & | position, |
| const Rotation & | orientation | ||
| ) |
Constructor with position and Rotation object.
| position | The position in space. |
| orientation | The Rotation object representing the orientation. |
Definition at line 42 of file pose_lib.cpp.
References orientation_.
|
explicit |
Constructor with homogeneous transformation matrix 4x4.
| homogeneousT | The 4x4 homogeneous transformation matrix. |
| std::invalid_argument | If the matrix is not a valid homogeneous transformation matrix. |
Definition at line 49 of file pose_lib.cpp.
References orientation_, position_, and validateHomogeneousMatrix().
Here is the call graph for this function:| MoveG::Pose::~Pose | ( | ) |
| MoveG::Pose::Pose | ( | const Pose & | other | ) |
Copy constructor.
| other | The Pose object to copy. |
Definition at line 68 of file pose_lib.cpp.
|
noexcept |
Move constructor.
| other | The Pose object to move. |
Definition at line 73 of file pose_lib.cpp.
| Eigen::Affine3d MoveG::Pose::getAffineTransformation | ( | ) | const |
Gets the affine transformation.
Definition at line 117 of file pose_lib.cpp.
References orientation_, and position_.
Referenced by main().
Here is the caller graph for this function:| Eigen::Matrix4d MoveG::Pose::getHomogeneousT | ( | ) | const |
Gets the homogeneous transformation matrix.
Definition at line 125 of file pose_lib.cpp.
References orientation_, and position_.
Referenced by main().
Here is the caller graph for this function:| Eigen::Vector3d MoveG::Pose::getPosition | ( | ) | const |
Gets the position.
Definition at line 102 of file pose_lib.cpp.
References position_.
Referenced by main().
Here is the caller graph for this function:| Eigen::Quaterniond MoveG::Pose::getQuaternion | ( | ) | const |
Gets the orientation quaternion.
Definition at line 107 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getQw | ( | ) | const |
Gets the W component of the quaternion.
Definition at line 165 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getQx | ( | ) | const |
Gets the X component of the quaternion.
Definition at line 150 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getQy | ( | ) | const |
Gets the Y component of the quaternion.
Definition at line 155 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getQz | ( | ) | const |
Gets the Z component of the quaternion.
Definition at line 160 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| Eigen::Matrix3d MoveG::Pose::getRotationMatrix | ( | ) | const |
Gets the rotation matrix.
Definition at line 112 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getX | ( | ) | const |
Gets the X coordinate of the position.
Definition at line 135 of file pose_lib.cpp.
References position_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getY | ( | ) | const |
Gets the Y coordinate of the position.
Definition at line 140 of file pose_lib.cpp.
References position_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::getZ | ( | ) | const |
Gets the Z coordinate of the position.
Definition at line 145 of file pose_lib.cpp.
References position_.
Referenced by main().
Here is the caller graph for this function:| Eigen::Vector3d MoveG::Pose::globalToLocal | ( | const Eigen::Vector3d & | global_point | ) | const |
Transforms a point from the global frame to the pose's local frame.
| global_point | The point in the global coordinate frame. |
Definition at line 305 of file pose_lib.cpp.
References orientation_, and position_.
Referenced by main().
Here is the caller graph for this function:| Pose MoveG::Pose::inverse | ( | ) | const |
Calculates the inverse of the pose.
Definition at line 229 of file pose_lib.cpp.
References orientation_, Pose(), and position_.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| Eigen::Vector3d MoveG::Pose::localToGlobal | ( | const Eigen::Vector3d & | local_point | ) | const |
Transforms a point from the pose's local frame to the global frame.
| local_point | The point in the local coordinate frame. |
Definition at line 298 of file pose_lib.cpp.
References orientation_, and position_.
Referenced by main().
Here is the caller graph for this function:Composition of two poses.
| other | The second pose to compose. |
Definition at line 221 of file pose_lib.cpp.
References orientation_, Pose(), and position_.
Here is the call graph for this function:Copy assignment operator.
| other | The Pose object to assign. |
Definition at line 79 of file pose_lib.cpp.
References orientation_, and position_.
Move assignment operator.
| other | The Pose object to move and assign. |
Definition at line 90 of file pose_lib.cpp.
| double MoveG::Pose::orientationDistance | ( | const Pose & | other | ) | const |
Calculates the angular distance between the orientations of two poses.
| other | The pose to calculate the angular distance with. |
Definition at line 211 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| double MoveG::Pose::positionDistance | ( | const Pose & | other | ) | const |
Calculates the Euclidean distance between the positions of two poses.
| other | The pose to calculate the distance with. |
Definition at line 206 of file pose_lib.cpp.
References position_.
Referenced by main().
Here is the caller graph for this function:| void MoveG::Pose::setAffineTransformation | ( | const Eigen::Affine3d & | transformation | ) |
Sets the affine transformation.
| transformation | The new 3D affine transformation. |
Definition at line 187 of file pose_lib.cpp.
References orientation_, and position_.
| void MoveG::Pose::setHomogeneousT | ( | const Eigen::Matrix4d & | homogeneousT | ) |
Sets the homogeneous transformation matrix.
| homogeneousT | The new 4x4 homogeneous matrix. |
| std::invalid_argument | If the matrix is not a valid homogeneous transformation matrix. |
Definition at line 193 of file pose_lib.cpp.
References orientation_, position_, and validateHomogeneousMatrix().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void MoveG::Pose::setOrientation | ( | const Eigen::Quaterniond & | orientation | ) |
Sets the orientation via quaternion.
| orientation | The new quaternion representing the orientation. |
Definition at line 177 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:| void MoveG::Pose::setPosition | ( | const Eigen::Vector3d & | position | ) |
Sets the position.
| position | The new position as a 3D vector. |
Definition at line 172 of file pose_lib.cpp.
References position_.
Referenced by main().
Here is the caller graph for this function:| void MoveG::Pose::setRotationMatrix | ( | const Eigen::Matrix3d & | rotation_matrix | ) |
Sets the rotation matrix.
| rotation_matrix | The new 3x3 rotation matrix. |
Definition at line 182 of file pose_lib.cpp.
References orientation_.
Referenced by main().
Here is the caller graph for this function:Transforms this pose from one coordinate frame to another.
| transform | The transformation between the two coordinate frames. |
Definition at line 291 of file pose_lib.cpp.
Referenced by main().
Here is the caller graph for this function:
|
staticprivate |
Validates a homogeneous transformation matrix.
Checks that the last row is [0,0,0,1] and that the rotation part is orthogonal.
| homogeneousT | The homogeneous transformation matrix to validate. |
| std::invalid_argument | If the matrix is not a valid homogeneous transformation matrix. |
Definition at line 237 of file pose_lib.cpp.
Referenced by Pose(), and setHomogeneousT().
Here is the caller graph for this function:
|
friend |
Overloads the stream insertion operator.
| os | The output stream. |
| pose | The Pose object to insert into the stream. |
Definition at line 281 of file pose_lib.cpp.
|
private |
Orientation represented as quaternion.
Definition at line 314 of file pose_lib.h.
Referenced by getAffineTransformation(), getHomogeneousT(), getQuaternion(), getQw(), getQx(), getQy(), getQz(), getRotationMatrix(), globalToLocal(), inverse(), localToGlobal(), operator*(), operator=(), orientationDistance(), Pose(), Pose(), Pose(), Pose(), setAffineTransformation(), setHomogeneousT(), setOrientation(), and setRotationMatrix().
|
private |
Position in 3D space.
Definition at line 313 of file pose_lib.h.
Referenced by getAffineTransformation(), getHomogeneousT(), getPosition(), getX(), getY(), getZ(), globalToLocal(), inverse(), localToGlobal(), operator*(), operator=(), Pose(), positionDistance(), setAffineTransformation(), setHomogeneousT(), and setPosition().