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

OSCAR::IKJacobian< JacobianType > Class Template Reference
[InverseKinematics]

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

#include <IKJacobian.h>

Inheritance diagram for OSCAR::IKJacobian< JacobianType >:

Inheritance graph
[legend]
List of all members.

Public Methods

 IKJacobian (const JointVector &initialJointPosition, JacobianType *fkJacobian, OSCARError &err=DUMMY_ERROR(noError), EqnSolver *solver=0, double maxError=0.1, double rtScale=1000.0)
 IKJacobian (const IKJacobian &rhs)
IKJacobian & operator= (const IKJacobian &rhs)
virtual ~IKJacobian ()
virtual bool GetJointPosition (const Xform &desiredHandMatrix, JointVector &jointPosition)
virtual bool GetJointPosition (const HandPose &desiredHand, JointVector &jointPosition)
virtual bool GetJointVelocity (const HandPose &handVelocity, JointVector &jointVelocitySolution)
virtual bool GetJointPosition (JointVector &jointPosition) const
virtual bool SetJointPosition (const JointVector &jointPosition)
void SetMinimumMOT (double minMOT)
double GetMinimumMOT () const
void SetMaximumIterations (unsigned int noIterations)
unsigned int GetMaximumIterations (void) const
bool SetErrorTolerance (double maxErrorVal, double rotScale)
bool GetErrorTolerance (double &maxErrorVal, double &rotScale) const
double GetSolutionProperties (void) const
double GetSolutionProperties (unsigned int &iterationCount) const
double GetSolutionProperties (double &errorMagnitude) const
double GetSolutionProperties (Matrix &jacobian) const
double GetSolutionProperties (Xform &currentHandPos) const

Protected Methods

virtual bool converge (const Xform &desiredHandMatrix)
virtual double calculateErrorMagnitude (const Xform &desired, const Xform *current, HandPose &error)
virtual void updateKinematicState (JointVector &jointPosition)
virtual bool inverse ()

Protected Attributes

unsigned int DOF
unsigned int maxIterations
unsigned int currentIteration
double maxError
double rotationScale
double minimumMOT
double MOT
double errorMag
Xform desiredXform
JointVectorcurrentJointVector
JointVectorpreviousJointVector
JointVectorinitialJointVector
JointVectordifferentialJointVector
JointVectorjointVelocity
HandPose errorHandVector
const XformcurrentHand
const MatrixcurrentJacobian
JacobianType * fowkin
EqnSolversolver
bool internalSolverFlag

Detailed Description

template<class JacobianType = FKJacobian>
class OSCAR::IKJacobian< JacobianType >

Author:
Peter S. March & Chetan Kapoor

This class contains methods for calculating inverse position and velocity solutions for serial manipulators using the Resolved Rate technique. This class takes a template parameter that defines the forward position and jacobian object that will be used in the internal algorithm. This object must be derived from Kinematics, FKPositionBase, and FKJacobianBase. This template parameter is defaulted to FKJacobian. An object using the default parameter can be initialized as follows:

IKJacobian<> myIK(...);


Constructor & Destructor Documentation

template<class JacobianType = FKJacobian>
OSCAR::IKJacobian< JacobianType >::IKJacobian const JointVector   initialJointPosition,
JacobianType *    fkJacobian,
OSCARError   err = DUMMY_ERROR(noError),
EqnSolver   solver = 0,
double    maxError = 0.1,
double    rtScale = 1000.0
 

Constructor.

This is the constructor for an object of type IKJacobian. Use this Constructor to create an IKJacobian object from an FKJacobian object and an initial joint position. This class uses the Jacobian calculations from the FKJacobian class to perform a Resolved Rateinverse solution. As such, all functionality for setting and retrieving tool points and base poses should be done through the FKJacobian object.

Parameters:
initialJointPosition A DOF length vector of initial joint positions. This position will be used to create the object and should not be singular.
fkJacobian A pointer to a forward kinematics object. This object is a template parameter defined at object creation. It must be derived from Kinematics, FKPositionBase, and FKJacobianBase. This object will be used to generate the Jacobian used for the inverse. All necessary tool points and base poses should be set in this object. A user can supply their custom FKJacobian object for this purpose.
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.
solver A pointer to an EqnSolver object. This parameter can be used to create custom methods for solving systems of linear equations. If not supplied, a default EqnSolver will be created.
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

template<class JacobianType = FKJacobian>
OSCAR::IKJacobian< JacobianType >::IKJacobian const IKJacobian< JacobianType > &    rhs
 

