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

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

This class is used to calculate the inverse position solution using a weighting matrix based on the joint limits. More...

#include <IKJAvoidLimits.h>

Inheritance diagram for OSCAR::IKJAvoidLimits< JacobianType >:

Inheritance graph
[legend]
List of all members.

Public Methods

 IKJAvoidLimits (const JointVector &initialJointPosition, JacobianType *fkJacobian, MatrixData &limitsData, OSCARError &err=DUMMY_ERROR(noError), EqnSolver *solver=0, double maxError=0.1, double rtScale=1000.0)
 IKJAvoidLimits (JointVector &initialJointPosition, JacobianType *fkJacobian, const String &limitsFile, OSCARError &err=DUMMY_ERROR(noError), EqnSolver *solver=0, double maxError=0.1, double rtScale=1000.0)
 IKJAvoidLimits (const IKJAvoidLimits &rhs)
IKJAvoidLimits & operator= (const IKJAvoidLimits &rhs)
virtual ~IKJAvoidLimits ()
bool GetJointVelocity (const HandPose &handVelocity, JointVector &jointVelocitySolution)
bool SetLimits (const Matrix &limits, AngleUnits angleFlag=Degrees)
bool GetLimits (Matrix &limits, AngleUnits angleFlag=Degrees) const

Protected Methods

void ClearWeights ()
virtual bool inverse ()
bool computeWeightingMatrix (const JointVector &currJoints)
bool computeJointVectors (void)

Protected Attributes

Matrixweights
MatrixjointLimits
VectorjointMedian
VectorjointRange

Detailed Description

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

Author:
Peter S. March & Chetan Kapoor
This class is used to calculate the inverse position solution using a weighting matrix based on the joint limits. This inverse will always use this weighting matrix to perform its inverse solution. This inverse also uses the active/inactive functionality provided in JointVector and HandPose. If a joint is declared Inactive, that joint will not move. If an HandPose element is declared Inactive, that coordinate will not be used in the inverse (i.e. it will be free to move).This class takes a template parameter that defines the forward position 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:
IKAvoidLimits<> myIK(...);


Constructor & Destructor Documentation

template<class JacobianType = FKJacobian>
OSCAR::IKJAvoidLimits< JacobianType >::IKJAvoidLimits const JointVector   initialJointPosition,
JacobianType *    fkJacobian,
MatrixData   limitsData,
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 IKJAvoidLimits. Use this to construct an IKJAvoidLimits object from an FKJacobian object, an initial joint position and an MatrixData object containing joint limits data. This class uses the Jacobian calculations from the FKJacobian class to perform a Resolved Rate inverse solution. As such, all functionality for setting and retrieving tool points and base poses should be done through the FKJacobian object. This class is also designed to use the Active/Inactive functionality present in JointVector and HandPose to perform an inverse. If a joint is declared Inactive, that joint will not move. If an HandPose element is declared Inactive, that coordinate will not be used in the inverse (i.e. it will be free to move). If enough joints are locked to make this a sqare or over-constrained system, the inverse will no longer use the weighted psuedo-inverse. This is because this inverse will only work on redundant systems.

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.
limitsData An object containing the limits of the manipulator. These limits should be DOFx2.
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
badLimitsData badLimitsData

template<class JacobianType = FKJacobian>
OSCAR::IKJAvoidLimits< JacobianType >::IKJAvoidLimits JointVector   initialJointPosition,
JacobianType *    fkJacobian,
const String   limitsFile,
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 IKJAvoidLimits. Use this to construct an IKJAvoidLimits object from an FKJacobian class, an initial joint position and a filename of a file containing joint limits data. This class uses the Jacobian calculations from the FKJacobian class to perform a Resolved Rate inverse solution. As such, all functionality for setting and retrieving tool points and base poses should be done through the FKJacobian object. This class is also designed to use the Active/Inactive functionality present in JointVector and HandPose to perform an inverse. If a joint is declared Inactive, that joint will not move. If an HandPose element is declared Inactive, that coordinate will not be used in the inverse (i.e. it will be free to move). If enough joints are locked to make this a sqare or over- constrained system, the inverse will no longer use the weighted psuedo-inverse. This is because this inverse will only work on redundant systems.

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.
limitsFile The name of a file containing the limits of the manipulator. These limits should be DOFx2.
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
badLimitsData badLimitsData

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

Copy Constructor.

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

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

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

Virtual Destructor.

This is the Destructor for an IKJAvoidLimits object.


Member Function Documentation

template<class JacobianType = FKJacobian>
void OSCAR::IKJAvoidLimits< JacobianType >::ClearWeights   [protected]
 

template<class JacobianType = FKJacobian>
bool OSCAR::IKJAvoidLimits< JacobianType >::computeJointVectors void    [protected]
 

template<class JacobianType = FKJacobian>
bool OSCAR::IKJAvoidLimits< JacobianType >::computeWeightingMatrix const JointVector   currJoints [protected]
 

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

Use this method to get the current joint velocity vector from a HandPose velocity vector. Both the inputs (joint velocities) and the ouputs (EE velocities) can be set in this method.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
handVelocity An mx1 vector of handpose velocities. The Active/Inactive status of individual EE ouputs can be set here to perform an inverse where certain outputs are ignored.
jointVelocitySolution An nx1 vector to store the calculate joint velocities The Active/Inactive status of individual joint inputs can be set here to perform an inverse where certain joints do not move.
Exceptions:
singularity singularity
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const Xform& desiredHandMatrix, JointVector& jointPosition)

GetSolutionProperties()

Reimplemented from OSCAR::IKJReconfig< JacobianType >.

template<class JacobianType = FKJacobian>
bool OSCAR::IKJAvoidLimits< JacobianType >::GetLimits Matrix   limits,
AngleUnits    angleFlag = Degrees
const
 

Use this method to retrieve the current limits.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
limits This is a DOFx2 matrix that will contain the current joint limits of the robot.
angleFlag A flag to tell whether the limits should be stored in Degrees or Radians. This parameter defaults to Degrees.
Exceptions:
matrixSizeMismatch matrixSizeMismatch
See also:
SetLimits(const Matrix& limits, AngleUnits angleFlag=Degrees)

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

Reimplemented from OSCAR::IKJReconfig< JacobianType >.

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

Assignment operator.

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

Parameters:
rhs An IKJAvoidLimits 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::IKJAvoidLimits< JacobianType >::SetLimits const Matrix   limits,
AngleUnits    angleFlag = Degrees
 

Use this method to change the current limits.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
limits This is a DOFx2 matrix containing the new joint limits of the robot.
angleFlag A flag to tell whether the limits are being sent in Degrees or Radians. This parameter defaults to Degrees.
Exceptions:
badLimitsData badLimitsData
See also:
GetLimits(Matrix& limits, AngleUnits angleFlag=Degrees)


Member Data Documentation

template<class JacobianType = FKJacobian>
Matrix* OSCAR::IKJAvoidLimits< JacobianType >::jointLimits [protected]
 

template<class JacobianType = FKJacobian>
Vector* OSCAR::IKJAvoidLimits< JacobianType >::jointMedian [protected]
 

template<class JacobianType = FKJacobian>
Vector* OSCAR::IKJAvoidLimits< JacobianType >::jointRange [protected]
 

template<class JacobianType = FKJacobian>
Matrix* OSCAR::IKJAvoidLimits< JacobianType >::weights [protected]
 


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