com.yobotics.simulationconstructionset
Class Joint

java.lang.Object
  extended by com.yobotics.simulationconstructionset.Joint
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FloatingJoint, FloatingPlanarJoint, FreeJoint, NullJoint, PinJoint, SliderJoint

public abstract class Joint
extends java.lang.Object
implements java.io.Serializable

Title: Yobotics! Simulation Construction Set

Description: Package for Simulating Dynamic Robots and Mechanisms

Copyright: Copyright (c) Jerry Pratt

Company: Yobotics, Inc.

Version:
Beta 1.0
Author:
Jerry Pratt
See Also:
Serialized Form

Field Summary
static double MAX_ROT_ACCEL
          The maximum rotational acceleration this joint may undergo before throwing an UnreasonableAccelerationException.
static double MAX_TRANS_ACCEL
          The maximum translational acceleration this joint may undergo before throwing an UnreasonableAccelerationException.
static int X
          Identifier for the X axis used on creation for pin and slider joints to determine their joint axis.
static int Y
          Identifier for the Y axis used on creation for pin and slider joints to determine their joint axis.
static int Z
          Identifier for the Z axis used on creation for pin and slider joints to determine their joint axis.
 
Method Summary
 void addCameraMount(CameraMount mount)
          Adds the specified camera mount to this joint.
 void addExternalForcePoint(ExternalForcePoint point)
          Adds the specified ExternalForcePoint.
 void addGroundContactPoint(GroundContactPoint point)
          Adds the specified GroundContactPoint to this joint.
 void addJoint(Joint nextJoint)
          Adds the specified joint as a child of this joint.
 void addKinematicPoint(KinematicPoint point)
          Adds the specified KinematicPoint to this joint.
 void addRangeSensor(RangeSensor rangeSensor)
          Adds the specified range sensor to this joint.
 void changeOffsetVector(double x, double y, double z)
          Changes the offset between the current joint and its parent joint based on the provided x, y, and z components.
 void changeOffsetVector(javax.vecmath.Vector3d newOffsetVector)
          Changes the offset between the current joint and its parent joint.
 double[] get3DRotation()
           
 java.util.ArrayList<Joint> getChildrenJoints()
           
 java.util.ArrayList<ExternalForcePoint> getExternalForcePoints()
           
 GroundContactPointGroup getGroundContactPointGroup()
           
 void getJointAxis(javax.vecmath.Vector3d axisToPack)
           
 void getKinematicPoints(java.util.ArrayList<KinematicPoint> list)
          Returns a list of the kinematic points associated with this joint.
 Link getLink()
          Retrieves the link associated with this joint.
 java.lang.String getName()
          Retrieves the joint name.
 void getOffset(javax.vecmath.Vector3d offsetToPack)
           
 void getRotationFromWorld(javax.vecmath.Matrix3d rotation)
          Retrieves the rotational component of the transform between world space and this joint space.
 void getRotationFromWorld(javax.vecmath.Quat4d rotation)
          Retrieves the quaternion representation of the rotational component of the transform between world space and this joint space.
 void getTransformFromWorld(javax.vecmath.Quat4d rotation, javax.vecmath.Vector3d translation)
          Sets rotation and translation to the rotational and translational components of the the transform between world space and this joint space.
 void getTransformToWorld(javax.media.j3d.Transform3D ret)
          Sets ret to the transform between world space and this joint space.
 void getTranslationFromWorld(javax.vecmath.Vector3d translation)
          Retrieves the translational component of the transform between world space and this joint space in vector form.
 javax.vecmath.Vector3d getUnitVector()
           
 void getXYZFromWorld(DoubleYoVariable x, DoubleYoVariable y, DoubleYoVariable z)
          Stores the x, y, and z components of the translation between world space and joint space in the provided YoVariables.
 void getYawPitchRollFromWorld(DoubleYoVariable yaw, DoubleYoVariable pitch, DoubleYoVariable roll)
          Retrieves the rotation between world space and joint space in terms of yaw, pitch and roll.
 boolean isDynamic()
          Indiciates whether or not this joint is dynamic.
 void recursiveDecideGroundContactPointsInContact()
          Recurse through the tree deciding if any ground contact points are in contact.
 void recursiveGetChildrenJoints(java.util.ArrayList<Joint> arrayListToPack)
           
 void recursiveUpdateAllGroundContactPointVelocities()
          This function is called once per simulation tick to update the velocities of all ground contact points.
 void setDynamic(boolean isDynamic)
          Specify whether or not this particular joint is dynamic.
 void setLink(Link l)
          Sets the link for this joint.
 java.lang.String toString()
          Returns a string representation of this joint.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_TRANS_ACCEL

