Drake

This class represents a rigid transform between two frames, which can be regarded in two ways. More...
#include <drake/math/transform.h>
Public Member Functions  
Transform ()  
Constructs the Transform that corresponds to aligning the two frames so unit vectors Ax = Bx, Ay = By, Az = Bz and point Ao is coincident with Bo. More...  
Transform (const RotationMatrix< T > &R, const Vector3< T > &p)  
Constructs a Transform from a rotation matrix and a position vector. More...  
Transform (const Isometry3< T > &pose)  
Constructs a Transform from an Eigen Isometry3. More...  
template<typename U >  
Transform< U >  cast () const 
Creates a Transform templatized on a scalar type U from a Transform templatized on scalar type T. More...  
const RotationMatrix< T > &  rotation () const 
Returns R_AB, the rotation matrix portion of this transform. More...  
void  set_rotation (const RotationMatrix< T > &R) 
Sets the RotationMatrix portion of this transform. More...  
const Vector3< T > &  translation () const 
Returns p_AoBo_A , the position vector portion of this transform. More...  
void  set_translation (const Vector3< T > &p) 
Sets the position vector portion of this transform. More...  
Matrix4< T >  GetAsMatrix4 () const 
Returns the 4x4 matrix associated with this Transform. More...  
Isometry3< T >  GetAsIsometry3 () const 
Returns the Isometry associated with a Transform. More...  
const Transform< T > &  SetIdentity () 
Sets this Transform so it corresponds to aligning the two frames so unit vectors Ax = Bx, Ay = By, Az = Bz and point Ao is coincident with Bo. More...  
bool  IsExactlyIdentity () const 
Returns true if this is exactly the identity transform. More...  
bool  IsIdentityToEpsilon (double translation_tolerance) const 
Returns true if this is within tolerance of the identity transform. More...  
Transform< T >  inverse () const 
Calculates X_BA = X_AB⁻¹, the inverse of this Transform. More...  
Transform< T > &  operator*= (const Transform< T > &other) 
Inplace multiply of this transform X_AB by other transform X_BC . More...  
Transform< T >  operator* (const Transform< T > &other) const 
Calculates this transform X_AB multiplied by other transform X_BC . More...  
Vector3< T >  operator* (const Vector3< T > &p_BoQ_B) const 
Calculates this transform X_AB multiplied by the position vector 'p_BoQ_B` which is from Bo (B's origin) to an arbitrary point Q. More...  
bool  IsNearlyEqualTo (const Transform< T > &other, double tolerance) const 
Compares each element of this to the corresponding element of other to check if they are the same to within a specified tolerance . More...  
T  GetMaximumAbsoluteDifference (const Transform< T > &other) const 
Computes the infinity norm of this  other (i.e., the maximum absolute value of the difference between the elements of this and other ). More...  
T  GetMaximumAbsoluteTranslationDifference (const Transform< T > &other) const 
Returns the maximum absolute value of the difference in the position vectors (translation) in this and other . More...  
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable  
Transform (const Transform &)=default  
Transform &  operator= (const Transform &)=default 
Transform (Transform &&)=default  
Transform &  operator= (Transform &&)=default 
Static Public Member Functions  
static const Transform< T > &  Identity () 
Returns the identity Transform (which corresponds to coincident frames). More...  
Friends  
template<typename U >  
class  Transform 
This class represents a rigid transform between two frames, which can be regarded in two ways.
It can be regarded as a distancepreserving linear operator (i.e., one that rotates and/or translates) which (for example) can add one position vector to another and express the result in a particular basis as p_AoQ_A = X_AB * p_BoQ_B
(Q is any point). Alternately, a rigid transform describes the pose between two frames A and B (i.e., the relative orientation and position of A to B). Herein, the terms rotation/orientation and translation/position are used interchangeably. The class stores a RotationMatrix that relates righthanded orthogonal unit vectors Ax, Ay, Az fixed in frame A to righthanded orthogonal unit vectors Bx, By, Bz fixed in frame B. The class also stores a position vector from Ao (the origin of frame A) to Bo (the origin of frame B). The position vector is expressed in frame A. The monogram notation for the transform relating frame A to B is X_AB
. The monogram notation for the rotation matrix relating A to B is R_AB
. The monogram notation for the position vector from Ao to Bo is p_AoBo_A
. See Multibody Quantities for monogram notation for dynamics.
X_AB * X_BC
, but not X_AB * X_CB
.T  The underlying scalar type. Must be a valid Eigen scalar. 

inline 
Constructs the Transform that corresponds to aligning the two frames so unit vectors Ax = Bx, Ay = By, Az = Bz and point Ao is coincident with Bo.
Hence, the constructed Transform contains an identity RotationMatrix and a zero position vector.

