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

OSCAR::HandPose Class Reference
[Math]

Represents a 6 element vector whose 1st 3 elements hold the X,Y,Z positions and the last three hold the orientation. More...

#include <HandPose.h>

Inheritance diagram for OSCAR::HandPose:

Inheritance graph
[legend]
List of all members.

Public Methods

 HandPose ()
 HandPose (Orientation::OrientationType oType)
 HandPose (double x, double y, double z, double o1, double o2, double o3, Orientation::OrientationType oType=Orientation::FixedXYZ)
 HandPose (double x, double y, double z, double o1, double o2, double o3, const CoordinateStatusArray &statArray, Orientation::OrientationType oType=Orientation::FixedXYZ, OSCARError &err=DUMMY_ERROR(noError))
 HandPose (double *array, Orientation::OrientationType oType=Orientation::FixedXYZ)
 HandPose (double *array, const CoordinateStatusArray &statArray, Orientation::OrientationType oType=Orientation::FixedXYZ, OSCARError &err=DUMMY_ERROR(noError))
 HandPose (const CoordinateStatusArray &statArray, OSCARError &err=DUMMY_ERROR(noError))
 HandPose (const HandPose &rhs)
virtual ~HandPose ()
double & X ()
double & Y ()
double & Z ()
double & O1 ()
double & O2 ()
double & O3 ()
double GetX () const
double GetY () const
double GetZ () const
double GetO1 () const
double GetO2 () const
double GetO3 () const
bool Get (Vector3 &position) const
bool Get (Orientation &orientation) const
bool Get (Rot3by3 &rotation) const
bool Get (Quaternion &quat) const
bool Get (Xform &xform) const
bool Get (SpatialXform &spatial) const
bool Get (Vector3 &axis, double &angle, AngleUnits angUnits=Radians) const
bool Set (const Vector3 &position)
bool Set (const Orientation &orientation)
bool Set (const Rot3by3 &rotation)
bool Set (const Quaternion &quat)
bool Set (const Xform &xform)
bool Set (const SpatialXform &spatial)
bool Set (const Vector3 &axis, double angle, AngleUnits angUnits=Radians)
Orientation::OrientationType GetOrientationType () const
bool SetOrientationType (Orientation::OrientationType oType)
bool ConvertType (Orientation::OrientationType oType)
bool Subtract (const HandPose &rhs, HandPose &result) const
HandPose operator- (const HandPose &rhs) const
HandPose & operator= (const HandPose &rhs)
HandPose & operator= (const Vector &rhs)
HandPose & operator() (double x, double y, double z, double o1, double o2, double o3)

Protected Attributes

Orientation::OrientationType oType

Detailed Description

Author:
Chetan Kapoor

A vector of size 6 whose 1st 3 elements hold the X, Y, and Z positions, and the last three hold the spatial orientation that can be expressed in terms of various FIXED and EULER angles. Provides a vector-based input form for end effector position and orientation. The orientation can be expressed in the same way as the Orientation class. Various methods are provided that will Get/Set different position and orientation objects from a HandPose. As this class inherits from CoordinateVector, you can set each element of the HandPose to be Active or Inactive.


Constructor & Destructor Documentation

OSCAR::HandPose::HandPose  
 

Default Contructor.

Constructs an HandPose object with default FixedXYZ orientation and initalizes the elements to 0.0 and Active.

OSCAR::HandPose::HandPose Orientation::OrientationType    oType [explicit]
 

Default Contructor.

Constructs an HandPose object with default FixedXYZ orientation and initalizes the elements to 0.0 and Active.

Parameters:
oType Type of orientation. Defaults to Orientation::FixedXYZ.

OSCAR::HandPose::HandPose double    x,
double    y,
double    z,
double    o1,
double    o2,
double    o3,
Orientation::OrientationType    oType = Orientation::FixedXYZ
 

Constructor.

Constructs an HandPose object with inital values and orientaton type. All coordinates are set to Active.

Parameters:
x X coordinate value (element 0) of the HandPose.
y Y coordinate value (element 1) of the HandPose.
z Z coordinate value (element 2) of the HandPose.
o1 1st orientation coordinate value (element 3) of the HandPose.
o2 2nd orientation coordinate value (element 4) of the HandPose.
o3 3rd orientation coordinate value (element 5) of the HandPose.
oType Orientation type, defaults to Orientation::FixedXYZ.