public static final double MAX_TRANS_ACCEL
The maximum translational acceleration this joint may undergo before throwing an UnreasonableAccelerationException.

See Also:
Constant Field Values

MAX_ROT_ACCEL

public static final double MAX_ROT_ACCEL
The maximum rotational acceleration this joint may undergo before throwing an UnreasonableAccelerationException.

See Also:
Constant Field Values

X

public static final int X
Identifier for the X axis used on creation for pin and slider joints to determine their joint axis.

See Also:
Constant Field Values

Y

public static final int Y
Identifier for the Y axis used on creation for pin and slider joints to determine their joint axis.

See Also:
Constant Field Values

Z

public static final int Z
Identifier for the Z axis used on creation for pin and slider joints to determine their joint axis.

See Also:
Constant Field Values
Method Detail

getChildrenJoints

public java.util.ArrayList<Joint> getChildrenJoints()

recursiveGetChildrenJoints

public void recursiveGetChildrenJoints(java.util.ArrayList<Joint> arrayListToPack)

getName

public java.lang.String getName()
Retrieves the joint name.

Returns:
Name of this joint as specified at construction.

getUnitVector

public javax.vecmath.Vector3d getUnitVector()

getJointAxis

public void getJointAxis(javax.vecmath.Vector3d axisToPack)

changeOffsetVector

public void changeOffsetVector(javax.vecmath.Vector3d newOffsetVector)
Changes the offset between the current joint and its parent joint.

Parameters:
newOffsetVector - Vector3d representing this new offset.

changeOffsetVector

public void changeOffsetVector(double x,
                               double y,
                               double z)
Changes the offset between the current joint and its parent joint based on the provided x, y, and z components.

Parameters:
x - Component of the new offset vector.
y - Component of the new offset vector.
z - Component of the new offset vector.

isDynamic

public boolean isDynamic()
Indiciates whether or not this joint is dynamic. By default, all joints are dynamic meaning they are used during dynamics calculations. Non dynamic root joints only deal with position and velocity through Featherstone pass one. They also store values for runge-kutta calculations.

Returns:
Is this joint dynamic?

setDynamic

public void setDynamic(boolean isDynamic)
Specify whether or not this particular joint is dynamic. This only matters if the joint is a root joint.

Parameters:
isDynamic - Indicate whether or not the joint is dynamic, which is true by default.

toString

public java.lang.String toString()
Returns a string representation of this joint. This includes the joint's name, its parent joint, offset vector, link, and all associated kinematic and external force points. Once this information is displayed the joint calls toString for each of it's children.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this joint and its children.

addJoint

public void addJoint(Joint nextJoint)
Adds the specified joint as a child of this joint. This function also handles all setup necessary for back tracking from child to parent. Each joint must have an associated link before being added.

Parameters:
nextJoint - Child joint to be added.

addCameraMount

public void addCameraMount(CameraMount mount)
Adds the specified camera mount to this joint. A single joint may contain multiple mounts.

Parameters:
mount - CameraMount to be added.
See Also:
CameraMount

addRangeSensor

public void addRangeSensor(RangeSensor rangeSensor)
Adds the specified range sensor to this joint.

Parameters:
rangeSensor - RangeSensor to be added at this joint.
See Also:
RangeSensor

addKinematicPoint

public void addKinematicPoint(KinematicPoint point)
Adds the specified KinematicPoint to this joint. These points allow external forces and effects to be applied while also providing a means to monitor position and velocity. Currently the only implementation internal to SCS is the ExternalForcePoint.

Parameters:
point - KinematicPoint to be added.
See Also:
KinematicPoint

