com.yobotics.simulationconstructionset
Class FreeJoint

java.lang.Object
  extended by com.yobotics.simulationconstructionset.Joint
      extended by com.yobotics.simulationconstructionset.FreeJoint
All Implemented Interfaces:
java.io.Serializable, CommonJoint

public class FreeJoint
extends Joint

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
 
Fields inherited from class com.yobotics.simulationconstructionset.Joint
MAX_ROT_ACCEL, MAX_TRANS_ACCEL
 
Constructor Summary
FreeJoint(java.lang.String jname, javax.vecmath.Vector3d offset, Robot rob, java.lang.String xName, java.lang.String yName, java.lang.String zName, java.lang.String yawName, java.lang.String rollName, java.lang.String pitchName)
           
 
Method Summary
 void jointDependentFeatherstonePassFour(double Q, int passNumber)
          The fourth and final featherstone pass travels back down the tree calculating joint accelerations based on the data gathered by the preceding three passes.
 void jointDependentFeatherstonePassOne()
          The first featherstone pass handles velocity and position updates as it recurses down the tree.
 void jointDependentFeatherstonePassTwo(javax.vecmath.Vector3d w_h)
          The primary function of the second featherstone pass is the calculation of the spatial articulated inertia and spatial articulated zero-acceleration force of link i.
 void jointDependentRecordK(int passNumber)
          If a joint is specified as non dynamic the second and third featherstone passes are skipped when dynamics are calculated.
 void jointDependentSetAndGetRotation(javax.vecmath.Matrix3d Rh_i)
          Calculates the rotation matrix between the previous and current joint space.
 void recursiveEulerIntegrate(double stepSize)
          Recurses over the children and performes a Euler Integration on the position and velocity parameters of each.
 void recursiveRestoreTempState()
          Restores the previous state for the relevant joint variables for use in the next Euler Integration.
 void recursiveRungeKuttaSum(double stepSize)
          This function recurses through the children of this joint calculating new values for the relevant variables using the RK4 method.
 void recursiveSaveTempState()
          Saves the current state of each joint.
 void setFreeTransform3D(javax.media.j3d.Transform3D tTranslate)
           
 void setFreeTransform3D(javax.media.j3d.Transform3D tTranslate, double x, double y, double z, double yaw, double roll, double pitch)
           
 void update()
          Update the state of this joint, each implementation handles this differently.
 
Methods inherited from class com.yobotics.simulationconstructionset.Joint
addCameraMount, addExternalForcePoint, addGroundContactPoint, addGroundContactPoint, addIMUMount, addJoint, addKinematicPoint, addSensor, changeOffsetVector, changeOffsetVector, freezeFrame, freezeNextFrame, get3DRotation, getAngularAccelerationsInBodyFrame, getAngularAccelerationsInWorld, getAngularVelocityInBody, getAngularVelocityInWorld, getChildrenJoints, getExternalForcePoints, getGroundContactPointGroup, getGroundContactPointGroup, getJointAxis, getJointTransform3D, getKinematicPoints, getLinearAccelerationInBody, getLinearAccelerationInWorld, getLinearVelocityInBody, getLinearVelocityInWorld, getLink, getName, getOffset, getOffsetTransform3D, getParentJoint, getRotationToWorld, getRotationToWorld, getTransformToWorld, getTransformToWorld, getTranslationToWorld, getUnitVector, getXYZToWorld, getYawPitchRollToWorld, isDynamic, recursiveDecideGroundContactPointsInContact, recursiveGetAllGroundContactPoints, recursiveGetChildrenJoints, recursiveGetOneDegreeOfFreedomJoints, recursiveUpdateAllGroundContactPointVelocities, resetFreezeFrame, setDynamic, setLink, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FreeJoint

public FreeJoint(java.lang.String jname,
                 javax.vecmath.Vector3d offset,
                 Robot rob,
                 java.lang.String xName,
                 java.lang.String yName,
                 java.lang.String zName,
                 java.lang.String yawName,
                 java.lang.String rollName,
                 java.lang.String pitchName)
Method Detail

update

public void update()
Description copied from class: Joint
Update the state of this joint, each implementation handles this differently. Graphics will only be updated if specified.


setFreeTransform3D

