Ravelin
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TRANSFORM3 Class Reference

A transformation between two rigid body poses. More...

#include <Transform3.h>

Public Member Functions

 TRANSFORM3 ()
 Default constructor. More...
 
 TRANSFORM3 (const TRANSFORM3 &source)
 
 TRANSFORM3 (const AANGLE &a)
 Constructs a transformation from a axis-angle representation (for rotation) and zero translation.
 
 TRANSFORM3 (const MATRIX3 &m)
 Constructs a transformation from a rotation matrix and zero translation.
 
 TRANSFORM3 (const QUAT &q)
 Constructs a transformation from a unit quaternion (for rotation) and zero translation.
 
 TRANSFORM3 (const AANGLE &a, const ORIGIN3 &v)
 Constructs a transformation from a axis-angle representation and a translation vector.
 
 TRANSFORM3 (const MATRIX3 &m, const ORIGIN3 &v)
 Constructs a transformation from a rotation matrix and translation vector.
 
 TRANSFORM3 (const QUAT &q, const ORIGIN3 &v)
 Constructs a transformation from a unit quaternion and translation vector.
 
 TRANSFORM3 (const ORIGIN3 &v)
 Constructs a transformation using identity orientation and a translation vector.
 
bool is_identity () const
 Determines whether the transform is identity.
 
POSE3 transform (const POSE3 &p) const
 Transforms a pose.
 
POSE3 inverse_transform (const POSE3 &p) const
 Transforms a pose.
 
VECTOR3 transform_point (const VECTOR3 &p) const
 Transforms a point from one pose to another.
 
VECTOR3 transform_vector (const VECTOR3 &v) const
 Transforms a vector from one pose to another.
 
VECTOR3 inverse_transform_point (const VECTOR3 &p) const
 Transforms a point from one pose to another.
 
VECTOR3 inverse_transform_vector (const VECTOR3 &v) const
 Transforms a vector from one pose to another.
 
SFORCE transform (const SFORCE &w) const
 Transforms a force from one pose to another.
 
SFORCE inverse_transform (const SFORCE &w) const
 Transforms a force from one pose to another.
 
SMOMENTUM transform (const SMOMENTUM &t) const
 Transforms a momentum from one pose to another.
 
SMOMENTUM inverse_transform (const SMOMENTUM &t) const
 Transforms a momentum from one pose to another.
 
SVELOCITY transform (const SVELOCITY &t) const
 Transforms a velocity from one pose to another.
 
SVELOCITY inverse_transform (const SVELOCITY &t) const
 Transforms a velocity from one pose to another.
 
SACCEL transform (const SACCEL &t) const
 Transforms an acceleration from one pose to another.
 
SACCEL inverse_transform (const SACCEL &t) const
 Transforms an acceleration from one pose to another.
 
SPATIAL_RB_INERTIA transform (const SPATIAL_RB_INERTIA &j) const
 Transforms a rigid body inertia from one pose to another. More...
 
SPATIAL_RB_INERTIA inverse_transform (const SPATIAL_RB_INERTIA &j) const
 Transforms a rigid body inertia from one pose to another.
 
SPATIAL_AB_INERTIA transform (const SPATIAL_AB_INERTIA &j) const
 Transforms an articulated body inertia from one pose to another.
 
SPATIAL_AB_INERTIA inverse_transform (const SPATIAL_AB_INERTIA &j) const
 Transforms an articulated body inertia from one pose to another.
 
TRANSFORM3set_identity ()
 Sets this matrix to identity.
 
TRANSFORM3invert ()
 Special method for inverting a transformation in place.
 
TRANSFORM3 inverse () const
 
