com.yobotics.simulationconstructionset
Class PinJoint

java.lang.Object
  extended by com.yobotics.simulationconstructionset.Joint
      extended by com.yobotics.simulationconstructionset.OneDegreeOfFreedomJoint
          extended by com.yobotics.simulationconstructionset.PinJoint
All Implemented Interfaces:
java.io.Serializable, CommonJoint
Direct Known Subclasses:
CylinderJoint, GimbalJoint, UniversalJoint

public class PinJoint
extends OneDegreeOfFreedomJoint

Title: SimulationConstructionSet

Description: A rotational joint with a single degree of freedom. Pin joints allow rotation around a single axis specified upon creation. There are several joint types which extend this joint: universal, gimbal and cylinder joints. These joints are either multiple pin joints grouped together or a combination of pin and slider joints.

Copyright: Copyright (c) 2000

Company: Yobotics, Inc.

Version:
1.0
Author:
not attributable
See Also:
Joint, Serialized Form

Field Summary
 
Fields inherited from class com.yobotics.simulationconstructionset.Joint
MAX_ROT_ACCEL, MAX_TRANS_ACCEL
 
Constructor Summary
PinJoint(java.lang.String jname, javax.vecmath.Vector3d offset, Robot rob, Axis jaxis)
          Creates a new pin joint and adds it to the specified robot.
PinJoint(java.lang.String jname, javax.vecmath.Vector3d offset, Robot rob, javax.vecmath.Vector3d u_hat)
          Creates a new pin joint and adds it to the specified robot.
 
Method Summary
 void addTau(double tau)
          Add the torque given in parameter to this joint.
 double getDamping()
           
 DoubleYoVariable getQ()
          Retrieve the current angle (position) of this joint.
 DoubleYoVariable getQD()
          Retrieves the current velocity of this joint.
 DoubleYoVariable getQDD()
          Retrieves the current acceleration at this joint.
 void getState(double[] state)
          Inserts the given position and velocity of this pin joint into the provided array.
 DoubleYoVariable getTau()
          Retrieves the torque currently applied at this joint.
 double getTorqueLimit()
           
 double getVelocityLimit()
           
 void setDamping(double b_damp)
          Specifies the overall damping constant for this joint.
 void setDampingParameterOnly(double b_damp)
           
 void setInitialState(double q_init, double qd_init)
          Specify the intial position and velocity of this joint.
 void setLimitStops(double q_min, double q_max, double k_limit, double b_limit)
          Adds a set of limit stops to this joint.
 void setQ(double q)
           
 void setQd(double qd)
           
 void setQdd(double qdd)
           
 void setTau(double tau)
          Sets the torque applied to this joint.
 void setTorqueLimits(double maxTorque)
          Sets a threshold for maximum allowed torque at this joint.
 void setTorqueSpeedCurve(TorqueSpeedCurve torqueSpeedCurve)
           
 void setVelocityLimits(double qd_max, double b_vel_limit)
          Adds a velocity limit for this joint.
 
Methods inherited from class com.yobotics.simulationconstructionset.OneDegreeOfFreedomJoint
doPDControl, getKd, getKp, getQdDesired, getqDesired, setKd, setKp, setQdDesired, setqDesired
 
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

PinJoint

public PinJoint(java.lang.String jname,
                javax.vecmath.Vector3d offset,
                Robot rob,
                Axis jaxis)
Creates a new pin joint and adds it to the specified robot. There are three possible axis of rotation for this method: X, Y, and Z. To specified a particular axis use the public int provided in Joint.

Parameters:
jname - name of this joint
offset - Vector3d representing the offset from the robot origin to the joint.
rob - Robot to which this joint will belong
jaxis - int representing the axis

PinJoint

public PinJoint(java.lang.String jname,
                javax.vecmath.Vector3d offset,
                Robot rob,
                javax.vecmath.Vector3d u_hat)
Creates a new pin joint and adds it to the specified robot. This method allows the specification of an arbitrary joint axis.

