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

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

IKJacobian with Damped Least Square (DLS) technique. More...

#include <IKJDLS.h>

Inheritance diagram for OSCAR::IKJDLS< JacobianType >:

Inheritance graph
[legend]
List of all members.

Public Methods

 IKJDLS (const JointVector &initialJointPosition, JacobianType *fk, DLSEqnSolver *solver, OSCARError &err=DUMMY_ERROR(noError))
virtual ~IKJDLS ()
virtual bool GetJointPosition (const Xform &desiredHandMatrix, JointVector &jointPosition)
virtual bool GetJointPosition (const HandPose &desiredHand, JointVector &jointPosition)
virtual bool GetDifferentialJointPosition (const Xform &desiredHandMatrix, JointVector &differentialJointPosition)
virtual bool GetDifferentialJointPosition (const HandPose &desiredHand, JointVector &differentialJointPosition)
virtual bool GetJointVelocity (const HandPose &handVelocity, JointVector &jointVelocitySolution)
void SetMaxDampingFactor (double maxDamping)
bool SetErrorTolerances (double maxTransError, double maxRotError)
bool GetErrorTolerances (double &maxTransError, double &maxRotError) const

Protected Methods

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

Protected Attributes

double maxDamping
double maxTransError
double maxRotError
double transError
double rotError

Detailed Description

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

Author:
Chalongrath Pholsiri
This is basically an IKJacobian with the dampep least square (DLS) technique. DLS is used to help find the IK solution even at or near singularities. It will give the same solution as IKJacobian outside of singularities. When MOT reaches the specified minimum MOT, DLS kicks in and the robot can continue its path with a small amount of error.


Constructor & Destructor Documentation

template<class JacobianType = FKJacobian>
OSCAR::IKJDLS< JacobianType >::IKJDLS const JointVector   initialJointPosition,
JacobianType *    fk,
DLSEqnSolver   solver,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the constructor for an object of type IKJDLS. Use this Constructor to create an IKGOMitsubishi object from an IKMitsubishi object and an initial joint position.

Parameters:
initialJointPosition A DOF length vector of initial joint positions. This position will be used to create the object and should not be singular.
fk 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.
solver A pointer to DLSEqnSolver used to solve a set of linear equations.
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.
Exceptions:
vectorSizeMismatch vectorSizeMismatch

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


Member Function Documentation

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

Reimplemented from OSCAR::IKJacobian< JacobianType >.

template<class JacobianType = FKJacobian>
void OSCAR::IKJDLS< JacobianType >::computeDamping   [protected]
 

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

Reimplemented from OSCAR::IKJacobian< JacobianType >.

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJDLS< JacobianType >::GetDifferentialJointPosition const HandPose   desiredHand,
JointVector   differentialJointPosition
[virtual]
 

Get the differential joint position.

This method is used to get the differential joint position solution for an end-effector position. Basically, it solves the equation J dq = dx, where J is the Jacobian matrix, dq is the differential joint position, and dx is the differential end effector position.

Parameters:
desiredHand A handpose vector representing the desired end-effector position. dx will be computed as the difference of this desiredHand and the current handpose vector. For this method to give a valid result, desiredHand must be an infinitesimal deviation from the current handpose vector.
differentialJointPosition A DOF long vector (where DOF is the number of joints or degrees of freedom).
error The estimate of error mostly caused by DLS.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
See also:
GetDifferentialJointPosition(const Xform& handXform, JointVector& differentialJointPosition)

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJDLS< JacobianType >::GetDifferentialJointPosition const Xform   desiredHandMatrix,
JointVector   differentialJointPosition
[virtual]
 

Get the differential joint position.

This method is used to get the differential joint position solution for an end-effector position. Basically, it solves the equation J dq = dx, where J is the Jacobian matrix, dq is the differential joint position, and dx is the differential end effector position.

Parameters:
desiredHandMatrix A transform matrix representing the desired end-effector position. dx will be computed as the difference of this desiredHandMatrix and the current hand matrix. For this method to give a valid result, desiredHandMatrix must be an infinitesimal deviation from the current hand matrix.
differentialJointPosition A DOF long vector (where DOF is the number of joints or degrees of freedom).
error The estimate of error mostly caused by DLS.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
See also:
GetDifferentialJointPosition(const HandPose& desiredHand, JointVector& differentialJointPosition)

template<class JacobianType = FKJacobian>
bool OSCAR::IKJDLS< JacobianType >::GetErrorTolerances double &    maxTransError,
double &    maxRotError
const
 

Get the value of the Error Tolerance.

This method is used to get the value of the Error Tolerances; the maximum translational and rotational errors.

Parameters:
maxTransError On return, maxTransError contains the maximum tolerable translational error.
maxRotError On return, maxRotError contains the maximum tolerable rotational error.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.

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

GetSolutionProperties()

Reimplemented from OSCAR::IKJacobian< JacobianType >.

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

GetSolutionProperties()

Reimplemented from OSCAR::IKJacobian< JacobianType >.

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

GetSolutionProperties()

Reimplemented from OSCAR::IKJacobian< JacobianType >.

template<class JacobianType = FKJacobian>
bool OSCAR::IKJDLS< JacobianType >::SetErrorTolerances double    maxTransError,
double    maxRotError
 

Set the Error Tolerances.

This method is used to set the Error Tolerance. IKJDLS uses an iterative algorithm to find the inverse solution. As such, this algorithm stops iterating when both translational and rotational errors fall below their preset values. This method replaces SetErrorTolerance(double maxErrorVal, double rotScale) in IKJacobian. The default translational error as specified in the constructor is 0.l units and the rotational error is 0.5 deg.

Parameters:
maxTransError The maximum tolerable translational error (in the same unit as link lengths in DH parameters).
maxRotError The maximum tolerable rotationl error in degrees.
Returns:
True if the method succeeds. Otherwise False. Call GetError() to get detailed error information.

template<class JacobianType = FKJacobian>
void OSCAR::IKJDLS< JacobianType >::SetMaxDampingFactor double    maxDamping
 

Set the maximum amount of the damping factor.

The damping factor will be determined based on maxDamping, MOT, and minMOT: damping = maxDamping*(1-MOT/minMOT)^2 if MOT < minMOT and damping = 0 otherwise. This will ensure that (1) IKJDLS gives the exact solution outside of singularities and (2) the solution obtained is smooth and continuous.

Parameters:
maxDamping The maximum damping factor. Must be non-negative. If a negative number is passed, it'll be converted to positive.


Member Data Documentation

template<class JacobianType = FKJacobian>
double OSCAR::IKJDLS< JacobianType >::maxDamping [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJDLS< JacobianType >::maxRotError [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJDLS< JacobianType >::maxTransError [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJDLS< JacobianType >::rotError [protected]
 

template<class JacobianType = FKJacobian>
double OSCAR::IKJDLS< JacobianType >::transError [protected]
 


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