All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
gazebo::math::Pose Class Reference

Encapsulates a position and rotation in three space. More...

#include <math/gzmath.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 Poseoperator+= (const Pose &_pose)
 Add-Equals operator.
 
Pose operator- (const Pose &_pose) const
 Subtraction operator.
 
const Poseoperator-= (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.
 

Static Public Attributes

static const Pose Zero
 math::Pose(0, 0, 0, 0, 0, 0)
 

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.
 

Detailed Description

Encapsulates a position and rotation in three space.

Constructor & Destructor Documentation

gazebo::math::Pose::Pose ( )

Default constructors.

Referenced by operator-().

gazebo::math::Pose::Pose ( const Vector3 _pos,
const Quaternion _rot 
)

Constructor.

Parameters
[in]_posA position
[in]_rotA rotation
gazebo::math::Pose::Pose ( double  _x,
double  _y,
double  _z,
double  _roll,
double  _pitch,
double  _yaw 
)

Constructor.

Parameters
[in]_xx position in meters.
[in]_yy position in meters.
[in]_zz position in meters.
[in]_rollRoll (rotation about X-axis) in radians.
[in]_pitchPitch (rotation about y-axis) in radians.
[in]_yawYaw (rotation about z-axis) in radians.
gazebo::math::Pose::Pose ( const Pose _pose)

Copy constructor.

Parameters
[in]_posePose to copy
virtual gazebo::math::Pose::~Pose ( )
virtual

Destructor.

Member Function Documentation

Pose gazebo::math::Pose::CoordPoseSolve ( const Pose _b) const

Find the inverse of a pose; i.e., if b = this + a, given b and this, find a.

Parameters
[in]_bthe other pose
Vector3 gazebo::math::Pose::CoordPositionAdd ( const Vector3 _pos) const

Add one point to a vector: result = this + pos.

Parameters
[in]_posPosition to add to this pose
Returns
the resulting position
Vector3 gazebo::math::Pose::CoordPositionAdd ( const Pose _pose) const

Add one point to another: result = this + pose.

Parameters
[in]_poseThe Pose to add
Returns
The resulting position
Vector3 gazebo::math::Pose::CoordPositionSub ( const Pose _pose) const
inline

Subtract one position from another: result = this - pose.

Parameters
[in]_posePose to subtract
Returns
The resulting position

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.

Parameters
[in]_rotRotation to add
Returns
The resulting rotation
Quaternion gazebo::math::Pose::CoordRotationSub ( const Quaternion _rot) const
inline

Subtract one rotation from another: result = this->rot - rot.

Parameters
[in]_rotThe rotation to subtract
Returns
The resulting rotation

References gazebo::math::Quaternion::GetInverse(), gazebo::math::Quaternion::Normalize(), and rot.

Referenced by operator-().

void gazebo::math::Pose::Correct ( )
inline
Pose gazebo::math::Pose::GetInverse ( ) const

Get the inverse of this pose.

Returns
the inverse 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

Inequality operator.

Parameters
[in]_posePose for comparison
Returns
True if not equal
Pose gazebo::math::Pose::operator* ( const Pose _pose)

Multiplication operator.

Parameters
[in]_posethe other pose
Returns
itself
Pose gazebo::math::Pose::operator+ ( const Pose _pose) const

Addition operator.

Parameters
[in]_posePose to add to this pose
Returns
The resulting pose
const Pose& gazebo::math::Pose::operator+= ( const Pose _pose)

Add-Equals operator.

Parameters
[in]_posePose to add to this pose
Returns
The resulting pose
Pose gazebo::math::Pose::operator- ( const Pose _pose) const
inline

Subtraction operator.

Parameters
[in]_posePose to subtract from this one
Returns
The resulting pose

References CoordPositionSub(), CoordRotationSub(), Pose(), and rot.

const Pose& gazebo::math::Pose::operator-= ( const Pose _pose)

Subtraction operator.

Parameters
[in]_posePose to subtract from this one
Returns
The resulting pose
bool gazebo::math::Pose::operator== ( const Pose _pose) const

Equality operator.

Parameters
[in]_posePose for comparison
Returns
True if equal
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.

Parameters
[in]_rotrotation
Returns
the rotated pose
void gazebo::math::Pose::Round ( int  _precision)

Round all values to _precision decimal places.

Parameters
[in]_precision
void gazebo::math::Pose::Set ( const Vector3 _pos,
const Quaternion _rot 
)

Set the pose from a Vector3 and a Quaternion.

Parameters
[in]_posThe position.
[in]_rotThe 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.

Parameters
[in]_xx position in meters.
[in]_yy position in meters.
[in]_zz position in meters.
[in]_rollRoll (rotation about X-axis) in radians.
[in]_pitchPitch (rotation about y-axis) in radians.
[in]_yawPitch (rotation about z-axis) in radians.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::math::Pose _pose 
)
friend

Stream insertion operator.

Parameters
[in]_outoutput stream
[in]_posepose to output
Returns
the stream
std::istream& operator>> ( std::istream &  _in,
gazebo::math::Pose _pose 
)
friend

Stream extraction operator.

Parameters
[in]_inthe input stream
[in]_posethe pose
Returns
the stream

Member Data Documentation

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-().

const Pose gazebo::math::Pose::Zero
static

math::Pose(0, 0, 0, 0, 0, 0)


The documentation for this class was generated from the following file: