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

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

Generates a set of inverse kinematics solutions for redundant serial manipulators. More...

#include <IKJGenerateOptions.h>

Inheritance diagram for OSCAR::IKJGenerateOptions< JacobianType >:

Inheritance graph
[legend]
List of all members.

Public Types

enum  NullJointMethod { Exact, Approximate }

Public Methods

 IKJGenerateOptions (const JointVector &initialJointPosition, IKJacobian< JacobianType > *ik, Perturbation *perturb, NullJointMethod method=Approximate, OSCARError &err=DUMMY_ERROR(noError))
 IKJGenerateOptions (const IKJGenerateOptions &rhs)
IKJGenerateOptions & operator= (const IKJGenerateOptions &rhs)
virtual ~IKJGenerateOptions ()
virtual bool GetJointPositions (const Xform &desiredHandMatrix, VectorArray &jointPositions)
virtual bool GetJointPositions (const HandPose &desiredHand, VectorArray &jointPositions)
bool GetJointPosition (JointVector &jointPosition) const
bool SetJointPosition (const JointVector &jointPosition)
int SetNullJoints (const CoordinateStatusArray &nullJoints)
bool SetNullJointMethod (const NullJointMethod method)
bool GetSolutionProperties (Vector &MOTs) const
bool GetSolutionProperties (BoolArray &validity) const
void Reallocate (unsigned int noOptions)

Protected Attributes

unsigned int DOF
unsigned int noOfOptions
IKJacobian< JacobianType > * invkin
Perturbationperturbation
JointVectorcurrentJointVector
JointVectorbaseSolution
JointVectorbaseJointVector
VectorArrayperturbedJoints
JointVectorsolution
JointVectorperturbedJoint
NullJointMethod nullJoint
VectorMOTs
BoolArrayvalids

Detailed Description

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

Author:
Chalongrath Pholsiri
IKJGenerateOptions generates a set of inverse kinematics solutions for redundant serial manipulators using Perturbation, generalized inverse of Jacobian, and the Resolved Rate technique. This approach first solves for the base solution using an IKJacobian object with all joints active. From the base solution, joint perturbations are performed using Perturbation object. The number of generated options depends on the search pattern and the number of joints to be perturbed. From these perturbations, The IKJacobian is used again to find the solutions. The joint solutions then can be supplied to a criteria fusion or decision making scheme to determine what the best solution is according to the given set of criteria. This class also takes a template parameter that defines the forward kinematics object that is to be used by the internal IKJacobian object. This class must derive from Kinematics, FKPositionBase and FKJacobianBase. This template parameter is defaulted to FKJacobian. An object using the default parameter can be initialized as follows:
IKJGenerateOptions<> myIK(...);


Member Enumeration Documentation

template<class JacobianType = FKJacobian>
enum OSCAR::IKJGenerateOptions::NullJointMethod
 

Enumeration values:
Exact 
Approximate 


Constructor & Destructor Documentation

template<class JacobianType = FKJacobian>
OSCAR::IKJGenerateOptions< JacobianType >::IKJGenerateOptions const JointVector   initialJointPosition,
IKJacobian< JacobianType > *    ik,
Perturbation   perturb,
NullJointMethod    method = Approximate,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the constructor for an object of type IKJGenerateOptions. Use this to create an IKJGenerateOptions object from an IKJacobian object, an Perturbation object and an initial joint position. This class uses the inverse kinematics calculations from the IKJacobian class. As such, all functionality for setting min MOT, max error, etc. should be done through the IKJacobian object. Similarly, it uses Perturbation to generate options around a base solution obtained from IKJacobian. Thus, all functionality for setting perturbation values should be done through the Perturbation 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.
ik A pointer to an object of IKJacobian type. This object will be used to generate the inverse solutions. IKJacobian uses pseudoinverse for the solution in case of redundant robots. The user can also use an object of a class that is derived from IKJacobian if a custom inverse solution is needed. For example, one can create an IK class that uses inertia-weighted pseudoinverse to solve the inverse.
perturb A pointer to an Perturbation object. This object will be used to generate a set of joint perturbations around the base solution. The joint solutions will be solved from these perturbations.
method An IKJGenerateOptions::RRNullJointMethod object specifying which type of method to use for generating null space solutions: Approximate or Exact. The default is Approximate.
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>
OSCAR::IKJGenerateOptions< JacobianType >::IKJGenerateOptions const IKJGenerateOptions< JacobianType > &    rhs
 

Copy Constructor.

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

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

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

Destructor.

This is the destructor for an object of type IKJGenerateOptions.


Member Function Documentation

template<class JacobianType = FKJacobian>
bool OSCAR::IKJGenerateOptions< JacobianType >::GetJointPosition JointVector   jointPosition const
 

Get the current joint state of the system.

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 successful. 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::IKJGenerateOptions< JacobianType >::GetJointPositions const HandPose   desiredHand,
VectorArray   jointPositions
[virtual]
 

Get a set of joint positions for an end-effector position represented by an HandPose object.

This method is used to get a set of joint positions for an end-effector position represented by an HandPose object.

Parameters:
desiredHand A handpose vector representing the desired end-effector position.
jointPositions A VectorArray object to store the solutions. The vector size is DOF. The array size must be equal to the number of options and can be queried from the Perturbation object supplied to the constructor.
Returns:
True if successful. Otherwise False. Call GetError() to get detailed error information. Note that a return of True from this function does NOT necessarily mean that all of the calculated solutions are valid, and that the validity of each solution returned in jointPositions must be checked using GetSolutionProperties
Exceptions:
singularity singularity
minMOTMReached minMOTReached
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
arraySizeMismatch arraySizeMismatch
See also:
GetJointPositions(const Xform& desiredHandMatrix, VectorArray& jointPositions)

