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

OSCAR::Orientation Class Reference
[Math]

Represents a 3 long vector whose elements hold the spatial orientation. More...

#include <Orientation.h>

Inheritance diagram for OSCAR::Orientation:

Inheritance graph
[legend]
List of all members.

Public Types

enum  OrientationType { FixedXYZ, EulerXYZ, EulerZYZ }

Public Methods

 Orientation ()
 Orientation (OrientationType oType)
 Orientation (double o1, double o2, double o3, OrientationType oType=FixedXYZ)
 Orientation (double *array, OrientationType oType=FixedXYZ)
 Orientation (const Orientation &rhs)
virtual ~Orientation ()
double & O1 ()
double & O2 ()
double & O3 ()
double GetO1 () const
double GetO2 () const
double GetO3 () const
OrientationType GetOrientationType (void) const
bool SetOrientationType (OrientationType oType)
bool ConvertType (OrientationType oType)
bool Get (HandPose &hp) const
bool Get (Rot3by3 &R) const
bool Get (Xform &X) const
bool Get (SpatialXform &S) const
bool Get (Quaternion &q) const
bool Get (Vector3 &axis, double &angle, AngleUnits angUnits=Radians) const
bool Set (const HandPose &hp)
bool Set (const Rot3by3 &R)
bool Set (const Xform &X)
bool Set (const Quaternion &q)
bool Set (const SpatialXform &S)
bool Set (const Vector3 &axis, double angle, AngleUnits angUnits=Radians)
bool Subtract (const Orientation &with, Orientation &result) const
Orientation operator- (const Orientation &rhs) const
Orientation & operator= (const Orientation &rhs)
Orientation & operator= (const Vector &rhs)
Orientation & operator() (double ox, double oy, double oz)

Protected Methods

bool eulerXYZToRot3by3 (Rot3by3 &_hand) const
bool eulerZYZToRot3by3 (Rot3by3 &_hand) const
bool fixedXYZToRot3by3 (Rot3by3 &_hand) const
void init (OrientationType type, const double *array=0)

Protected Attributes

OrientationType oType

Detailed Description

Author:
Chetan Kapoor
Represents a 3 long vector whose elements hold the spatial orientation that can be expressed in terms of various FIXED and EULER angles. Use objects of this class to provide a vector based input form for end effector orientation. The orientation is expressed by specifying the OrientationType whose possible values are FixedXYZ, EulerXYZ, and EulerZYZ. Various methods are provided that will Get/Set different position orientation objects from a HandPose.


Member Enumeration Documentation

enum OSCAR::Orientation::OrientationType
 

Enumeration OrientationType.

Enumeration values:
FixedXYZ 
EulerXYZ 
EulerZYZ 


Constructor & Destructor Documentation

OSCAR::Orientation::Orientation  
 

Contructor.

Constructs an Orientation object with default orientation (FixedXYZ) and initalizes elements to 0.

OSCAR::Orientation::Orientation OrientationType    oType
 

Contructor.

Constructs an Orientation object with a specified orientation and initalizes elements to 0.

Parameters:
oType Specifies the type of orientation, defaults to FixedXYZ.

OSCAR::Orientation::Orientation double    o1,
double    o2,
double    o3,
OrientationType    oType = FixedXYZ
 

Constructor.

Constructs an Orientation object with specified inital values and orientation type.

Parameters:
o1 Initial value (radians) for the first orientation coordinate (element 0)
o2 Initial value (radians) for the first orientation coordinate (element 1)
o3 Initial value (radians) for the first orientation coordinate (element 2)
oType Specifies the type of orientation, defaults to FixedXYZ.

OSCAR::Orientation::Orientation double *    array,
OrientationType    oType = FixedXYZ
 

Constructor.

Constructs an Orientation object, initialze elements from an array of doubles, and sets desired orientation type. Undefined behavior for arrays less than three elements.

Parameters:
array Pointer to an array of size 3. The values in this array will be used to initialize the Orientation.
oType Specifies the type of orientation, defaults to FixedXYZ.

OSCAR::Orientation::Orientation const Orientation &    rhs
 

Copy Constructor.

Constructs an Orientation object from an existing Orientation object.

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

virtual OSCAR::Orientation::~Orientation   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type Orientation.


Member Function Documentation

bool OSCAR::Orientation::ConvertType OrientationType    oType
 

Change the orientation type of an Orientation object.

This method is used to change the orientation type of an Orientation object and convert the orientation values of the Orientation to a different orientation type.

Parameters:
oType The orientation type to convert to.
Returns:
True if the method succeeds, and false otherwise if the oType is not supported, or if there was a singularity during the conversion.

bool OSCAR::Orientation::eulerXYZToRot3by3 Rot3by3   _hand const [protected]
 

bool OSCAR::Orientation::eulerZYZToRot3by3 Rot3by3   _hand const [protected]
 

bool OSCAR::Orientation::fixedXYZToRot3by3 Rot3by3   _hand const [protected]
 

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

Get an Equivalent Axis representation from an Orientation object.