Parameters:
jname - name of this joint
offset - Vector3d representing the offset from the robot origin to the joint.
rob - Robot to which this joint will belong
u_hat - Vector3d representing the axis of rotation
Method Detail

setInitialState

public void setInitialState(double q_init,
                            double qd_init)
Specify the intial position and velocity of this joint. This is used by gimbal, universal, and cylinder joints to initialize their member pin joints.

Parameters:
q_init - intial position of this joint in radians.
qd_init - intial velocity of this joint

getState

public void getState(double[] state)
Inserts the given position and velocity of this pin joint into the provided array. Index zero contains the position (angle) in radians, while index one contains the velocity.

Parameters:
state - double[]

setTau

public void setTau(double tau)
Sets the torque applied to this joint. Usually these variables are accessed by name instead of going through the joint.

Specified by:
setTau in class OneDegreeOfFreedomJoint
Parameters:
tau - torque to be applied at this joint.

addTau

public void addTau(double tau)
Add the torque given in parameter to this joint.

Parameters:
tau - torque to be added to this joint.

getQ

public DoubleYoVariable getQ()
Retrieve the current angle (position) of this joint.

Specified by:
getQ in class OneDegreeOfFreedomJoint
Returns:
YoVariable representing the angle of this joint.

getQD

public DoubleYoVariable getQD()
Retrieves the current velocity of this joint.

Specified by:
getQD in class OneDegreeOfFreedomJoint
Returns:
YoVariable representing the current angle of this joint.

getQDD

public DoubleYoVariable getQDD()
Retrieves the current acceleration at this joint.

Specified by:
getQDD in class OneDegreeOfFreedomJoint
Returns:
YoVariable representing the current acceleration

getTau

public DoubleYoVariable getTau()
Retrieves the torque currently applied at this joint.

Specified by:
getTau in class OneDegreeOfFreedomJoint
Returns:
YoVariable representing the currently applied torque.

setQ

public void setQ(double q)
Specified by:
setQ in class OneDegreeOfFreedomJoint

setQd

public void setQd(double qd)
Specified by:
setQd in class OneDegreeOfFreedomJoint

setQdd

public void setQdd(double qdd)
Specified by:
setQdd in class OneDegreeOfFreedomJoint

setLimitStops

public void setLimitStops(double q_min,
                          double q_max,
                          double k_limit,
                          double b_limit)

Adds a set of limit stops to this joint. This defines the allowed range of motion based on the provided min and max angles. Motion is constrained between these two values using a reaction torque calculated using the given spring and damper constants.

Parameters:
q_min - minimum allowed angle for this joint.
q_max - maximum allowed angle for this joint.
k_limit - spring constant used in torque calculations
b_limit - damping constant used in torque calculations

setVelocityLimits

public void setVelocityLimits(double qd_max,
                              double b_vel_limit)
Adds a velocity limit for this joint. This is achieved through the application of a resistive torque calculated based on the velocity and the provided damping function.

Parameters:
qd_max - maximum allowed velocity
b_vel_limit - damping constant for torque calculations.

setTorqueSpeedCurve

public void setTorqueSpeedCurve(TorqueSpeedCurve torqueSpeedCurve)

setTorqueLimits

public void setTorqueLimits(double maxTorque)
Sets a threshold for maximum allowed torque at this joint. If a torque larger than the specified value is desired it will be cut to the given value.

Parameters:
tau_max - torque limit.

setDamping

public void setDamping(double b_damp)
Specifies the overall damping constant for this joint. If specified a torque base on this constant and the current velocity will be applied.

Specified by:
setDamping in class OneDegreeOfFreedomJoint
Parameters:
b_damp - general damping constant for this joint

setDampingParameterOnly

public void setDampingParameterOnly(double b_damp)

getDamping

public double getDamping()
Specified by:
getDamping in class OneDegreeOfFreedomJoint

getTorqueLimit

public double getTorqueLimit()
Specified by:
getTorqueLimit in class OneDegreeOfFreedomJoint

getVelocityLimit

public double getVelocityLimit()
Specified by:
getVelocityLimit in class OneDegreeOfFreedomJoint