Encapsulates a position and rotation in three space. More...
#include <Pose.hh>
Public Member Functions | |
Pose () | |
Default constructors. | |
Pose (const Vector3 &_pos, const Quaternion &_rot) | |
Constructor. | |
Pose (double _x, double _y, double _z, double _roll, double _pitch, double _yaw) | |
Constructor. | |
Pose (const Pose &_pose) | |
Copy constructor. | |
virtual | ~Pose () |
Destructor. | |
Pose | CoordPoseSolve (const Pose &_b) const |
Find the inverse of a pose; i.e., if b = this + a, given b and this, find a. | |
Vector3 | CoordPositionAdd (const Vector3 &_pos) const |
Add one point to a vector: result = this + pos. | |
Vector3 | CoordPositionAdd (const Pose &_pose) const |
Add one point to another: result = this + pose. | |
Vector3 | CoordPositionSub (const Pose &_pose) const |
Subtract one position from another: result = this - pose. | |
Quaternion | CoordRotationAdd (const Quaternion &_rot) const |
Add one rotation to another: result = this->rot + rot. | |
Quaternion | CoordRotationSub (const Quaternion &_rot) const |
Subtract one rotation from another: result = this->rot - rot. | |
void | Correct () |
Fix any nan values. | |
Pose | GetInverse () const |
Get the inverse of this pose. | |
bool | IsFinite () const |
See if a pose is finite (e.g., not nan) | |
bool | operator!= (const Pose &_pose) const |
Inequality operator. | |
Pose | operator* (const Pose &_pose) |
Multiplication operator. | |
Pose | operator+ (const Pose &_pose) const |
Addition operator. | |
const Pose & | operator+= (const Pose &_pose) |
Add-Equals operator. | |
Pose | operator- (const Pose &_pose) const |
Subtraction operator. | |
const Pose & | operator-= (const Pose &_pose) |
Subtraction operator. | |
bool | operator== (const Pose &_pose) const |
Equality operator. | |
void | Reset () |
Reset the pose. | |
Pose | RotatePositionAboutOrigin (const Quaternion &_rot) const |
Rotate vector part of a pose about the origin. | |
void | Round (int _precision) |
Round all values to _precision decimal places. | |
void | Set (const Vector3 &_pos, const Quaternion &_rot) |
Set the pose from a Vector3 and a Quaternion. | |
void | Set (double _x, double _y, double _z, double _roll, double _pitch, double _yaw) |
Set the pose from a six tuple. | |
Public Attributes | |
Vector3 | pos |
The position. | |
Quaternion | rot |
The rotation. | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const gazebo::math::Pose &_pose) |
Stream insertion operator. | |
std::istream & | operator>> (std::istream &_in, gazebo::math::Pose &_pose) |
Stream extraction operator. | |
Encapsulates a position and rotation in three space.
gazebo::math::Pose::Pose | ( | ) |
Default constructors.
Referenced by operator-().
gazebo::math::Pose::Pose | ( | const Vector3 & | _pos, |
const Quaternion & | _rot | ||
) |
Constructor.
pos | A position |
rot | A rotation |
gazebo::math::Pose::Pose | ( | double | _x, |
double | _y, | ||
double | _z, | ||
double | _roll, | ||
double | _pitch, | ||
double | _yaw | ||
) |
Constructor.
|
virtual |
Destructor.
Find the inverse of a pose; i.e., if b = this + a, given b and this, find a.
[in] | _b | the other pose |
Add one point to a vector: result = this + pos.
[in] | pos | Position to add to this pose |
Add one point to another: result = this + pose.
[in] | _pose | The Pose to add |
Subtract one position from another: result = this - pose.
[in] | _pose | Pose to subtract |
References gazebo::math::Quaternion::GetInverse(), pos, rot, gazebo::math::Vector3::x, gazebo::math::Quaternion::x, gazebo::math::Vector3::y, gazebo::math::Quaternion::y, gazebo::math::Vector3::z, and gazebo::math::Quaternion::z.
Referenced by operator-().
Quaternion gazebo::math::Pose::CoordRotationAdd | ( | const Quaternion & | _rot | ) | const |
Add one rotation to another: result = this->rot + rot.
[in] | _rot | Rotation to add |
|
inline |
Subtract one rotation from another: result = this->rot - rot.
[in] | _rot | The rotation to subtract |
References gazebo::math::Quaternion::GetInverse(), gazebo::math::Quaternion::Normalize(), and rot.
Referenced by operator-().
|
inline |
Fix any nan values.
References gazebo::math::Vector3::Correct(), gazebo::math::Quaternion::Correct(), pos, and rot.
Pose gazebo::math::Pose::GetInverse | ( | ) | const |
Get the inverse of this pose.
bool gazebo::math::Pose::IsFinite | ( | ) | const |
See if a pose is finite (e.g., not nan)
bool gazebo::math::Pose::operator!= | ( | const Pose & | _pose | ) | const |
Multiplication operator.
[in] | _pose | the other pose |
Subtraction operator.
[in] | pose | Pose to subtract from this one |
References CoordPositionSub(), CoordRotationSub(), Pose(), and rot.
bool gazebo::math::Pose::operator== | ( | const Pose & | _pose | ) | const |
void gazebo::math::Pose::Reset | ( | ) |
Reset the pose.
Pose gazebo::math::Pose::RotatePositionAboutOrigin | ( | const Quaternion & | _rot | ) | const |
Rotate vector part of a pose about the origin.
[in] | _rot | rotation |
void gazebo::math::Pose::Round | ( | int | _precision | ) |
Round all values to _precision decimal places.
[in] | _precision |
void gazebo::math::Pose::Set | ( | const Vector3 & | _pos, |
const Quaternion & | _rot | ||
) |
Set the pose from a Vector3 and a Quaternion.
[in] | _pos | The position. |
[in] | _rot | The rotation. |
void gazebo::math::Pose::Set | ( | double | _x, |
double | _y, | ||
double | _z, | ||
double | _roll, | ||
double | _pitch, | ||
double | _yaw | ||
) |
Set the pose from a six tuple.
[in] | _x | x position in meters. |
[in] | _y | y position in meters. |
[in] | _z | z position in meters. |
[in] | _roll | Roll (rotation about X-axis) in radians. |
[in] | _pitch | Pitch (rotation about y-axis) in radians. |
[in] | _yaw | Pitch (rotation about z-axis) in radians. |
|
friend |
Stream insertion operator.
out | output stream |
pose | pose to output |
|
friend |
Stream extraction operator.
[in] | _in | the input stream |
[in] | _pose | the pose |
Vector3 gazebo::math::Pose::pos |
The position.
Referenced by CoordPositionSub(), and Correct().
Quaternion gazebo::math::Pose::rot |
The rotation.
Referenced by CoordPositionSub(), CoordRotationSub(), Correct(), and operator-().