public void setFreeTransform3D(javax.media.j3d.Transform3D tTranslate)

setFreeTransform3D

public void setFreeTransform3D(javax.media.j3d.Transform3D tTranslate,
                               double x,
                               double y,
                               double z,
                               double yaw,
                               double roll,
                               double pitch)

jointDependentSetAndGetRotation

public void jointDependentSetAndGetRotation(javax.vecmath.Matrix3d Rh_i)
Description copied from class: Joint
Calculates the rotation matrix between the previous and current joint space. This method is abstract as different joint types have different means of conversion. Once calculated the value is stored in the parameter Rh_i.

Parameters:
Rh_i - Matrix3d in which the rotation between from the previous joint space to the current will be stored.

jointDependentFeatherstonePassOne

public void jointDependentFeatherstonePassOne()
Description copied from class: Joint
The first featherstone pass handles velocity and position updates as it recurses down the tree. The primary method does the majority of these calculations however joint torque has a significant impact on both forms of velocity. Different forms of joints have differing torque conditions therefore each must implement its own method to handle these effects.


jointDependentFeatherstonePassTwo

public void jointDependentFeatherstonePassTwo(javax.vecmath.Vector3d w_h)
Description copied from class: Joint
The primary function of the second featherstone pass is the calculation of the spatial articulated inertia and spatial articulated zero-acceleration force of link i. During this process the coriolis forces and spatial joint axis also must be recalculated, however, these values are dependent on joint implementation and type.

Parameters:
w_h - The angular velocity of the previous link in this links coordinate system. This value is necessary for the calculation of coriolis forces.

jointDependentFeatherstonePassFour

public void jointDependentFeatherstonePassFour(double Q,
                                               int passNumber)
Description copied from class: Joint
The fourth and final featherstone pass travels back down the tree calculating joint accelerations based on the data gathered by the preceding three passes. In order to use the Runge-Kutta (RK4) method to calculate future values this data must be stored over four sets of featherstone passes. The joint dependant part of the fourth pass stores these values along with the pass number.

Parameters:
Q - Joint acceleration based on the preceding three passes.
passNumber - Number of times dynamics have been calculated. Dynamics must be calculated four times in total, not to be confused with the four featherstone passes involved in each calculation.

jointDependentRecordK

public void jointDependentRecordK(int passNumber)
Description copied from class: Joint
If a joint is specified as non dynamic the second and third featherstone passes are skipped when dynamics are calculated. However, Runge-Kutta still requires four k values which are stored by this method.

Parameters:
passNumber - Current pass number of doDynamics. There are a total of 4 passes numbered 0 - 3.

recursiveEulerIntegrate

public void recursiveEulerIntegrate(double stepSize)
Description copied from class: Joint
Recurses over the children and performes a Euler Integration on the position and velocity parameters of each. As joint types have different parameters each must implement this method. Each value is calculated based on the following formula:
y_(n+1) = y_n + h*f(t_n, y_n) where h is the step size.

Parameters:
stepSize - Step size for the Euler Integration

recursiveSaveTempState

public void recursiveSaveTempState()
Description copied from class: Joint
Saves the current state of each joint. Different joint types have different relevant values, pin and slider joints store only position and velocity. These values are restored prior to each Euler integration in order to properly calculate the Runge-Kutta slope.


recursiveRestoreTempState

public void recursiveRestoreTempState()
Description copied from class: Joint
Restores the previous state for the relevant joint variables for use in the next Euler Integration.


recursiveRungeKuttaSum

public void recursiveRungeKuttaSum(double stepSize)
Description copied from class: Joint
This function recurses through the children of this joint calculating new values for the relevant variables using the RK4 method. This is based on the set of four values stored for each variable during doDynamics. The RK4 method operates in the following form: y_(n+1) = y_n + 1/6 * h * (k_1 + 2k_2 + 2k_3 + k_4 t_(n+1) = t_n + h Where: h is the step size k_1 = f(t_n, y_n) k_2 = f(t_n + 0.5 * h, y_n + 0.5 * h * k_1) k_3 = f(t_n + 0.5 * h, y_n + 0.5 * h * k_2) k_4 = f(t_n + h, y_n + h * k_3)

Parameters:
stepSize - The step size h, for use in calculation.