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

OSCAR::Rot3by3 Class Reference
[Math]

This class is used to represent a 3x3 rotation matrix. More...

#include <Rot3by3.h>

Inheritance diagram for OSCAR::Rot3by3:

Inheritance graph
[legend]
List of all members.

Public Methods

 Rot3by3 ()
 Rot3by3 (const double *f, const String &name=String())
 Rot3by3 (const Vector &v, OSCARError &err=DUMMY_ERROR(noError), const String &name=String())
 Rot3by3 (const Rot3by3 &rhs)
 Rot3by3 (const Matrix &rhs)
virtual ~Rot3by3 ()
Rot3by3 & operator= (const Rot3by3 &rhs)
Rot3by3 & operator= (const Matrix &rhs)
bool Get (Orientation &orient) const
bool Get (Xform &xf) const
bool Get (SpatialXform &spatial) const
bool Get (Quaternion &quat)
bool Get (HandPose &hp) const
bool Get (Vector3 &axis, double &angle, AngleUnits angUnits=Radians) const
bool Set (const Orientation &orient)
bool Set (const Xform &xf)
bool Set (const SpatialXform &spatial)
bool Set (const Quaternion &quat)
bool Set (const HandPose &hp)
bool Set (const Vector3D &axis, double angle, AngleUnits angUnits=Radians)
Rot3by3 operator * (const Rot3by3 &rhs) const
Vector3 operator * (const Vector3 &rhs) const
Rot3by3 t () const
void t (Rot3by3 &transpose) const
void MultiplyWithTranspose (Rot3by3 &rrt) const
Rot3by3 operator- () const
bool ToPumaOAT (Vector3 &end_orient) const
bool IsValid () const
bool Normalize ()

Protected Methods

bool toEulerXYZ (Orientation &end_orient) const
bool toEulerZYZ (Orientation &end_orient) const
bool toFixedXYZ (Orientation &end_orient) const

Detailed Description

Author:
Chetan Kapoor.
This class is used to represent a 3x3 proper rotation matrix. Rotation matrices are common way of representing orientations in space and have the following properties: -- Vector multiplication preserves length: norm(vect) = norm(matR3 * vect) -- Rotation matrix's transpose is it's inverse: matR3^-1 = matR3^t (transpose) -- matR3*matR3^t = I -- Closed under multiplication, but not addition, i.e. the product of to rotation matrices is another rotation matrix, but the addition is not necessarily a rotation matrix. -- determinant(matR3) = 1 In this class there are methods of converting to other types of spatial orientations, which don't always have a 1-to-1 mapping, e.g. HandPose hp1, hp2 can yeild the same Rot3by3, but hp1 != hp2.


Constructor & Destructor Documentation

OSCAR::Rot3by3::Rot3by3  
 

Constructor.

Creates a 3x3 Rot3by3 initialized it to identity

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

Constructor.

Creates a 3x3 Rot3by3 initialized by an array of doubles, f. This constructor has two behaviors: -- f == 0 (Default): Constructs an identity matrix. -- f != 0: Constructs a matrix from the first 9 values of f using a row pattern. The first row is initialized with the first 3 values in the array f. Behavior is not defined if f contains fewer than 9 elements. USE THIS BEHAVIOR WITH CARE, as the constructor does not check values in the array to ensure the properties of a rotation matrix are preserved.

Parameters:
f Array of >=9 initialization values (default: NULL/0)
name Name you want to assign to the Rot3by3 object

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

Constructor.

Creates a 3x3 Rot3by3 initialized with first 9 elements from an Vector using a row pattern, i.e. the first row is the first 3 elements of the Vector. If the Vector has fewer than 9 elements than the Rot3by3 an OSCARError is set. USE THIS CONSTRUCTOR WITH CARE, as the constructor does not check values in the Vector to ensure the properties of a rotation matrix are preserved.

Parameters:
v Vector of initialization values, size >= 9.
err This on return will contain any error codes generated by this method
name Name you want to assign to the Rot3by3 object
Exceptions:
arraySizeMismatch arraySizeMismatch Vector::size != nRows*nCols.

