Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::SpatialXform Class Reference
[Math]

This class represents a 6 by 6 spatial transformation matrix. More...

#include <SpatialXform.h>

Inheritance diagram for OSCAR::SpatialXform:

Inheritance graph
[legend]
List of all members.

Public Methods

 SpatialXform (const double *f=0, const String &name=String())
 SpatialXform (const Vector &v, OSCARError &err=DUMMY_ERROR(noError), const String &name=String())
 SpatialXform (const SpatialXform &X)
 SpatialXform (const Matrix &X)
virtual ~SpatialXform ()
bool Multiply (const SpatialXform &with, SpatialXform &result) const
bool Subtract (const SpatialXform &rhs, SpatialXform &result) const
virtual bool Inverse (SpatialXform &inverse) const
virtual SpatialXform Inverse (void) const
bool Get (Rot3by3 &R) const
bool Get (Xform &X) const
bool Get (HandPose &handpose) const
bool Get (Orientation &orient) const
bool Get (Quaternion &quat) const
SpatialXform & operator= (const SpatialXform &rhs)
SpatialXform operator * (const SpatialXform &rhs) const
SpatialXform operator- (const SpatialXform &rhs) const
SpatialXform & operator-= (const SpatialXform &rhs)
SpatialXform operator- () const
SpatialXform & operator= (const Matrix &rhs)
bool Set (const Rot3by3 &R)
bool Set (const Matrix &pXR)
bool Set (const Rot3by3 &rrt, const Vector3 &p)
bool Set (const Quaternion &q)
bool Set (const Xform &T)
bool Set (const HandPose &hp)

Detailed Description

Author:
Dinesh Rabindran
This class represents a 6 by 6 spatial transformation matrix. The matrix has the general form X = [R O; pxR R] where R is the rotation matrix from source reference frame to destination reference frame, p is the Position vector of origin of source frame in the destination frame, O is the 6 by 6 zero matrix, and x is the vector cross-product operator. Use objects of this class to transform a 6 by 1 spatial vector or screw (motor/wrench) from source frame to destination frame.


Constructor & Destructor Documentation

OSCAR::SpatialXform::SpatialXform const double *    f = 0,
const String   name = String()
[explicit]
 

Constructor.

Use this constructor to create an SpatialXform (size 6x6) and to initialize it to an array of doubles specified by *f. This constructor is used to construct a SpatialXform with an identity rotation matrix and a zero position vector. It creates a 6 by 6 diagonal matrix with diagonal element 1.0. This default transformation means that the source and destination frames are parallel and coincident. It initializes SpatialXform by using a row pattern, for example in a 4x4 matrix the first row is initialized with the first 4 values in the array *f. The array must be of size 36. Also be careful if the array f has fewer elements than the SpatialXform it results in garbage, if the array has more elements than the SpatialXform then those elements remaining are cut off.

Parameters:
f Pointer to an array of initialization values. Should be of size >= 36. By default it is 0.0.
name Name you want to assign to the SpatialXform object

OSCAR::SpatialXform::SpatialXform const Vector   v,
OSCARError   err = DUMMY_ERROR(noError),
const String   name = String()
[explicit]
 

Constructor.

Use this constructor to create an SpatialXform (size 6x6) and to initialize it to an Vector of doubles specified by *f. This constructor is used to construct a SpatialXform with an identity rotation matrix and a zero position vector. It creates a 6 by 6 diagonal matrix with diagonal element 1.0. This default transformation means that the source and destination frames are parallel and coincident. It initializes SpatialXform by using a row pattern, for example in a 4x4 matrix the first row is initialized with the first 4 values in the Vector. The Vector must be of size 36. Also be careful if the array f has fewer elements than the SpatialXform it results in garbage, if the array has more elements than the SpatialXform then those elements remaining are cut off.

Parameters:
v Pointer to an array of initialization values. Should be of size >= 36. By default it is 0.0.
err This on return will contain any error codes generated by this method
name Name you want to assign to the SpatialXform object

OSCAR::SpatialXform::SpatialXform const SpatialXform &    X
 

Constructor.