Copy Constructor.

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

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

template<class JacobianType = FKJacobian>
virtual OSCAR::IKJacobian< JacobianType >::~IKJacobian   [virtual]
 

Virtual Destructor.

This is the Destructor for an IKJacobian object.


Member Function Documentation

template<class JacobianType = FKJacobian>
virtual double OSCAR::IKJacobian< JacobianType >::calculateErrorMagnitude const Xform   desired,
const Xform   current,
HandPose   error
[protected, virtual]
 

Reimplemented in OSCAR::IKJDLS< JacobianType >, OSCAR::IKJReconfig< JacobianType >, and OSCAR::IKJReconfig< >.

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::converge const Xform   desiredHandMatrix [protected, virtual]
 

Reimplemented in OSCAR::IKJDLS< JacobianType >.

template<class JacobianType = FKJacobian>
bool OSCAR::IKJacobian< JacobianType >::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.

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::GetJointPosition JointVector   jointPosition const [virtual]
 

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)

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::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:
singularity singularity
minMOTMReached minMOTReached
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const Xform& desiredHandMatrix, JointVector& jointPosition)

GetSolutionProperties()

Implements OSCAR::IKPosition.

Reimplemented in OSCAR::IKJDLS< JacobianType >, OSCAR::IKJReconfig< JacobianType >, and OSCAR::IKJReconfig< >.

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::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:
singularity singularity
minMOTReached minMOTReached
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const HandPose& desiredHand, JointVector& jointPosition)

GetSolutionProperties()

Implements OSCAR::IKPosition.

Reimplemented in OSCAR::IKJDLS< JacobianType >, OSCAR::IKJReconfig< JacobianType >, and OSCAR::IKJReconfig< >.

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::GetJointVelocity const HandPose   handVelocity,
JointVector   jointVelocitySolution
[virtual]
 

Get the Joint Velocity.

This method is used to get the current joint velocity vector from a HandPose velocity vector.

Parameters:
handVelocity An mx1 vector of handpose velocities.
jointVelocitySolution An nx1 vector to store the calculate joint velocities
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
singularity singularity
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const Xform& desiredHandMatrix, JointVector& jointPosition)

GetSolutionProperties()

Implements OSCAR::IKVelocity.

Reimplemented in OSCAR::IKJAvoidLimits< JacobianType >, OSCAR::IKJDLS< JacobianType >, OSCAR::IKJReconfig< JacobianType >, and OSCAR::IKJReconfig< >.

template<class JacobianType = FKJacobian>
unsigned int OSCAR::IKJacobian< JacobianType >::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. IKJacobian 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)

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::GetMinimumMOT   const
 

Get the value of the Minimum Measure of Transmissibity(MOT).

This method is used to get the value of the current minimum MOT.

Returns:
the current minimum MOT used in the inverse.
See also:
SetMinimumMOT(double minMOT)

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::GetSolutionProperties Xform   currentHandPos const
 

Get the Solution Properties.

This method is used to getthe current hand position.

Parameters:
currentHandPos The current hand position of the system in a 4x4 Transformation matrix.
Returns:
The MOT calculated in the inverse.
See also:
GetSolutionProperties()

GetSolutionProperties(unsigned int& iterationCount)

GetSolutionProperties(double& errorMagnitude)

GetSolutionProperties(Matrix& jacobian)

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::GetSolutionProperties Matrix   jacobian const
 

Get the Solution Properties.

This method is used to get the current Jacobian matrix.

Parameters:
jacobian A matrix to store the current jacobian.
Returns:
The MOT calculated in the inverse.
Exceptions:
matrixSizeMismatch matrixSizeMismatch
See also:
GetSolutionProperties()

GetSolutionProperties(unsigned int& iterationCount)

GetSolutionProperties(double& errorMagnitude)

GetSolutionProperties(Xform& currentHand)

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::GetSolutionProperties double &    errorMagnitude const
 

Get the Solution Properties.

This method is used to determine the solution properties of the inverse.

Parameters:
errorMagnitude On return, errorMagnitude contains the number of iterations.
Returns:
The MOT calculated in the inverse.
See also:
GetSolutionProperties()

GetSolutionProperties(unsigned int& iterationCount)

GetSolutionProperties(Matrix& jacobian)

GetSolutionProperties(Xform& currentHand)

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::GetSolutionProperties unsigned int &    iterationCount const
 

Get the Solution Properties.

This method is used to determine the solution properties of the inverse.

Parameters:
iterationCount On return, iterationCount contains the number of iterations it took to find the inverse solution.
Returns:
The MOT calculated in the inverse.
See also:
GetSolutionProperties()

GetSolutionProperties(double& errorMagnitude)

GetSolutionProperties(Matrix& jacobian)

GetSolutionProperties(Xform& currentHand)

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::GetSolutionProperties void    const
 

Get the Solution Properties.

This method is used to determine the solution properties of the inverse.

Returns:
The MOT calculated in the inverse.
See also:
GetSolutionProperties(unsigned int& iteration)

GetSolutionProperties(double& errorMagnitude)

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::inverse   [protected, virtual]
 

Reimplemented in OSCAR::IKJAvoidLimits< JacobianType >, OSCAR::IKJReconfig< JacobianType >, and OSCAR::IKJReconfig< >.

template<class JacobianType = FKJacobian>
IKJacobian& OSCAR::IKJacobian< JacobianType >::operator= const IKJacobian< JacobianType > &    rhs
 

Assignment operator.

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

Parameters:
rhs An IKJacobian 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.

template<class JacobianType = FKJacobian>
bool OSCAR::IKJacobian< JacobianType >::SetErrorTolerance double    maxErrorVal,
double    rotScale
 

Set the Error Tolerance.

This method is used to set the Error Tolerance. IKJacobian 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.

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJacobian< JacobianType >::SetJointPosition const JointVector   jointPosition [virtual]
 

Set the Joint Position.

This method is used to reset to a new internal joint position state. This is necessary when you want to arbitrarily start the inverse solution at a joint configuraiton that is different from where it previously was.

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

template<class JacobianType = FKJacobian>
void OSCAR::IKJacobian< JacobianType >::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. IKJacobian 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()

template<class JacobianType = FKJacobian>
void OSCAR::IKJacobian< JacobianType >::SetMinimumMOT double    minMOT
 

Set the Minimum Measure of Transmissibity(MOT).

This method is used to change the minimum MOT (Measure of Transmissibity, also referred to as the Measure of Manipulability) allowed in the system. The minimum MOT is basically the minium tolerable value of the determinant of the Jacobian matrix. Any value lower than this will flag a singularity.

Parameters:
minMOT The new minimum MOT for the system.
See also:
GetMinimumMOT()

template<class JacobianType = FKJacobian>
virtual void OSCAR::IKJacobian< JacobianType >::updateKinematicState JointVector   jointPosition [protected, virtual]
 

Reimplemented in OSCAR::IKJReconfig< JacobianType >, and OSCAR::IKJReconfig< >.


Member Data Documentation

template<class JacobianType = FKJacobian>
const Xform* OSCAR::IKJacobian< JacobianType >::currentHand [protected]
 

template<class JacobianType = FKJacobian>
unsigned int OSCAR::IKJacobian< JacobianType >::currentIteration [protected]
 

template<class JacobianType = FKJacobian>
const Matrix* OSCAR::IKJacobian< JacobianType >::currentJacobian [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJacobian< JacobianType >::currentJointVector [protected]
 

template<class JacobianType = FKJacobian>
Xform OSCAR::IKJacobian< JacobianType >::desiredXform [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJacobian< JacobianType >::differentialJointVector [protected]
 

template<class JacobianType = FKJacobian>
unsigned int OSCAR::IKJacobian< JacobianType >::DOF [protected]
 

template<class JacobianType = FKJacobian>
HandPose OSCAR::IKJacobian< JacobianType >::errorHandVector [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::errorMag [protected]
 

template<class JacobianType = FKJacobian>
JacobianType* OSCAR::IKJacobian< JacobianType >::fowkin [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJacobian< JacobianType >::initialJointVector [protected]
 

template<class JacobianType = FKJacobian>
bool OSCAR::IKJacobian< JacobianType >::internalSolverFlag [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJacobian< JacobianType >::jointVelocity [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::maxError [protected]
 

template<class JacobianType = FKJacobian>
unsigned int OSCAR::IKJacobian< JacobianType >::maxIterations [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::minimumMOT [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::MOT [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJacobian< JacobianType >::previousJointVector [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJacobian< JacobianType >::rotationScale [protected]
 

template<class JacobianType = FKJacobian>
EqnSolver* OSCAR::IKJacobian< JacobianType >::solver [protected]
 


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