OSCAR::HandPose::HandPose double    x,
double    y,
double    z,
double    o1,
double    o2,
double    o3,
const CoordinateStatusArray   statArray,
Orientation::OrientationType    oType = Orientation::FixedXYZ,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

Construct an HandPose object with inital values, orientaiton type, and Active/Inactive coordinates.

Parameters:
x X coordinate value (element 0) of the HandPose.
y Y coordinate value (element 1) of the HandPose.
z Z coordinate value (element 2) of the HandPose.
o1 1st orientation coordinate value (element 3) of the HandPose.
o2 2nd orientation coordinate value (element 4) of the HandPose.
o3 3rd orientation coordinate value (element 5) of the HandPose.
statArray A RRCoordinateStatusArray of size 5 that defines the Active/Inactive state of each coordinate.
oType Orientation type, defaults to Orientation::FixedXYZ.
err Reference to a OSCARError object used to get the error state of the constructor call.
Exceptions:
matrixSizeMismatch matrixSizeMismatch

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

Constructor.

This is the constructor for an object of type HandPose. Use this to construct an HandPose object with a desired orientaiton type, and initialize all the elements from an array. By default, all coordinates of the HandPose are set to Active. This constructor will lead to program crash if array is less than size 6.

Parameters:
array Pointer to a array of type double of Size 6. The values in this array will be used to initialize the HandPose.
oType Specifies the type of orientation that this HandPose represents. The default value is Orientation::FixedXYZ.

OSCAR::HandPose::HandPose double *    array,
const CoordinateStatusArray   statArray,
Orientation::OrientationType    oType = Orientation::FixedXYZ,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the constructor for an object of type HandPose. Use this to construct an HandPose object with a desired orientaiton type, and initialize all the elements from an array. Set the Active/Inactive values according to the RRCoordinateStatusArray. This constructor will lead to program crash if array is less than size 6.

Parameters:
array Pointer to a array of type double of Size 6. The values in this array will be used to initialize the HandPose.
statArray A RRCoordinateStatusArray of size 5 that defines the Active/Inactive state of each coordinate of the HandPose.
oType Specifies the type of orientation that this HandPose represents. The default value is Orientation::FixedXYZ.
err Reference to a OSCARError object. This can be used to get the error state of the constructor call. For e.g., arraySizeMismatch is generated when the size of statArray is not equal to 5. The default value signifies a No Error state.
Exceptions:
arraySizeMismatch arraySizeMismatch Call GetError() to get more information

OSCAR::HandPose::HandPose const CoordinateStatusArray   statArray,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the constructor for an object of type HandPose. Use this to construct an HandPose object with all the elements initialized to 0.0. Set the Active/Inactive values according to the RRCoordinateStatusArray.

Parameters:
statArray A RRCoordinateStatusArray of size 5 that defines the Active/Inactive state of each coordinate of the HandPose.
err Reference to a OSCARError object. This can be used to get the error state of the constructor call. For e.g., arraySizeMismatch is generated when the size of statArray is not equal to 5. The default value signifies a No Error state.
Exceptions:
arraySizeMismatch arraySizeMismatch Call GetError() to get more information

OSCAR::HandPose::HandPose const HandPose &    rhs
 

Copy Constructor.

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

Parameters:
rhs A HandPose object that will be used to initalize this new object.

virtual OSCAR::HandPose::~HandPose   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type HandPose.


Member Function Documentation

bool OSCAR::HandPose::ConvertType Orientation::OrientationType    oType
 

Change the orientation type of a HandPose object, and convert orientation elements.

Change the orientation type and convert the orientation elements.

Parameters:
oType Desired orientation type.
Returns:
True if the method succeeds, False if the oType is not supported or if a singularity was encountered during conversion.

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

Get an equivalent axis representation of the orientation part of a HandPose.

Get an equivalent axis representation of the orientation part of the calling HandPose object.

Parameters:
axis Unit vector that is axis of rotation
angle Angle of rotation about axis
angUnits Specify Radians(default) or Degrees
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::Get SpatialXform   spatial const
 

Get the spatial tranformation matrix representation of the position & orientation.