OSCAR::Rot3by3::Rot3by3 const Rot3by3 &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type Rot3by3. Use this to construct an Rot3by3 object from an existing Rot3by3 object.

Parameters:
rhs An Rot3by3 object that will be used to initialize this new object.

OSCAR::Rot3by3::Rot3by3 const Matrix   rhs [explicit]
 

Copy Constructor.

Constructs an Rot3by3 object from an existing Matrix object. USE THIS CONSTRUCTOR WITH CARE, as the constructor does not check values in the Matrix to ensure the properties of a rotation matrix are preserved.

Parameters:
rhs An Matrix object that will be used to initialize this new object.

virtual OSCAR::Rot3by3::~Rot3by3   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type Rot3by3.


Member Function Documentation

bool OSCAR::Rot3by3::Get Vector3   axis,
double &    angle,
AngleUnits    angUnits = Radians
const
 

Get an Equivalent Axis representation from an Rot3by3 object.

This method is used to get an equivalent axis representation from an Rot3by3 object.

Parameters:
axis On return, axis contains the axis.
angle On return, angle contains the angle.
angUnits Use this to pass in information whether the specified angle is in degrees or radians. The default is Radians. AngleUnits is an enum whose possible values are Degrees and Radians.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Get HandPose   hp const
 

Get an HandPose representation from an Rot3by3 object.

This method is used to get an equivalent HandPose object from an Rot3by3 object.

Parameters:
hp On return, the orientation elements of hp will be set to the Rot3by3 object. The translation elements will be unchanged.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Get Quaternion   quat
 

Get an Quaternion representation from an Rot3by3 object.

This method is used to get an Quaternion representation from an Rot3by3 object. This method converts a 3x3 rotation matrix to a 4 element quaternion. The conversion methodology used is from "Introduction to Robotics Mechanics and Controls, by John Craig."

Parameters:
quat An Quaternion that will hold the values of the quaternion.
Returns:
True if the method succeeds, and false otherwise if there is a singularity in conversion or if the input Quaternion is not of size 4.

bool OSCAR::Rot3by3::Get SpatialXform   spatial const
 

Get an SpatialXform representation from an Rot3by3 object.

This method is used to get an equivalent SpatialXform object from a RRot3by3 object.

Parameters:
spatial On return, the rotation sub-matrices of spatial will be set to the current Rot3by3 object. The left-bottom sub-matrix and the zero sub-matrix are left unchanged.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Get Xform   xf const
 

Get an Xform representation from an Rot3by3 object object.

This method is used to get an equivalent Xform object from a Rot3by3 object.

Parameters:
xf On return, the orientation element of xf will be set to the Rot3by3 object. The translation elements will be unchanged.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Get Orientation   orient const
 

Get an Orientation representation from an Rot3by3 object.

This method is used to get an equivalent 3x1 Orientation object from a Rot3by3 object.

Parameters:
orient On return, orient holds the equivalent orientation vector.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::IsValid   const
 

Checks if this rotation matrix is valid (i.e. orthonormal).

Returns:
true if this rotation matrix is valid or false otherwise.

void OSCAR::Rot3by3::MultiplyWithTranspose Rot3by3 &    rrt const
 

Multiply a Rot3by3 object by its Transpose.

Multiplying a Rot3by3 object by its Transpose, results in an Rot3by3 identity matrix.

Parameters:
rrt On return, rrt is the identity matrix.

bool OSCAR::Rot3by3::Normalize  
 

Normalizes a rotation matrix. Rotation matrices can become illformed due to numerical drift resulting from multiple operations on them. This method converts the rotation matrix to a quaternion and normalizes the quaternion and converts back to the rotation matrix.

Returns:
true on success. false if normalization fails

Vector3 OSCAR::Rot3by3::operator * const Vector3   rhs const
 

Overloaded * operator.

Overloaded * operator. This operator multiplies the calling Rot3by3 object by Vector3 object, which returns an Vector3 object.

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

