 # Ignition Math

## API Reference

6.10.0
Pose3< T > Class Template Reference

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

#include <ignition/math/Pose3.hh>

## Public Member Functions

Pose3 ()
Default constructors. More...

Pose3 (const Vector3< T > &_pos, const Quaternion< T > &_rot)
Constructor. More...

Pose3 (T _x, T _y, T _z, T _roll, T _pitch, T _yaw)
Constructor. More...

Pose3 (T _x, T _y, T _z, T _qw, T _qx, T _qy, T _qz)
Constructor. More...

Pose3 (const Pose3< T > &_pose)
Copy constructor. More...

virtual ~Pose3 ()
Destructor. More...

Pose3< T > CoordPoseSolve (const Pose3< T > &_b) const
Find the inverse of a pose; i.e., if b = this + a, given b and this, find a. More...

Vector3< T > CoordPositionAdd (const Vector3< T > &_pos) const
Add one point to a vector: result = this + pos. More...

Vector3< T > CoordPositionAdd (const Pose3< T > &_pose) const
Add one point to another: result = this + pose. More...

Vector3< T > CoordPositionSub (const Pose3< T > &_pose) const
Subtract one position from another: result = this - pose. More...

Quaternion< T > CoordRotationAdd (const Quaternion< T > &_rot) const
Add one rotation to another: result = this->q + rot. More...

Quaternion< T > CoordRotationSub (const Quaternion< T > &_rot) const
Subtract one rotation from another: result = this->q - rot. More...

void Correct ()
Fix any nan values. More...

Pose3< T > Inverse () const
Get the inverse of this pose. More...

bool IsFinite () const
See if a pose is finite (e.g., not nan) More...

bool operator!= (const Pose3< T > &_pose) const
Inequality operator. More...

Pose3< T > operator* (const Pose3< T > &_pose) const
Multiplication operator. Given X_OP (frame P relative to O) and X_PQ (frame Q relative to P) then X_OQ = X_OP * X_PQ (frame Q relative to O). More...

const Pose3< T > & operator*= (const Pose3< T > &_pose)
Multiplication assignment operator. This pose will become equal to this * _pose. More...

Pose3< T > operator+ (const Pose3< T > &_pose) const
Addition operator A is the transform from O to P specified in frame O B is the transform from P to Q specified in frame P then, B + A is the transform from O to Q specified in frame O. More...

const Pose3< T > & operator+= (const Pose3< T > &_pose)

Pose3< T > operator- () const
Negation operator A is the transform from O to P in frame O then -A is transform from P to O specified in frame P. More...

Pose3< T > operator- (const Pose3< T > &_pose) const
Subtraction operator A is the transform from O to P in frame O B is the transform from O to Q in frame O B - A is the transform from P to Q in frame P. More...

const Pose3< T > & operator-= (const Pose3< T > &_pose)
Subtraction operator. More...

Pose3< T > & operator= (const Pose3< T > &_pose)
Assignment operator. More...

bool operator== (const Pose3< T > &_pose) const
Equality operator. More...

const T Pitch () const
Get the Pitch value of the rotation. More...

const Vector3< T > & Pos () const
Get the position. More...

Vector3< T > & Pos ()
Get a mutable reference to the position. More...

void Reset ()
Reset the pose. More...

const T Roll () const
Get the Roll value of the rotation. More...

const Quaternion< T > & Rot () const
Get the rotation. More...

Quaternion< T > & Rot ()
Get a mutuable reference to the rotation. More...

Pose3< T > RotatePositionAboutOrigin (const Quaternion< T > &_q) const
Rotate vector part of a pose about the origin. More...

void Round (int _precision)
Round all values to _precision decimal places. More...

void Set (const Vector3< T > &_pos, const Quaternion< T > &_rot)
Set the pose from a Vector3 and a Quaternion<T> More...

void Set (const Vector3< T > &_pos, const Vector3< T > &_rpy)
Set the pose from pos and rpy vectors. More...

void Set (T _x, T _y, T _z, T _roll, T _pitch, T _yaw)
Set the pose from a six tuple. More...

void SetX (T x)
Set X value of the position. More...

void SetY (T y)
Set the Y value of the position. More...

void SetZ (T z)
Set the Z value of the position. More...

const T X () const
Get the X value of the position. More...

const T Y () const
Get the Y value of the position. More...

const T Yaw () const
Get the Yaw value of the rotation. More...

const T Z () const
Get the Z value of the position. More...

## Static Public Attributes

static const Pose3< T > Zero
math::Pose3<T>(0, 0, 0, 0, 0, 0) More...

## Friends

std::ostreamoperator<< (std::ostream &_out, const Pose3< T > &_pose)
Stream insertion operator. More...

std::istreamoperator>> (std::istream &_in, Pose3< T > &_pose)
Stream extraction operator. More...

## Detailed Description

### template<typename T> class ignition::math::Pose3< T >

Encapsulates a position and rotation in three space.

## ◆ Pose3() [1/5]

 Pose3 ( )
inline

Default constructors.

