Class Degree

java.lang.Object
  |
  +--Degree

public class Degree
extends java.lang.Object
implements java.lang.Cloneable

A class to encapsulate a degree of freedom in the Robot. This class has member fields which describe most of the Denavit-Hartenberg parameters required to represent the transformations from one degree of freedom to the next.

A Degree can be one of three types: revolute, prismatic, or inanimate. An inanimate degree of freedom is used merely as a placeholder in the Robot, and cannot be moved via Commands.

See Also:
Robot, Joint

Field Summary
static int TYPE_INANIMATE
          Specifies an inanimte degree of freedom, used as a placeholder.
static int TYPE_PRISMATIC
          Specifies a prismatic-type degree of freedom.
static int TYPE_REVOLUTE
          Specifies a revolute-type degree of freedom.
 
Constructor Summary
Degree()
          Creates and initializes a new degree of freedom.
 
Method Summary
 java.lang.Object clone()
          Implements the clone() method, returns an Object copy of the Degree.
 double getHome()
          Get the Degree's home variable value.
 double getMaximum()
          Gets the Degree's maximum variable value.
 double getMinimum()
          Gets the Degree's minimum variable value.
 java.lang.String getName()
          Gets the name of Degree.
 double getOffset()
          Gets the Degree's offset.
 javax.media.j3d.TransformGroup getTransformGroup()
          Returns the TransformGroup performing the Degree's transformation.
 double getTwist()
          Gets the Degree's twist.
 int getType()
          Gets the type of Degree: TYPE_REVOLUTE, TYPE_PRISMATIC, or TYPE_INANIMATE.
 double getVariable()
          Gets the Degree's variable.
 boolean inRange()
          Determines if the Degree's current variable is within variable range.
 boolean inRange(double variable)
          Determines if the given variable is within the Degree's range of motion.
 boolean isEmpty()
          Returns if the Degree is empty.
 void setHome(double home)
          Sets the Degree's home variable value.
 void setMaximum(double maximum)
          Sets the Degree's maximum variable value.
 void setMinimum(double minimum)
          Sets the Degree's minimum variable value.
 void setName(java.lang.String name)
          Sets the Degree's name.
 void setOffset(double offset)
          Sets the Degree's offset.
 void setTransformGroup(javax.media.j3d.TransformGroup transformGroup)
          Sets the TransformGroup required to transform from one degree to the next.
 void setTwist(double twist)
          Sets the Degree's twist.
 void setType(int type)
          Sets the type of Degree: TYPE_REVOLUTE, TYPE_PRISMATIC, or TYPE_INANIMATE.
 void setVariable(double variable)
          Sets the Degree's variable
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_REVOLUTE

public static final int TYPE_REVOLUTE
Specifies a revolute-type degree of freedom.

TYPE_PRISMATIC

public static final int TYPE_PRISMATIC
Specifies a prismatic-type degree of freedom.

TYPE_INANIMATE

public static final int TYPE_INANIMATE
Specifies an inanimte degree of freedom, used as a placeholder.
Constructor Detail

Degree

public Degree()
Creates and initializes a new degree of freedom.
Method Detail

setName

public void setName(java.lang.String name)
Sets the Degree's name.
Parameters:
name - the name for the Degree.

getName

public java.lang.String getName()
Gets the name of Degree.
Returns:
the name of the Degree.

setType

public void setType(int type)
Sets the type of Degree: TYPE_REVOLUTE, TYPE_PRISMATIC, or TYPE_INANIMATE.
Parameters:
type - the integer representation of the type of Degree.

getType

public int getType()
Gets the type of Degree: TYPE_REVOLUTE, TYPE_PRISMATIC, or TYPE_INANIMATE.
Returns:
an integer representation of the type of Degree.

setOffset

public void setOffset(double offset)
Sets the Degree's offset.
Parameters:
offset - the offset for the Degree.

getOffset

public double getOffset()
Gets the Degree's offset.
Returns:
the offset for the Degree.

setTwist

public void setTwist(double twist)
Sets the Degree's twist.
Parameters:
the - setting for the Degree twist (in degrees).

getTwist

public double getTwist()
Gets the Degree's twist.
Returns:
the Degree's twist (in degrees).

setMinimum

public void setMinimum(double minimum)
Sets the Degree's minimum variable value.
Parameters:
minimum - the minimum setting for the Degree variable.

getMinimum

public double getMinimum()
Gets the Degree's minimum variable value.
Returns:
the Degree's minimum variable value.

setMaximum

public void setMaximum(double maximum)
Sets the Degree's maximum variable value.
Parameters:
maximum - the maximum setting for the Degree variable.

getMaximum

public double getMaximum()
Gets the Degree's maximum variable value.
Returns:
the Degree's maximum variable value.

setHome

public void setHome(double home)
Sets the Degree's home variable value.
Parameters:
home - the home setting for the Degree variable.

getHome

public double getHome()
Get the Degree's home variable value.
Returns:
double the Degree's variable home value.

setVariable

public void setVariable(double variable)
Sets the Degree's variable
Parameters:
variable - the value for the Degree variable.

getVariable

public double getVariable()
Gets the Degree's variable.
Returns:
the Degree's variable value.

setTransformGroup

public void setTransformGroup(javax.media.j3d.TransformGroup transformGroup)
Sets the TransformGroup required to transform from one degree to the next.
Parameters:
transformGroup - performs the Degree's transformation.

getTransformGroup

public javax.media.j3d.TransformGroup getTransformGroup()
Returns the TransformGroup performing the Degree's transformation.
Returns:
the TransformGroup performing the transformation.

inRange

public boolean inRange(double variable)
Determines if the given variable is within the Degree's range of motion.
Parameters:
variable - the value to be range-tested.
Returns:
a boolean indicating if the variable is in the Degree's range.

inRange

public boolean inRange()
Determines if the Degree's current variable is within variable range.
Returns:
indicates if the current variable is within range of motion.

isEmpty

public boolean isEmpty()
Returns if the Degree is empty.
Returns:
indicates if the Degree object is empty.

clone

public java.lang.Object clone()
Implements the clone() method, returns an Object copy of the Degree.
Returns:
the Object copy of this object.
Overrides:
clone in class java.lang.Object