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

OSCAR::IKDirectSearch Class Reference
[InverseKinematics]

This class contains methods for calculating inverse position and velocity solutions for serial manipulators using the Resolved Rate technique. More...

#include <IKDirectSearch.h>

Inheritance diagram for OSCAR::IKDirectSearch:

Inheritance graph
[legend]
List of all members.

Public Methods

 IKDirectSearch (JointVector &initialJointPosition, FKPosition *fkPosition, OSCARError &err=DUMMY_ERROR(noError), double maxError=0.1, double rtScale=1000.0)
 IKDirectSearch (const IKDirectSearch &rhs)
IKDirectSearch & operator= (const IKDirectSearch &rhs)
virtual ~IKDirectSearch ()
bool GetJointPosition (const Xform &desiredHandMatrix, JointVector &jointPosition)
bool GetJointPosition (const HandPose &desiredHand, JointVector &jointPosition)
bool GetJointPosition (JointVector &jointPosition) const
bool SetJointPosition (const JointVector &jointPosition)
void SetMaximumIterations (unsigned int noIterations)
unsigned int GetMaximumIterations (void) const
bool SetErrorTolerance (double maxErrorVal, double rotScale)
bool GetErrorTolerance (double &maxErrorVal, double &rotScale) const
bool SetPerturbationParameters (const double perturbationDelta, const Perturbation::SearchPattern searchPattern=Perturbation::Simple)
bool GetPerturbationParameters (double &perturbationDelta, Perturbation::SearchPattern &searchPattern) const
bool SetDeltaVector (const Vector &deltas)

Protected Methods

virtual bool converge (const Xform &desiredHandMatrix)
virtual double calculateErrorMagnitude (const Xform &desired, const Xform *current, HandPose &error)

Protected Attributes

unsigned int DOF
unsigned int maxIterations
unsigned int currentIteration
unsigned int nbrOptions
double maxError
double rotationScale
double errorMag
double deltaPerturb
Xform desiredXform
HandPose errorHandVector
Perturbation::SearchPattern pattern
JointVectorcurrentJointVector
JointVectorpreviousJointVector
JointVectorinitialJointVector
const XformcurrentHand
FKPositionfowkin
Perturbationperturb
VectorArraysolnArray

Detailed Description

Author:
Peter S. March & Jeremy Sevier

This class contains methods for calculating inverse position solutions using an iterative direct search method. When a new hand position is sent to the object, the object perturbs the current joint values to generate a set of possible solutions. The resulting HandPose error for each of these solutions is determined, and the solution with the minimum error is chosen. This process is repeated until the error is within some error limit.


Constructor & Destructor Documentation

OSCAR::IKDirectSearch::IKDirectSearch JointVector   initialJointPosition,
FKPosition   fkPosition,
OSCARError   err = DUMMY_ERROR(noError),
double    maxError = 0.1,
double    rtScale = 1000.0
 

Constructor.

This is the constructor for an object of type IKDirectSearch. Use this Constructor to create an IKDirectSearch object from an FKPosition object and an initial joint position. This class uses the forward kinematics from the FKPosition object to converge on a solution. As such, all functionality for setting and retrieving tool points and base poses should be done through the FKPosition object.

Parameters:
initialJointPosition A DOF length vector of initial joint positions.
fkPosition A pointer to an FKPosition class. This object will be used to calculate a forward position solution used for converging on a solution.
err An OSCARError object that on return will hold the value of any errors that were generated during the constructor call. If err is not equal to 'noError' you can call GetError() to get the details of the error code.
maxError The maximum error allowed when converging on a solution. The default value is 0.1.
rtScale Used to scale orientation errors in the HandPose with translation errors. The default value is 1000. The formula used to compute maxError is: maxError = translationError + rtScale * orientationError.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

OSCAR::IKDirectSearch::IKDirectSearch const IKDirectSearch &    rhs
 

Copy Constructor.

This is the Copy constructor for an object of type IKDirectSearch. Use this to construct an IKDirectSearch based on an existing IKDirectSearch object.

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