template<class JacobianType = FKJacobian>
virtual bool OSCAR::IKJGenerateOptions< JacobianType >::GetJointPositions const Xform   desiredHandMatrix,
VectorArray   jointPositions
[virtual]
 

Get a set of joint solutions for an end-effector position represented by an Xform object.

This method is used to get a set of joint solutions for an end-effector position represented by an Xform object.

Parameters:
desiredHandMatrix A transform matrix representing the desired end-effector position.
jointPositions A VectorArray object to store the solutions. The vector size is DOF. The array size must be equal to the number of options and can be queried from the Perturbation object supplied to the constructor.
Returns:
True if successful. Otherwise False. Call GetError() to get detailed error information.
Exceptions:
singularity singularity
minMOTReached minMOTReached
maxIterationCountReached maxIterationCountReached
vectorSizeMismatch vectorSizeMismatch
arraySizeMismatch arraySizeMismatch
See also:
GetJointPositions(const HandPose& desiredHand, VectorArray& solutions)

template<class JacobianType = FKJacobian>
bool OSCAR::IKJGenerateOptions< JacobianType >::GetSolutionProperties BoolArray   validity const
 

Determine solution properties of the inverse.

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

Parameters:
validity An RRBoolArray returning the validity of each solution.
Returns:
True if successful. Otherwise False. Call GetError() to get detailed error information.
See also:
GetSolutionProperties(Vector& MOTs)

template<class JacobianType = FKJacobian>
bool OSCAR::IKJGenerateOptions< JacobianType >::GetSolutionProperties Vector   MOTs const
 

Determine solution properties of the inverse.

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

Parameters:
MOTs A Vector returning MOT of each solution. Note that MOT will be significantly larger when using Approximate method than Exact. This is becaue when using Approximate, MOT is calculated using the whole Jacobian whereas only the partial Jacobian is used in Exact.
Returns:
True if successful. Otherwise False. Call GetError() to get detailed error information.
See also:
GetSolutionProperties(RRBoolArray& validities)

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

Assignment operator.

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

Parameters:
rhs An IKJGenerateOptions 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>
void OSCAR::IKJGenerateOptions< JacobianType >::Reallocate unsigned int    noOptions
 

Reallocate memory for storing the solution properties.

This method is used to reallocate memory for storing the solutions properties. Call this function if you call any function in Perturbation object that can change the number of options such as Perturbation::SetSearchPatter().

Parameters:
noOptions The number of options which can be queried from Perturbation::GetNoOfOptions().

template<class JacobianType = FKJacobian>
bool OSCAR::IKJGenerateOptions< JacobianType >::SetJointPosition const JointVector   jointPosition
 

Set a new internal joint position state.

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. Also call this method the best solution after redundancy has been resolved.

Returns:
True if jointPosition is of size DOF. Otherwsie False. Call GetError() to get detailed error information.
Parameters:
jointPosition An JointVector of size DOF that specifies the new joint angle state in Radians.
Exceptions:
vectorSizeMismatch vectorSizeMismatch
See also:
GetJointPosition(const JointVector& jointPosition)

template<class JacobianType = FKJacobian>
bool OSCAR::IKJGenerateOptions< JacobianType >::SetNullJointMethod const NullJointMethod    method
 

Set the method from which to generate the null space solutions.

This method is used to set the method from which to generate the null space solutions.

Parameters:
method The desired method: Exact or Approximate.
Returns:
True if successful. Otherwise False. Call GetError() to get detailed error information.

template<class JacobianType = FKJacobian>
int OSCAR::IKJGenerateOptions< JacobianType >::SetNullJoints const CoordinateStatusArray   nullJoints
 

Set the joints to perturb.

This method is used tp set the joints to perturb.

Parameters:
nullJoints An RRCoordinateStatusArray object of size DOF indicating which joints to perturb. Set the joints to be perturbed as 'Active'. Example, for a 2-DOF robot, if we want joint 1 to be perturbed and joint 2 not to. RRCoordinateStatusArray nullJoints(2); nullJoints.at(0) = Active; nullJoints.at(1) = Inactive;
Returns:
The number of options to be generated. Return -1 if the size of nullJoints array is not DOF. Call GetError() to get detailed error information.
See also:
Reallocate(unsigned int noOptions)


Member Data Documentation

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJGenerateOptions< JacobianType >::baseJointVector [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJGenerateOptions< JacobianType >::baseSolution [protected]
 

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

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

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

template<class JacobianType = FKJacobian>
Vector* OSCAR::IKJGenerateOptions< JacobianType >::MOTs [protected]
 

template<class JacobianType = FKJacobian>
unsigned int OSCAR::IKJGenerateOptions< JacobianType >::noOfOptions [protected]
 

template<class JacobianType = FKJacobian>
NullJointMethod OSCAR::IKJGenerateOptions< JacobianType >::nullJoint [protected]
 

template<class JacobianType = FKJacobian>
Perturbation* OSCAR::IKJGenerateOptions< JacobianType >::perturbation [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJGenerateOptions< JacobianType >::perturbedJoint [protected]
 

template<class JacobianType = FKJacobian>
VectorArray* OSCAR::IKJGenerateOptions< JacobianType >::perturbedJoints [protected]
 

template<class JacobianType = FKJacobian>
JointVector* OSCAR::IKJGenerateOptions< JacobianType >::solution [protected]
 

template<class JacobianType = FKJacobian>
BoolArray* OSCAR::IKJGenerateOptions< JacobianType >::valids [protected]
 


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