This constructor is used to construct a SpatialXform from another SpatialXform .

Parameters:
X A reference to the SpatialXform whose elements are assigned to the corresponding elements of the current SpatialXform object.

OSCAR::SpatialXform::SpatialXform const Matrix   X
 

Constructor.

This constructor is used to construct a SpatialXform from a 6x6 Matrix .

Parameters:
X A reference to the Matrix whose elements are assigned to the corresponding elements of the current SpatialXform object. If the parameter passed in is not 6x6, then there is a MatrixSizeMismatch error.

virtual OSCAR::SpatialXform::~SpatialXform   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type SpatialXform.


Member Function Documentation

bool OSCAR::SpatialXform::Get Quaternion   quat const
 

Get the quaternion representing the orientation of the source frame w.r.t the destination frame.

This method is used to get a copy of the equivalent 4 by 1 quaternion representing the orientation.

Parameters:
quat On return, quat contains the values of the four elements of the equivalent Quaternion.
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::SpatialXform::Get Orientation   orient const
 

Get the elements representing the orientation of the source frame w.r.t the destination frame.

This method is used to get the last three elements of a HandPose and the type of orientation.

Parameters:
orient On return, orient holds the values of the last three elements of the HandPose, and the orientation type of orientation is set to be the same as that of HandPose .
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::SpatialXform::Get HandPose   handpose const
 

Get the handpose from a SpatialXform.

This method is used to get the equivalent handpose from a SpatialXform.

Parameters:
handpose A reference to the 6 by 1 HandPose which stores the handpose representation.
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::SpatialXform::Get Xform   X const
 

Get the 4 by 4 transformation matrix from a SpatialXform.

This method is used to get the 4 by 4 transformation matrix from a SpatialXform.

Parameters:
X On return, X contains a reference to the 4 by 4 transformation matrix which stores the equivalent Xform.
Returns:
True always.

bool OSCAR::SpatialXform::Get Rot3by3   R const
 

Get the 3 by 3 rotation matrix part from a SpatialXform.

This method is used to get the 3 by 3 rotation matrix from a SpatialXform object.

Parameters:
R On return, R contains a reference to the extracted rotation matrix.
Returns:
True always.

virtual SpatialXform OSCAR::SpatialXform::Inverse void    const [virtual]
 

Get the Inverse for SpatialXform objects.

This method gets the inverse spatial transformation matrix from destination frame to the source frame.

Returns:
The Inverse of the SpatialXform.

virtual bool OSCAR::SpatialXform::Inverse SpatialXform &    inverse const [virtual]
 

Get the Inverse for SpatialXform objects.

This method gets the inverse spatial transformation matrix from destination frame to the source frame.

Parameters:
inverse On return, inverse contains the Inverse of the SpatialXform.
Returns:
True always.

bool OSCAR::SpatialXform::Multiply const SpatialXform &    with,
SpatialXform &    result
const
 

Multiply SpatialXform objects.

This method multiplies the calling SpatialXform object with a SpatialXform object.

Parameters:
with The SpatialXform to be multiplied with.
result On return, result will contain the result of the multiplication.
Returns:
True always.

SpatialXform OSCAR::SpatialXform::operator * const SpatialXform &    rhs const
 

Overloaded * operator.

Overloaded * operator. This operator multiplies a SpatialXform object by the calling SpatialXform object.

Parameters:
rhs A SpatialXform to be multiplied with.
Returns:
The resulting SpatialXform object.

SpatialXform OSCAR::SpatialXform::operator-   const
 

Overloaded - operator.

Overloaded - operator. This operator is used to change the sign of the calling SpatialXform object. Each element of the calling SpatialXform object is multiplied with -1.

Returns:
The resulting SpatialXform object.

Reimplemented from OSCAR::Matrix.

SpatialXform OSCAR::SpatialXform::operator- const SpatialXform &    rhs const
 

Overloaded - operator.

Overloaded - operator. This operator subtracts a SpatialXform object from the calling SpatialXform object.

Parameters:
rhs A SpatialXform object to subtract.
Returns:
The resulting SpatialXform object.