inline 
Constructs a Transform from a rotation matrix and a position vector.
[in]  R  rotation matrix relating frames A and B (e.g., R_AB ). 
[in]  p  position vector from frame A's origin to frame B's origin, expressed in frame A. In monogram notation p is denoted p_AoBo_A . 
Constructs a Transform from an Eigen Isometry3.
[in]  pose  Isometry3 that contains an allegedly valid rotation matrix R_AB and also contains a position vector p_AoBo_A from frame A's origin to frame B's origin. p_AoBo_A must be expressed in frame A. 
std::logic_error  in debug builds if R_AB is not a proper orthonormal 3x3 rotation matrix. 
pose
. As needed, use RotationMatrix::ProjectToRotationMatrix().

inline 
Creates a Transform templatized on a scalar type U from a Transform templatized on scalar type T.
For example,
U  Scalar type on which the returned Transform is templated. 
Transform<From>::cast<To>()
creates a new Transform<To>
from a Transform<From>
but only if type To
is constructible from type From
. This cast method works in accordance with Eigen's cast method for Eigen's objects that underlie this Transform. For example, Eigen currently allows cast from type double to AutoDiffXd, but not viceversa.

inline 
Returns the Isometry associated with a Transform.

inline 
Returns the 4x4 matrix associated with this Transform.

inline 
Computes the infinity norm of this
 other
(i.e., the maximum absolute value of the difference between the elements of this
and other
).
[in]  other  Transform to subtract from this . 
this
 other
‖∞

inline 
Returns the maximum absolute value of the difference in the position vectors (translation) in this
and other
.
In other words, returns the infinity norm of the difference in the position vectors.
[in]  other  Transform whose position vector is subtracted from the position vector in this . 

inlinestatic 
Returns the identity Transform (which corresponds to coincident frames).

inline 
Calculates X_BA = X_AB⁻¹, the inverse of this
Transform.
X_BA  = X_AB⁻¹ the inverse of this Transform. 
p_BoAo_B_
, (position from B's origin Bo to A's origin Ao, expressed in frame B).

inline 
Returns true
if this
is exactly the identity transform.
true
if this
is exactly the identity transform. Returns true if this
is within tolerance of the identity transform.
true
if the RotationMatrix portion of this
satisfies RotationMatrix::IsIdentityToInternalTolerance() and if the position vector portion of this
is equal to zero vector within translation_tolerance
. [in]  translation_tolerance  a nonnegative number. One way to choose translation_tolerance is to multiply a characteristic length (e.g., the magnitude of a characteristic position vector) by an epsilon (e.g., RotationMatrix::get_internal_tolerance_for_orthonormality()). 
Compares each element of this
to the corresponding element of other
to check if they are the same to within a specified tolerance
.
[in]  other  Transform to compare to this . 
[in]  tolerance  maximum allowable absolute difference between the elements in this and other . 
true
if ‖this.matrix()  other.matrix()‖∞ <= tolerance
. this
position vector and other
position vectors, respectively. Calculates this
transform X_AB
multiplied by other
transform X_BC
.
[in]  other  Transform that postmultiplies this . 
X_AC  = X_AB * X_BC 
Calculates this
transform X_AB
multiplied by the position vector 'p_BoQ_B` which is from Bo (B's origin) to an arbitrary point Q.
[in]  p_BoQ_B  position vector from Bo to Q, expressed in frame B. 
p_AoQ_A  position vector from Ao to Q, expressed in frame A. 
Inplace multiply of this
transform X_AB
by other
transform X_BC
.
[in]  other  Transform that postmultiplies this . 
this
transform which has been multiplied by other
. On return, this = X_AC
, where X_AC = X_AB * X_BC
.

inline 
Returns R_AB, the rotation matrix portion of this
transform.
R_AB  the rotation matrix portion of this transform. 

inline 
Sets the RotationMatrix portion of this
transform.
[in]  R  rotation matrix relating frames A and B (e.g., R_AB ). 

inline 
Sets the position vector portion of this
transform.
[in]  p  position vector from Ao (frame A's origin) to Bo (frame B's origin) expressed in frame A. In monogram notation p is denoted p_AoBo_A. 

inline 
Sets this
Transform so it corresponds to aligning the two frames so unit vectors Ax = Bx, Ay = By, Az = Bz and point Ao is coincident with Bo.
Hence, this
Transform contains a 3x3 identity matrix and a zero position vector.

inline 
Returns p_AoBo_A
, the position vector portion of this
transform.
p_AoBo_A  the position vector portion of this transform, i.e., the position vector from Ao (frame A's origin) to Bo (frame B's origin). 

friend 