Rot3by3 OSCAR::Rot3by3::operator * const Rot3by3 &    rhs const
 

Overloaded * operator.

Overloaded * operator. This operator multiplies the calling Rot3by3 object by another Rot3by3 object.

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

Rot3by3 OSCAR::Rot3by3::operator-   const
 

Overloaded operator-.

Returns an Rot3by3 in which result[i][j] = -this[i][j].

Returns:
The resulting Rot3by3 object.

Reimplemented from OSCAR::Matrix.

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

Assignment Operator.

This is the Assignment Operator for an object of type Rot3by3. USE THIS OPERATOR WITH CARE, as the operator does not check values in the Matrix to ensure the properties of a rotation matrix are preserved.

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< 3, 3 >.

Rot3by3& OSCAR::Rot3by3::operator= const Rot3by3 &    rhs
 

Assignment Operator.

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

Parameters:
rhs A Rot3by3 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::Rot3by3::Set const Vector3D   axis,
double    angle,
AngleUnits    angUnits = Radians
 

Set an Rot3by3 object based on an equivalent axis representation.

This method is used to set an Rot3by3 object based on an equivalent axis representation.

Parameters:
axis The axis specifies the unit vector in space that represents an equivalent axis
angle This contains the angle of rotation for axis.
angUnits Use this to pass in information whether the specified angle is in degrees or radians. The default is Radians. AngleUnits is an enum whose possible values are Degrees and Radians.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Set const HandPose   hp
 

Set an Rot3by3 object based on an HandPose object.

This method is used to set an Rot3by3 object based on the rotational elements of an HandPose.

Parameters:
hp This argument is used to set the values of the orientation part of the Rot3by3.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Set const Quaternion   quat
 

Set the elements of the 3x3 rotation matrix based on the input 4 element quaternion.

This method is used to set the elements of the 3x3 rotation matrix based on the input 4 element quaternion. The conversion methodology used is from "Introduction to Robotics Mechanics and Controls, by John Craig."

Parameters:
quat An Quaternion object that will be used to set the values of the rotation matrix.
Returns:
True if the method succeeds, and false otherwise if the input quaternion is not of size 4.

bool OSCAR::Rot3by3::Set const SpatialXform   spatial
 

Set an Rot3by3 object based on an SpatialXform object.

This method is used to set an Rot3by3 object based on the rotational elements of an SpatialXform.

Parameters:
spatial This argument is used to set the values of the orientation part of the Rot3by3.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Set const Xform   xf
 

Set an Rot3by3 object based on an Xform object.

This method is used to set an Rot3by3 object based on the rotational elements of an Xform.

Parameters:
xf This argument is used to set the values of the orientation part of the Rot3by3.
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Rot3by3::Set const Orientation   orient
 

Set an Orientation representation to an Rot3by3 object.

This method is used to set an equivalent 3x1 Orientation object to the Rot3by3 object.

Parameters:
orient This argument is used to set the values of the orientation part of the Rot3by3.
Returns:
True if the method succeeds, and false otherwise.

void OSCAR::Rot3by3::t Rot3by3 &    transpose const
 

Get the Transpose of an Rot3by3 object.

This method is used to get the transpose of an Rot3by3 object.

Parameters:
transpose On return, transpose contains the Transpose Rot3by3 object.

Rot3by3 OSCAR::Rot3by3::t   const
 

Get the Transpose of an Rot3by3 object.

Returns an Rot3by3 object that is the transpose of the calling object.

Returns:
An Rot3by3 object that is the transpose of the calling object.

Reimplemented from OSCAR::Matrix.

bool OSCAR::Rot3by3::toEulerXYZ Orientation   end_orient const [protected]
 

bool OSCAR::Rot3by3::toEulerZYZ Orientation   end_orient const [protected]
 

bool OSCAR::Rot3by3::toFixedXYZ Orientation   end_orient const [protected]
 

bool OSCAR::Rot3by3::ToPumaOAT Vector3   end_orient const
 


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