SpatialXform& OSCAR::SpatialXform::operator-= const SpatialXform &    rhs
 

Overloaded -= operator.

Overloaded -= operator. This operator subtracts a SpatialXform object from the calling SpatialXform object.

Parameters:
rhs A SpatialXform object to subtract.
Returns:
The resulting SpatialXform object.

SpatialXform& OSCAR::SpatialXform::operator= const Matrix   rhs
 

Assignment Operator.

This is the Assignment Operator for an object of type SpatialXform.

Parameters:
rhs A Matrix object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

Reimplemented from OSCAR::FixedSizeMatrix< 6, 6 >.

SpatialXform& OSCAR::SpatialXform::operator= const SpatialXform &    rhs
 

Assignment Operator.

This is the Assignment Operator for an object of type SpatialXform.

Parameters:
rhs A SpatialXform object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

bool OSCAR::SpatialXform::Set const HandPose   hp
 

Set the SpatialXform based on a handpose.

This method is used to set the SpatialXform based on a handpose. This statement forms the whole spatial transformation matrix using an equivalent handpose representation hp and stores it in X.

Parameters:
hp A HandPose object which will be used to set the SpatialXform.
Returns:
True if the method succeeds. False if an error occurs. Call GetError() to get more information.

bool OSCAR::SpatialXform::Set const Xform   T
 

Set the SpatialXform based on a homogenous transformation matrix.

This method is used to set the SpatialXform based on a homogenous tranformation matrix. This statement forms the whole spatial transformation matrix using an equivalent homogenous transformation matrix T and stores it in X.

Parameters:
T A Xform object which will be used to set the SpatialXform.
Returns:
True if the method succeeds. False if an error occurs. Call GetError() to get more information.

bool OSCAR::SpatialXform::Set const Quaternion   q
 

Set the orientation part of the SpatialXform based on a quaternion.

This method is used to set the the rotation matrix of a SpatialXform based on a quaternion. This statement sets the rotation matrix associated with X based on quaternion. (Note that the 3x3 diagonal submatrices of X are identical and are the rotation matrices).

Parameters:
q A quaternion object which will be used to set the rotation matrix.
Returns:
True if the method succeeds. False if an error occurs. Call GetError() to get more information.

bool OSCAR::SpatialXform::Set const Rot3by3   rrt,
const Vector3   p
 

Set the values for every element of the SpatialXform based on a rotation matrix and position vector.

This method is used to set the SpatialXform based on the rotation matrix and position vector passed as arguments.

Parameters:
rrt The orientation part of the SpatialXform is set to this.
p This is the position vector which is used to set the left bottom sub-matrix of the SpatialXform.
Returns:
True if the method succeeds. False if an error occurs. Call GetError() to get more information.

bool OSCAR::SpatialXform::Set const Matrix   pXR
 

Set the left bottom matrix of the SpatialXform.

This method is used to set the left bottom matrix part of the SpatialXform based on the Matrix passed as argument. This statement sets the left bottom sub-matrix of X to M. (Note that this sub-matrix is (pXR) where p is the position vector of origin of source frame in destination frame, R is the rotation matrix associated therewith and X is the vector cross-product operator).

Parameters:
pXR The left bottom sub-matrix of the SpatialXform is set to this.
Returns:
True if the method succeeds. False if an error occurs. Call GetError() to get more information.
Exceptions:
matrixSizeMismatch matrixSizeMismatch

bool OSCAR::SpatialXform::Set const Rot3by3   R
 

Set the rotation matrix of a SpatialXform object.

This method is used to set the orientation part of the SpatialXform based on the rotation matrix passed as argument .

Parameters:
R The orientation part of the SpatialXform is set to this.
Returns:
True if the method succeeds. False if an error occurs. Call GetError() to get more information.

bool OSCAR::SpatialXform::Subtract const SpatialXform &    rhs,
SpatialXform &    result
const
 

Subtract an SpatialXform object from the calling SpatialXform object.

This method is used to subtract an SpatialXform object from the calling SpatialXform object.

Parameters:
rhs The SpatialXform to subtract.
result On return, result will contain the result of the subtraction.
Returns:
True always.


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations