Class InvKin

java.lang.Object
  |
  +--InvKin
Direct Known Subclasses:
PlanarInvKin, PumaInvKin, ScorbotInvKin

public abstract class InvKin
extends java.lang.Object
implements java.lang.Cloneable

An abstract class to encapsulate the functionality required to perform the inverse kinematics calculations required by the Robot object to execute Command.MOVE_XYZ or Command.GOTO_XYZ commands.

See Also:
JointVariables, Command

Field Summary
protected  double TO_DEGREES
          Conversion constant, to convert from radians to degrees.
protected  double TO_RADIANS
          Conversion constant, to convert from degrees to radians.
 
Constructor Summary
protected InvKin()
          Creates a new InvKin object.
 
Method Summary
abstract  java.lang.Object clone()
          Implements the clone() method, returning an Object copy of this object.
 JointVariables getJointVariables()
          Get the JointVariables object.
abstract  JointVariables getJointVariables(javax.vecmath.Point3d target)
          Returns the closest solution in JointVariables form, if a solution exists, otherwise returns null.
static InvKin loadKinematics(java.lang.String s)
          Loads the InvKin class specified by the given String.
 void setJointVariables(JointVariables joints)
          Sets the JointVariables object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_DEGREES

protected final double TO_DEGREES
Conversion constant, to convert from radians to degrees.

TO_RADIANS

protected final double TO_RADIANS
Conversion constant, to convert from degrees to radians.
Constructor Detail

InvKin

protected InvKin()
Creates a new InvKin object. This constructor is private to prevent direct instantiation; use loadParser to load an instance of a specific inverse kinematic object.
Method Detail

setJointVariables

public void setJointVariables(JointVariables joints)
Sets the JointVariables object.
Parameters:
joints - the new JointVariables object.

getJointVariables

public JointVariables getJointVariables()
Get the JointVariables object.
Returns:
the current JointVariables object.

getJointVariables

public abstract JointVariables getJointVariables(javax.vecmath.Point3d target)
                                          throws OutOfRangeException
Returns the closest solution in JointVariables form, if a solution exists, otherwise returns null. Modified from the equations given in Craig, "Introduction to Robotics". Note that the desired pitch angle is implicitly equal to the current pitch, and the desired roll angle is the current roll.
Parameters:
target - the target Point3d to use to find the solution.
Throws:
OutOfRangeException - raised when the requested point has no solutions.

loadKinematics

public static InvKin loadKinematics(java.lang.String s)
                             throws InvKinException
Loads the InvKin class specified by the given String.
Parameters:
s - the name of the InvKin class to be loaded.
Returns:
an instance of the requested InvKin class.
Throws:
InvKinException - indicates an error loading the class.

clone

public abstract java.lang.Object clone()
Implements the clone() method, returning an Object copy of this object.
Returns:
an Object copy of this InvKin instance.
Overrides:
clone in class java.lang.Object