Get the equivalent spatial tranformation matrix representation of position & orientation.

Parameters:
spatial On return, holds the equivalent spatial transformation matrix.
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::Get Xform   xform const
 

Get the tranformation matrix representation of the position & orientation.

Get the equivalent tranformation matrix representation of the position & orientation.

Parameters:
xform On return, holds the equivalent transformation matrix.
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::Get Quaternion   quat const
 

Get the quaternion orientation representation.

Get the equivalent quaternion representation of the orientation.

Parameters:
quat On return quat holds the equivalent quaternion.
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::Get Rot3by3   rotation const
 

Get the 3X3 rotation matrix representation of the orientation.

Get the equivalent 3X3 rotation matrix representation of the orientation.

Parameters:
rotation Modified to the equivalent rotation matrix.
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::Get Orientation   orientation const
 

Get the last three elements of the HandPose object that specifiy orientation.

Copy orientation elements (3,4&5) and orientation type into argument.

Parameters:
orientation Modified to hold orientation information.
Returns:
True.

bool OSCAR::HandPose::Get Vector3   position const
 

Get the 1st three elements of the HandPose object that specifiy position.

Copy position elements (0,1,&2) into argument

Parameters:
position On return position holds the values of the 1st three elements.
Returns:
True.

double OSCAR::HandPose::GetO1   const
 

Get the value of the 4th element.

Get the value of the 4th element.

Returns:
A copy of the 4th element.

double OSCAR::HandPose::GetO2   const
 

Get the value of the 5th element.

Get the value of the 5th element.

Returns:
A copy of the 5th element.

double OSCAR::HandPose::GetO3   const
 

Get the value of the 6th element.

Get the value of the 6th element.

Returns:
A copy of the 6th element.

Orientation:: OrientationType OSCAR::HandPose::GetOrientationType   const
 

Get the orientation type of a HandPose object.

Get orientation type of a HandPose object.

Returns:
The Orientation::OrientationType type.

double OSCAR::HandPose::GetX   const
 

Get the value of the 1st element.

Get the value of the 1st element.

Returns:
A copy of the 1st element.

Reimplemented in OSCAR::PCSHandPose.

double OSCAR::HandPose::GetY   const
 

Get the value of the 2nd element.

Get the value of the 2nd element.

Returns:
A copy of the 2nd element.

Reimplemented in OSCAR::PCSHandPose.

double OSCAR::HandPose::GetZ   const
 

Get the value of the 3rd element.

Get the value of the 3rd element.

Returns:
A copy of the 3rd element.

Reimplemented in OSCAR::PCSHandPose.

double& OSCAR::HandPose::O1  
 

Get a reference to the 4th element.

Get a reference to the 4th element.

Returns:
Reference to the 4th element HandPose object.

double& OSCAR::HandPose::O2  
 

Get a reference to the 5th element.

Get a reference to the 5th element.

Returns:
Reference to the 5th element HandPose object.

double& OSCAR::HandPose::O3  
 

Get a reference to the 6th element.

Get a reference to the 6th element.

Returns:
Reference to the 6th element HandPose object.

HandPose& OSCAR::HandPose::operator() double    x,
double    y,
double    z,
double    o1,
double    o2,
double    o3
 

Set all the elements of a HandPose object.

Sets all the elements of a HandPose object by specifying 6 values.

Parameters:
x X coordinate value (element 0) of the HandPose.
y Y coordinate value (element 1) of the HandPose.
z Z coordinate value (element 2) of the HandPose.
o1 1st orientation coordinate value (element 3) of the HandPose.
o2 2nd orientation coordinate value (element 4) of the HandPose.
o3 3rd orientation coordinate value (element 5) of the HandPose.
Returns:
Reference to current object

HandPose OSCAR::HandPose::operator- const HandPose &    rhs const
 

Overloaded operator-.

Subtracts a HandPose object from the calling HandPose object. If the argument has a different orientation type, an HandPose is returned with all elements set to zero.

Parameters:
rhs HandPose subtracted from the calling object.
Returns:
The resulting HandPose object.
Exceptions:
Orientation types not the same.

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

Assignment operator.

Assignment operator for an object of type HandPose from an Vector of size >=6. If the argument is not full size, no values are modified.

Parameters:
rhs The argument should be of size greater >=6.
Returns:
Reference current object.

Reimplemented from OSCAR::CoordinateVector.

HandPose& OSCAR::HandPose::operator= const HandPose &    rhs
 

Assignment operator.

Assignment operator for an object of type HandPose, does not convert orientation types.

Parameters:
rhs An HandPose object that goes on the right hand side of operator=.
Returns:
Reference current object.

Reimplemented in OSCAR::PCSHandPose.

bool OSCAR::HandPose::Set const Vector3   axis,
double    angle,
AngleUnits    angUnits = Radians
 

Set the orientation from an equivalent axis representation.

Sets the orientation from the rotation about an axis in space.

Parameters:
axis Axis of rotation
angle Angle of rotation about axis.
angUnits Specify Radians(default) or Degrees
Returns:
True if the method succeeds, False if a singularity encountered in the conversion.

bool OSCAR::HandPose::Set const SpatialXform   spatial
 

Set the position & orientation part of the HandPose from SpatialXform.

Sets the position & orientation a 6X6 spatial transformation matrix from current orientation type.

Parameters:
spatial SpatialXform used to set the translation and orientation.
Returns:
True if the method succeeds, False if a singularity encountered in the conversion.

bool OSCAR::HandPose::Set const Xform   xform
 

Set the position & orientation part of the HandPose from an Xform.

Sets the position & orientation from 4x4 Xform from current orientation type.

Parameters:
xform Xform used to set the translation & orientation.
Returns:
True if the method succeeds, False if a singularity encountered in the conversion.

bool OSCAR::HandPose::Set const Quaternion   quat
 

Set the orientation part of the HandPose from an quaternion.

Sets the orientation part of the HandPose from an input quaternion using current orientation type.

Parameters:
quat A quaternion object which will be used to set the orientation.
Returns:
True if the method succeeds, False if a singularity encountered in the conversion.

bool OSCAR::HandPose::Set const Rot3by3   rotation
 

Set the orientation part of the HandPose from an Rot3by3.

Sets the orientation of the HandPose from 3X3 rotation matrix using current orientation type.

Parameters:
rotation Rot3by3 used to set the orientation.
Returns:
True if the method succeeds, False if a singularity encountered in the conversion.

bool OSCAR::HandPose::Set const Orientation   orientation
 

Set the last three elements of the HandPose that specifiy orientation.

Sets the orientation elements of the HandPose.

Parameters:
orientation Orientation used to set orientation elements.
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::Set const Vector3   position
 

Set the 1st three elements of the HandPose that specifiy position.

Sets the position elements of the HandPose.

Parameters:
position RRector3 that contains the X,Y,Z coordinates.
Returns:
True if the method succeeds, otherwise False.

bool OSCAR::HandPose::SetOrientationType Orientation::OrientationType    oType
 

Set the orientation type of a HandPose object.

Sets the orientation type of a HandPose object, BUT DOES NOT MODIFY VALUES.

Parameters:
oType Desired orientation type.
Returns:
True if the method succeeds, False if the oType is not supported.

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

Subtract a HandPose object from the calling HandPose object.

Subtracts a HandPose object from the calling HandPose object and place in result. Same as operator-(..), but avoids creating temporary. If all three orientation types are not the same, elements of result are set to zero and false is returned.

Parameters:
rhs HandPose subtracted from the calling object.
result This contains the result of the subtraction.
Returns:
True if the method succeeds, False if the orientation types are not the same.

double& OSCAR::HandPose::X  
 

Get a reference to the 1st element.

Get a reference to the 1st element.

Returns:
Reference to the 1st element HandPose object.

Reimplemented in OSCAR::PCSHandPose.

double& OSCAR::HandPose::Y  
 

Get a reference to the 2nd element.

Get a reference to the 2nd element.

Returns:
Reference to the 2nd element HandPose object.

Reimplemented in OSCAR::PCSHandPose.

double& OSCAR::HandPose::Z  
 

Get a reference to the 3rd element.

Get a reference to the 3rd element.

Returns:
Reference to the 3rd element HandPose object.

Reimplemented in OSCAR::PCSHandPose.


Member Data Documentation

Orientation::OrientationType OSCAR::HandPose::oType [protected]
 


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