virtual OSCAR::IKDirectSearch::~IKDirectSearch   [virtual]
 

Virtual Destructor.

This is the Destructor for an IKDirectSearch object.


Member Function Documentation

virtual double OSCAR::IKDirectSearch::calculateErrorMagnitude const Xform   desired,
const Xform   current,
HandPose   error
[protected, virtual]
 

virtual bool OSCAR::IKDirectSearch::converge const Xform   desiredHandMatrix [protected, virtual]
 

bool OSCAR::IKDirectSearch::GetErrorTolerance double &    maxErrorVal,
double &    rotScale
const
 

Get the value of the Error Tolerance.

This method is used to get the value of the Error Tolerance; the maximum error and the rotation scaling factor.

Parameters:
maxErrorVal On return, maxErrorVal contains the maximum tolerable error.
rotScale On return, rotScale contains the value by which the rotational error should be scaled while computing the total error
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.

bool OSCAR::IKDirectSearch::GetJointPosition JointVector   jointPosition const
 

Get the Joint Position.

This method is used to get the current joint state of the system.

Parameters:
jointPosition An nx1 vector (where n is the number of joints)
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
vectorSizeMismatch vectorSizeMismatch
See also:
SetJointPosition(const JointVector& jointPosition)

bool OSCAR::IKDirectSearch::GetJointPosition const HandPose   desiredHand,
JointVector   jointPosition
[virtual]
 

Get the Joint position.

This method is used to get the current joint position for an end-effector position represented by an HandPose object.

Parameters:
desiredHand A handpose vector representing the desired end-effector position.
jointPosition An nx1 vector (where n is the number of joints)
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const Xform& desiredHandMatrix, JointVector& jointPosition)

GetSolutionProperties()

Implements OSCAR::IKPosition.

bool OSCAR::IKDirectSearch::GetJointPosition const Xform   desiredHandMatrix,
JointVector   jointPosition
[virtual]
 

Get the Joint position.

This method is used to get the current joint position solution for an end-effector position represented by an Xform object.

Parameters:
desiredHandMatrix A transform matrix representing the desired end-effector position.
jointPosition A DOF long vector (where DOF is the number of joints or degrees of freedom).
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const HandPose& desiredHand, JointVector& jointPosition)

GetSolutionProperties()

Implements OSCAR::IKPosition.

unsigned int OSCAR::IKDirectSearch::GetMaximumIterations void    const
 

Get the value of the bound set on the Maximum number of iterations.

This method is used to get the value of the bound set on the Maximum number of iterations. IKDirectSearch uses an iterative algorithm to find the inverse solution. Use this method to query the upper bound to the number of iterations.

Returns:
A positive number that specifies an upper bound to the iteration count.
See also:
SetMaximumIterations(unsigned int noIterations)

bool OSCAR::IKDirectSearch::GetPerturbationParameters double &    perturbationDelta,
Perturbation::SearchPattern   searchPattern
const
 

This method is used to get the values that the object currently uses to perturb the joint positions.

Parameters:
perturbationDelta This is the delta value, in radians, that each joint will be moved while generating a solution set.
searchPattern This is method used to generate the solution set. The options are: Simple, Factorial, Simfact, and Exhaustive. Simple will provide the smallest solution sets, but the fastest inverse. Exhaustive will produce the largest solution sets, but the slowest inverse. For more information on these methods, see the documentation for Perturbation. The default value is Simple.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.

IKDirectSearch& OSCAR::IKDirectSearch::operator= const IKDirectSearch &    rhs
 

Assignment operator.

This is the Assignment operator for an object of type IKDirectSearch.

Parameters:
rhs An IKDirectSearch 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::IKDirectSearch::SetDeltaVector const Vector   deltas
 

This method will allow you to set a different delta value for each joint.

Parameters:
deltas This is a vector containing the delta value for each individual joint.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
See also:
bool SetPerturbationParameters(const double perturbationDelta, const Perturbation::SearchPattern searchPattern=Perturbation::Simple);
Exceptions:
vectorSizeMismatch 