This method is used to get an equivalent axis representation from an Orientation 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::Orientation::Get Quaternion   q 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 object.

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

bool OSCAR::Orientation::Get SpatialXform   S const
 

Get an SpatialXform representation from an Orientation object.

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

Parameters:
S On return, S contains a reference to the equivalent SpatialXform..
Returns:
True if the method succeeds, and false otherwise.

bool OSCAR::Orientation::Get Xform   X const
 

Get the 4 by 4 transformation matrix from an Orientation object.

This method is used to get the 4 by 4 transformation matrix from an Orientation object.

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::Orientation::Get Rot3by3   R const
 

Get the 3 by 3 rotation matrix part from an Orientation object.

This method is used to get the 3 by 3 rotation matrix from an Orientation object.

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

bool OSCAR::Orientation::Get HandPose   hp const
 

Get the handpose from an Orientation object.

This method is used to get the equivalent handpose from an Orientation object.

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

double OSCAR::Orientation::GetO1   const
 

Get the value of the first element of an Orientation object.

This method is used to get the value of the first element of an Orientation object.

Returns:
A copy of the first element.

double OSCAR::Orientation::GetO2   const
 

Get the value of the second element of an Orientation object.

This method is used to get the value of the second element of an Orientation object.

Returns:
A copy of the second element.

double OSCAR::Orientation::GetO3   const
 

Get the value of the third element of an Orientation object.

This method is used to get the value of the third element of an Orientation object.

Returns:
A copy of the third element.

OrientationType OSCAR::Orientation::GetOrientationType void    const
 

Get the orientation type of an Orientation object.

This method is used to get the orientation type of an Orientation object.

Returns:
The orientation type.

void OSCAR::Orientation::init OrientationType    type,
const double *    array = 0
[protected]
 

double& OSCAR::Orientation::O1  
 

Get a reference to the first element of an Orientation object.

This method is used to get a reference to the first element of an Orientation object.

Returns:
A reference to the first element.

double& OSCAR::Orientation::O2  
 

Get a reference to the second element of an Orientation object.

This method is used to get a reference to the second element of an Orientation object.

Returns:
A reference to the second element.

double& OSCAR::Orientation::O3  
 

Get a reference to the third element of an Orientation object.

This method is used to get a reference to the third element of an Orientation object.

Returns:
A reference to the third element.

Orientation& OSCAR::Orientation::operator() double    ox,
double    oy,
double    oz
 

Set the first three elements of the Orientation object.

This method is used to set the first three elements of the Orientation object.

Parameters:
ox Set the first element of the Orientation to this.
oy Set the second element of the Orientation to this.
oz Set the third element of the Orientation to this.
Returns:
A reference to itself.

Orientation OSCAR::Orientation::operator- const Orientation &    rhs const
 

Overloaded operator-.

This overloaded operator- subtracts an Orientation object from the calling Orientation object.

Parameters:
rhs An Orientation object to subtract from the calling Orientation object.
Returns:
The resulting Orientation object.

Orientation& OSCAR::Orientation::operator= const Vector   rhs
 

Assignment Operator.

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

Parameters:
rhs A Vector 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

Orientation& OSCAR::Orientation::operator= const Orientation &    rhs
 

Assignment Operator.

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

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

Set an Orientation object based on an equivalent axis representation.

This method is used to set an Orientation 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::Orientation::Set const SpatialXform   S
 

Set an Orientation object based on an SpatialXform object.

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

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

bool OSCAR::Orientation::Set const Quaternion   q
 

Set the orientation part of the Orientation based on a Quaternion object.

This method is used to set the orientation part of the Orientation based on a Quaternion object.

Parameters:
q An Quaternion object which will be used to set the Orientation.
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::Orientation::Set const Xform   X
 

Set the Orientation based on a homogenous transformation matrix.

This method is used to set the Orientation based on a homogenous tranformation matrix.

Parameters:
X An Xform object which will be used to set the Orientation object.
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::Orientation::Set const Rot3by3   R
 

Set the rotation matrix of an Orientation object.

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

Parameters:
R The orientation part of the Orientation is set to this.
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::Orientation::Set const HandPose   hp
 

Set the Orientation based on a handpose.

This method is used to set the Orientation based on a handpose.

Parameters:
hp An HandPose object which will be used to set the SpatialXform.
Returns:
True if the method succeeds. False otherwise.

bool OSCAR::Orientation::SetOrientationType OrientationType    oType
 

Set the orientation type of an Orientation object.

This method is used to set the orientation type of an Orientation object. This method does not transform the orientation values.

Parameters:
oType: The orientation type you want to set the Orientation to.
Returns:
True if the method succeeds, and false otherwise if the oType is not supported.

bool OSCAR::Orientation::Subtract const Orientation &    with,
Orientation &    result
const
 

Subtract an Orientation object from the calling Orientation object.

This method subtracts an Orientation object from the calling Orientation object.

Parameters:
with An Orientation object to subtract from the calling Orientation object.
result On return, result contains the resulting Orientation object.


Member Data Documentation

OrientationType OSCAR::Orientation::oType [protected]
 


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