## ◆ Pose3() [2/5]

 Pose3 ( const Vector3< T > & _pos, const Quaternion< T > & _rot )
inline

Constructor.

Parameters
 [in] _pos A position [in] _rot A rotation

## ◆ Pose3() [3/5]

 Pose3 ( T _x, T _y, T _z, T _roll, T _pitch, T _yaw )
inline

Constructor.

Parameters
 [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 Yaw (rotation about z-axis) in radians.

## ◆ Pose3() [4/5]

 Pose3 ( T _x, T _y, T _z, T _qw, T _qx, T _qy, T _qz )
inline

Constructor.

Parameters
 [in] _x x position in meters. [in] _y y position in meters. [in] _z z position in meters. [in] _qw Quaternion w value. [in] _qx Quaternion x value. [in] _qy Quaternion y value. [in] _qz Quaternion z value.

## ◆ Pose3() [5/5]

 Pose3 ( const Pose3< T > & _pose )
inline

Copy constructor.

Parameters
 [in] _pose Pose3 to copy

## ◆ ~Pose3()

 virtual ~Pose3 ( )
inlinevirtual

Destructor.

## ◆ CoordPoseSolve()

 Pose3 CoordPoseSolve ( const Pose3< T > & _b ) const
inline

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

Parameters
 [in] _b the other pose

References Quaternion< T >::X(), Quaternion< T >::Y(), and Quaternion< T >::Z().

## ◆ CoordPositionAdd() [1/2]

 Vector3 CoordPositionAdd ( const Vector3< T > & _pos ) const
inline

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

Parameters
 [in] _pos Position to add to this pose
Returns
the resulting position

Referenced by Pose3< T >::operator*(), Pose3< T >::operator+(), and Pose3< T >::operator+=().

## ◆ CoordPositionAdd() [2/2]

 Vector3 CoordPositionAdd ( const Pose3< T > & _pose ) const
inline

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

Parameters
 [in] _pose The Pose3 to add
Returns
The resulting position

References Quaternion< T >::X(), Quaternion< T >::Y(), and Quaternion< T >::Z().

## ◆ CoordPositionSub()

 Vector3 CoordPositionSub ( const Pose3< T > & _pose ) const
inline

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

Parameters
 [in] _pose Pose3 to subtract
Returns
The resulting position

References Quaternion< T >::X(), Quaternion< T >::Y(), and Quaternion< T >::Z().

Referenced by Pose3< T >::operator-(), and Pose3< T >::operator-=().

 Quaternion CoordRotationAdd ( const Quaternion< T > & _rot ) const
inline

Add one rotation to another: result = this->q + rot.

Parameters
 [in] _rot Rotation to add
Returns
The resulting rotation

Referenced by Pose3< T >::operator+(), and Pose3< T >::operator+=().

## ◆ CoordRotationSub()

 Quaternion CoordRotationSub ( const Quaternion< T > & _rot ) const
inline

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

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

References Quaternion< T >::Inverse(), and Quaternion< T >::Normalize().

Referenced by Pose3< T >::operator-(), and Pose3< T >::operator-=().

## ◆ Correct()

 void Correct ( )
inline

Fix any nan values.

## ◆ Inverse()

 Pose3 Inverse ( ) const
inline

Get the inverse of this pose.

Returns
the inverse pose

## ◆ IsFinite()

 bool IsFinite ( ) const
inline

See if a pose is finite (e.g., not nan)

## ◆ operator!=()

 bool operator!= ( const Pose3< T > & _pose ) const
inline

Inequality operator.

Parameters
 [in] _pose Pose3 for comparison
Returns
True if not equal

## ◆ operator*()

 Pose3 operator* ( const Pose3< T > & _pose ) const
inline

Multiplication operator. Given X_OP (frame P relative to O) and X_PQ (frame Q relative to P) then X_OQ = X_OP * X_PQ (frame Q relative to O).

Parameters
 [in] _pose The pose to multiply by.
Returns
The resulting pose.

References Pose3< T >::CoordPositionAdd().

## ◆ operator*=()

 const Pose3& operator*= ( const Pose3< T > & _pose )
inline

Multiplication assignment operator. This pose will become equal to this * _pose.

Parameters
 [in] _pose Pose3 to multiply to this pose
Returns
The resulting pose

## ◆ operator+()

 Pose3 operator+ ( const Pose3< T > & _pose ) const
inline

Addition operator A is the transform from O to P specified in frame O B is the transform from P to Q specified in frame P then, B + A is the transform from O to Q specified in frame O.

Parameters
 [in] _pose Pose3 to add to this pose
Returns
The resulting pose

References Pose3< T >::CoordPositionAdd(), and Pose3< T >::CoordRotationAdd().

## ◆ operator+=()

 const Pose3& operator+= ( const Pose3< T > & _pose )
inline

Parameters
 [in] _pose Pose3 to add to this pose
Returns
The resulting pose

References Pose3< T >::CoordPositionAdd(), and Pose3< T >::CoordRotationAdd().

## ◆ operator-() [1/2]

 Pose3 operator- ( ) const
inline

Negation operator A is the transform from O to P in frame O then -A is transform from P to O specified in frame P.

Returns
The resulting pose

## ◆ operator-() [2/2]

 Pose3 operator- ( const Pose3< T > & _pose ) const
inline

Subtraction operator A is the transform from O to P in frame O B is the transform from O to Q in frame O B - A is the transform from P to Q in frame P.

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

References Pose3< T >::CoordPositionSub(), and Pose3< T >::CoordRotationSub().

## ◆ operator-=()

 const Pose3& operator-= ( const Pose3< T > & _pose )
inline

Subtraction operator.

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

References Pose3< T >::CoordPositionSub(), and Pose3< T >::CoordRotationSub().

## ◆ operator=()

 Pose3& operator= ( const Pose3< T > & _pose )
inline

Assignment operator.

Parameters
 [in] _pose Pose3 to copy

## ◆ operator==()

 bool operator== ( const Pose3< T > & _pose ) const
inline

Equality operator.

Parameters
 [in] _pose Pose3 for comparison
Returns
True if equal

## ◆ Pitch()

 const T Pitch ( ) const
inline

Get the Pitch value of the rotation.

Returns
Pitch value of the orientation.
Note
The return is made by value since Quaternion<T>.Pitch() is already a reference.

## ◆ Pos() [1/2]

 const Vector3& Pos ( ) const
inline

Get the position.

Returns
Origin of the pose.

Referenced by ignition::math::eigen3::convert(), and Matrix4< T >::Matrix4().

## ◆ Pos() [2/2]

 Vector3& Pos ( )
inline

Get a mutable reference to the position.

Returns
Origin of the pose.

## ◆ Reset()

 void Reset ( )
inline

Reset the pose.

## ◆ Roll()

 const T Roll ( ) const
inline

Get the Roll value of the rotation.

Returns
Roll value of the orientation.
Note
The return is made by value since Quaternion<T>.Roll() is already a reference.

## ◆ Rot() [1/2]

 const Quaternion& Rot ( ) const
inline

Get the rotation.

Returns
Quaternion representation of the rotation.

## ◆ Rot() [2/2]

 Quaternion& Rot ( )
inline

Get a mutuable reference to the rotation.

Returns
Quaternion representation of the rotation.

 Pose3 RotatePositionAboutOrigin ( const Quaternion< T > & _q ) const
inline

Rotate vector part of a pose about the origin.

Parameters
 [in] _q rotation
Returns
the rotated pose

## ◆ Round()

 void Round ( int _precision )
inline

Round all values to _precision decimal places.

Parameters
 [in] _precision

## ◆ Set() [1/3]

 void Set ( const Vector3< T > & _pos, const Quaternion< T > & _rot )
inline

Set the pose from a Vector3 and a Quaternion<T>

Parameters
 [in] _pos The position. [in] _rot The rotation.

## ◆ Set() [2/3]

 void Set ( const Vector3< T > & _pos, const Vector3< T > & _rpy )
inline

Set the pose from pos and rpy vectors.

Parameters
 [in] _pos The position. [in] _rpy The rotation expressed as Euler angles.

## ◆ Set() [3/3]

 void Set ( T _x, T _y, T _z, T _roll, T _pitch, T _yaw )
inline

Set the pose from a six tuple.

Parameters
 [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.

## ◆ SetX()

 void SetX ( T x )
inline

Set X value of the position.

## ◆ SetY()

 void SetY ( T y )
inline

Set the Y value of the position.

## ◆ SetZ()

 void SetZ ( T z )
inline

Set the Z value of the position.

## ◆ X()

 const T X ( ) const
inline

Get the X value of the position.

Returns
Value X of the origin of the pose.
Note
The return is made by value since Vector3<T>.X() is already a reference.

## ◆ Y()

 const T Y ( ) const
inline

Get the Y value of the position.

Returns
Value Y of the origin of the pose.
Note
The return is made by value since Vector3<T>.Y() is already a reference.

## ◆ Yaw()

 const T Yaw ( ) const
inline

Get the Yaw value of the rotation.

Returns
Yaw value of the orientation.
Note
The return is made by value since Quaternion<T>.Yaw() is already a reference.

## ◆ Z()

 const T Z ( ) const
inline

Get the Z value of the position.

Returns
Value Z of the origin of the pose.
Note
The return is made by value since Vector3<T>.Z() is already a reference.

## ◆ operator<<

 std::ostream& operator<< ( std::ostream & _out, const Pose3< T > & _pose )
friend

Stream insertion operator.

Parameters
 [in] _out output stream [in] _pose pose to output
Returns
the stream

## ◆ operator>>

 std::istream& operator>> ( std::istream & _in, Pose3< T > & _pose )
friend

Stream extraction operator.

Parameters
 [in] _in the input stream [in] _pose the pose
Returns
the stream

## ◆ Zero

 const Pose3< T > Zero
static

math::Pose3<T>(0, 0, 0, 0, 0, 0)

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