bool OSCAR::IKDirectSearch::SetErrorTolerance double    maxErrorVal,
double    rotScale
 

Set the Error Tolerance.

This method is used to set the Error Tolerance. IKPosition uses an iterative algorithm to find the inverse solution. As such, this algorithm stops iterating when the error value falls below a preset value. Also, the robot end-effector error is composed of translational and rotational errors. This method is used to specify the total error and a scale factor that is multipled by the rotational error. The total error is then computed as error = translational error + scale * rotational error. The default translational error as specified in the constructor is 0.l units and the scale is 1000.00.

Parameters:
maxErrorVal The maximum tolerable error.
rotScale The value by which the rotational error should be scaled while computing the total error.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.

bool OSCAR::IKDirectSearch::SetJointPosition const JointVector   jointPosition
 

Set the Joint Position.

This method is used to reset to a new internal joint position state.

Parameters:
jointPosition An JointVector of size DOF that specifies the new joint angle state in Radians.
Returns:
true if jointPosition is of size DOF. If not, then false. Call GetError for more detailed error information.
See also:
GetJointPosition(const JointVector& jointPosition)
Exceptions:
vectorSizeMismatch vectorSizeMismatch

void OSCAR::IKDirectSearch::SetMaximumIterations unsigned int    noIterations
 

Set a bound on the Maximum number of iterations.

This method is used to set a bound on the Maximum number of iterations. IKDirectSearch uses an iterative algorithm to find the inverse solution. Use this method to specify an upper bound on the number of iterations. The default is 100.

Parameters:
noIterations A positive number that specifies an upper bound to the iteration count.
See also:
GetMaximumIterations()

bool OSCAR::IKDirectSearch::SetPerturbationParameters const double    perturbationDelta,
const Perturbation::SearchPattern    searchPattern = Perturbation::Simple
 

Use this method to set the perturbation parameters.

This method is used to set the values that the object will use to perturb the joint positions.

Parameters:
perturbationDelta This is the delta value, in radians, that each joint will be moved while generating a solution set. The default value is 0.0001.
searchPattern This is method used to generate the solution set. The options are: Simple, Factorial, Simfact, and Exhaustive. Simple will provide the smallest solution sets, but the fastest inverse. Exhaustive will produce the largest solution sets, but the slowest inverse. For more information on these methods, see the documentation for Perturbation. The default value is Simple.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
See also:
bool SetPerturbationParameters(const double perturbationDelta, const Perturbation::SearchPattern searchPattern=Perturbation::Simple)

bool SetDeltaVector(const Vector& deltas);


Member Data Documentation

const Xform* OSCAR::IKDirectSearch::currentHand [protected]
 

unsigned int OSCAR::IKDirectSearch::currentIteration [protected]
 

JointVector* OSCAR::IKDirectSearch::currentJointVector [protected]
 

double OSCAR::IKDirectSearch::deltaPerturb [protected]
 

Xform OSCAR::IKDirectSearch::desiredXform [protected]
 

unsigned int OSCAR::IKDirectSearch::DOF [protected]
 

HandPose OSCAR::IKDirectSearch::errorHandVector [protected]
 

double OSCAR::IKDirectSearch::errorMag [protected]
 

FKPosition* OSCAR::IKDirectSearch::fowkin [protected]
 

JointVector* OSCAR::IKDirectSearch::initialJointVector [protected]
 

double OSCAR::IKDirectSearch::maxError [protected]
 

unsigned int OSCAR::IKDirectSearch::maxIterations [protected]
 

unsigned int OSCAR::IKDirectSearch::nbrOptions [protected]
 

Perturbation::SearchPattern OSCAR::IKDirectSearch::pattern [protected]
 

Perturbation* OSCAR::IKDirectSearch::perturb [protected]
 

JointVector* OSCAR::IKDirectSearch::previousJointVector [protected]
 

double OSCAR::IKDirectSearch::rotationScale [protected]
 

VectorArray* OSCAR::IKDirectSearch::solnArray [protected]
 


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