addExternalForcePoint

public void addExternalForcePoint(ExternalForcePoint point)
Adds the specified ExternalForcePoint. These points allow forces to be applied to particular joints allowing the creation of certain mechanical structures such as four-bar-linkages. See the tutorial for further details.

Parameters:
point - ExternalForcePoint
See Also:
ExternalForcePoint

addGroundContactPoint

public void addGroundContactPoint(GroundContactPoint point)
Adds the specified GroundContactPoint to this joint. These points allow ground contact modeling to occur which provides a means of robot ground interaction. For further examples see the tutorial.

Parameters:
point - GroundContactPoint
See Also:
GroundContactPoint, GroundContactModel

getGroundContactPointGroup

public GroundContactPointGroup getGroundContactPointGroup()

getLink

public Link getLink()
Retrieves the link associated with this joint. Every joint has a member link which handels the physical and graphical properties of the space between this joint and its children. This includes the link mass and related properties.

Returns:
The link belonging to this joint.

getOffset

public void getOffset(javax.vecmath.Vector3d offsetToPack)

setLink

public void setLink(Link l)
Sets the link for this joint. If a previous link existed it is replaced, removing all graphics.

Parameters:
l - New link for this joint.

getKinematicPoints

public void getKinematicPoints(java.util.ArrayList<KinematicPoint> list)
Returns a list of the kinematic points associated with this joint. (Added by Stelian).

Parameters:
list - ArrayList to which the points are added.
See Also:
KinematicPoint

getExternalForcePoints

public java.util.ArrayList<ExternalForcePoint> getExternalForcePoints()

getTransformToWorld

public void getTransformToWorld(javax.media.j3d.Transform3D ret)
Sets ret to the transform between world space and this joint space.

Parameters:
ret - Transform3D

getTransformFromWorld

public void getTransformFromWorld(javax.vecmath.Quat4d rotation,
                                  javax.vecmath.Vector3d translation)
Sets rotation and translation to the rotational and translational components of the the transform between world space and this joint space.

Parameters:
rotation - Quat4d representation of the rotational component.
translation - Vector3d representation of the traslational component.

getRotationFromWorld

public void getRotationFromWorld(javax.vecmath.Matrix3d rotation)
Retrieves the rotational component of the transform between world space and this joint space.

Parameters:
rotation - Matrix3d containing the rotational component.

getRotationFromWorld

public void getRotationFromWorld(javax.vecmath.Quat4d rotation)
Retrieves the quaternion representation of the rotational component of the transform between world space and this joint space.

Parameters:
rotation - Quat4d to store the rotational transform.

getTranslationFromWorld

public void getTranslationFromWorld(javax.vecmath.Vector3d translation)
Retrieves the translational component of the transform between world space and this joint space in vector form.

Parameters:
translation - Vector3d representing the translation between world and joint space.

getXYZFromWorld

public void getXYZFromWorld(DoubleYoVariable x,
                            DoubleYoVariable y,
                            DoubleYoVariable z)
Stores the x, y, and z components of the translation between world space and joint space in the provided YoVariables.

Parameters:
x - YoVariable to store the x component.
y - YoVariable to store the y component.
z - YoVariable to store the z component.

getYawPitchRollFromWorld

public void getYawPitchRollFromWorld(DoubleYoVariable yaw,
                                     DoubleYoVariable pitch,
                                     DoubleYoVariable roll)
Retrieves the rotation between world space and joint space in terms of yaw, pitch and roll. These values are stored in the provided YoVariables.

Parameters:
yaw - YoVariable to store yaw.
pitch - YoVariable to store pitch.
roll - YoVariable to store roll.

get3DRotation

public double[] get3DRotation()

recursiveDecideGroundContactPointsInContact

public void recursiveDecideGroundContactPointsInContact()
Recurse through the tree deciding if any ground contact points are in contact. This function builds the list of points in contact to be used during dynamics.


recursiveUpdateAllGroundContactPointVelocities

public void recursiveUpdateAllGroundContactPointVelocities()
This function is called once per simulation tick to update the velocities of all ground contact points. Without this function only those points currently in contact would be updated.