TRANSFORM3set (const AANGLE &a)
 Sets this transformation from a axis-angle object only (translation will be zero'd)
 
TRANSFORM3set (const MATRIX3 &m)
 Sets this transformation from a 3x3 rotation matrix only (translation will be zero'd)
 
TRANSFORM3set (const QUAT &q)
 Sets this transformation from a unit quaternion only (translation will be zero'd)
 
TRANSFORM3set (const AANGLE &a, const ORIGIN3 &v)
 
TRANSFORM3set (const MATRIX3 &m, const ORIGIN3 &v)
 Sets the transformation from a rotation matrix and translation vector. More...
 
TRANSFORM3set (const QUAT &q, const ORIGIN3 &v)
 Sets the transformation from a unit quaternion and translation vector.
 
TRANSFORM3operator= (const TRANSFORM3 &source)
 
TRANSFORM3 operator* (const TRANSFORM3 &m) const
 Multiplies this transformation by another. More...
 
POSE3 apply_transform () const
 Applies a transform to a pose. More...
 
POSE3 apply_inverse_transform () const
 Applies the inverse transform to a pose. More...
 

Static Public Member Functions

static ORIGIN3 interpolate_transform_vector (const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
 Tranforms a vector with an interpolated transform (between transforms T1 and T2) More...
 
static ORIGIN3 interpolate_transform_point (const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
 Tranforms a point with an interpolated pose (between poses T1 and T2) More...
 
static ORIGIN3 interpolate_inverse_transform_vector (const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
 Tranforms a vector with the inverse of an interpolated transform (between transforms T1 and T2) More...
 
static ORIGIN3 interpolate_inverse_transform_point (const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
 Tranforms a point with the inverse of an interpolated pose (between poses T1 and T2) More...
 
static TRANSFORM3 identity ()
 
static bool rel_equal (const TRANSFORM3 &p1, const TRANSFORM3 &p2, REAL tol=EPS)
 Determines whether two transformations in 3D are relatively equivalent.
 
static TRANSFORM3 invert (const TRANSFORM3 &m)
 Special method for inverting a transformation.
 

Public Attributes

QUAT q
 the relative orientation
 
ORIGIN3 x
 the relative origin
 
boost::shared_ptr< const POSE3source
 the "source" pose
 
boost::shared_ptr< const POSE3target
 the "target" pose
 

Detailed Description

A transformation between two rigid body poses.

Constructor & Destructor Documentation

TRANSFORM3::TRANSFORM3 ( )

Default constructor.

Sets matrix to the identity matrix

References set_identity().

Referenced by invert().

Member Function Documentation

POSE3 TRANSFORM3::apply_inverse_transform ( ) const

Applies the inverse transform to a pose.

This transforms from the source pose to the target pose. If the target pose changes to become P, we can apply this transform to P to get the new source pose.

References q, POSE3::q, POSE3::rpose, source, target, x, and POSE3::x.

POSE3 TRANSFORM3::apply_transform ( ) const

Applies a transform to a pose.

This transforms from the source pose to the target pose. If the source pose changes to become P, we can apply this transform to P to get the new target pose.

References q, POSE3::q, POSE3::rpose, source, target, x, and POSE3::x.

ORIGIN3 TRANSFORM3::interpolate_inverse_transform_point ( const TRANSFORM3 T1,
const TRANSFORM3 T2,
REAL  t,
const ORIGIN3 o 
)
static

Tranforms a point with the inverse of an interpolated pose (between poses T1 and T2)

Parameters
T1the pose to use when t=0
T2the pose to use when t=1
tinterpolation value
othe point to transform
Returns
the transformed point

References QUAT::invert(), q, QUAT::slerp(), and x.

ORIGIN3 TRANSFORM3::interpolate_inverse_transform_vector ( const TRANSFORM3 T1,
const TRANSFORM3 T2,
REAL  t,
const ORIGIN3 o 
)
static

Tranforms a vector with the inverse of an interpolated transform (between transforms T1 and T2)

Parameters
T1the pose to use when t=0
T2the pose to use when t=1
tinterpolation value
othe vector to transform
Returns
the transformed vector

References QUAT::invert(), q, and QUAT::slerp().

ORIGIN3 TRANSFORM3::interpolate_transform_point ( const TRANSFORM3 T1,
const TRANSFORM3 T2,
REAL  t,
const ORIGIN3 o 
)
static

Tranforms a point with an interpolated pose (between poses T1 and T2)

Parameters
T1the pose to use when t=0
T2the pose to use when t=1
tinterpolation value
othe point to transform
Returns
the transformed point

References q, QUAT::slerp(), and x.

ORIGIN3 TRANSFORM3::interpolate_transform_vector ( const TRANSFORM3 T1,
const TRANSFORM3 T2,
REAL  t,
const ORIGIN3 o 
)
static

Tranforms a vector with an interpolated transform (between transforms T1 and T2)

Parameters
T1the pose to use when t=0
T2the pose to use when t=1
tinterpolation value
othe vector to transform
Returns
the transformed vector

References q, and QUAT::slerp().

TRANSFORM3 TRANSFORM3::operator* ( const TRANSFORM3 T) const

Multiplies this transformation by another.

If this transforms from frame b to frame c and T transforms from frame a to frame b, the multiplication transforms from from a to frame c.

References q, source, target, and x.

TRANSFORM3 & TRANSFORM3::set ( const AANGLE a,
const ORIGIN3 v 
)
Todo:
make this marginally faster by setting the matrix components directly (eliminates redundancy in setting non-rotation and non-translational components)

References q, and x.

TRANSFORM3 & TRANSFORM3::set ( const MATRIX3 m,
const ORIGIN3 v 
)

Sets the transformation from a rotation matrix and translation vector.

Todo:
make this marginally faster by setting the matrix components directly (eliminates redundancy in setting non-rotation and non-translational components)

References q, and x.

SPATIAL_RB_INERTIA TRANSFORM3::transform ( const SPATIAL_RB_INERTIA J) const

Transforms a rigid body inertia from one pose to another.

The operations for this come from: | E 0 | * | -m*hx eye(3)*m | * | E' 0 | | -E*rx E | | J - m*hx*hx m*hx | | rx*E' E' | which yields: | A m | | B A' | where: A = -m*E*hx*E' + m*E*rx*E' B = m*E*rx*hx*E' + E*J*E' - m*E*hx*hx*E' - m*E*rx*rx*E' + m*E*hx*rx*E'

References SPATIAL_RB_INERTIA::h, SPATIAL_RB_INERTIA::J, SPATIAL_RB_INERTIA::m, SPATIAL_RB_INERTIA::pose, q, source, target, MATRIX3::transpose(), MATRIX3::transpose_mult(), and x.


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