public class UniversalJoint extends JointBase implements CopyableComponent
roll about the z axis, followed by a
rotation pitch about the rotated y axis. All rotations are
counter-clockwise.
The roll and pitch angles are available (in degrees) as
properties which can be read and also, under appropriate circumstances, set.
Setting these values causes an adjustment in the positions of one or both
bodies connected to this joint, along with adjacent bodies connected to
them, with preference given to bodies that are not attached to ``ground''.
If this is done during simulation, and particularly if one or both of the
bodies connected to this joint are moving dynamically, the results will be
unpredictable and will likely conflict with the simulation.
| Modifier and Type | Class and Description |
|---|---|
static class |
UniversalJoint.AxisSet
Specifies whether the roll-pitch-yaw angles of this joint describe
instrinic rotations about the Z-Y-X or X-Y-Z axes.
|
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_JOINT_RADIUS |
static PropertyList |
myProps |
static int |
PITCH_IDX |
static int |
ROLL_IDX |
DEFAULT_SHAFT_LENGTH, DEFAULT_SHAFT_RADIUSdebug, useOldDerivativeMethodenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesCOPY_REFERENCES, REST_POSITIONTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
UniversalJoint()
Creates a
UniversalJoint which is not attached to any bodies. |
UniversalJoint(ConnectableBody bodyA,
ConnectableBody bodyB,
RigidTransform3d TDW)
Creates a
UniversalJoint connecting two connectable bodies,
bodyA and bodyB. |
UniversalJoint(ConnectableBody bodyA,
ConnectableBody bodyB,
RigidTransform3d TCW,
RigidTransform3d TDW)
Creates a
UniversalJoint connecting two connectable bodies,
bodyA and bodyB. |
UniversalJoint(ConnectableBody bodyA,
RigidTransform3d TDW)
Creates a
UniversalJoint connecting a single connectable body,
bodyA, to ground. |
UniversalJoint(RigidBody bodyA,
RigidTransform3d TCA,
RigidBody bodyB,
RigidTransform3d TDB)
Creates a
UniversalJoint connecting two rigid bodies, bodyA and bodyB. |
UniversalJoint(UniversalJoint.AxisSet axes) |
| Modifier and Type | Method and Description |
|---|---|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
UniversalJoint.AxisSet |
getAxes() |
double |
getJointRadius()
Returns a radius used for rendering this joint as a sphere.
|
double |
getMaxPitch()
Queries the upper pitch range limit for this joint, in degrees.
|
double |
getMaxRoll()
Queries the upper roll range limit for this joint, in degrees.
|
double |
getMinPitch()
Queries the lower pitch range limit for this joint, in degrees.
|
double |
getMinRoll()
Queries the lower roll range limit for this joint, in degrees.
|
double |
getPitch()
Queries this joint's pitch value, in degrees.
|
DoubleInterval |
getPitchRange()
Queries the pitch range limits for this joint, in degrees.
|
PolygonalMesh |
getRenderMesh()
Returns the rendering mesh, if any.
|
double |
getRoll()
Queries this joint's roll value, in degrees.
|
double[] |
getRollPitchRad()
Returns the roll and pitch angles for this joint, in radians.
|
DoubleInterval |
getRollRange()
Queries the roll range limits for this joint, in degrees.
|
boolean |
isPitchLocked()
Queries whether the pitch coordinate for this joint is locked.
|
boolean |
isRollLocked()
Queries whether the roll coordinate for this joint is locked.
|
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer. |
void |
setJointRadius(double r)
Sets a radius used for rendering this joint as a sphere.
|
void |
setMaxPitch(double max)
Sets the upper pitch range limit for this joint, in degrees.
|
void |
setMaxRoll(double max)
Sets the upper roll range limit for this joint, in degrees.
|
void |
setMinPitch(double min)
Sets the lower pitch range limit for this joint, in degrees.
|
void |
setMinRoll(double min)
Sets the lower roll range limit for this joint, in degrees.
|
void |
setPitch(double pitch)
Sets this joint's pitch value, in degrees.
|
void |
setPitchLocked(boolean locked)
Set whether the pitch coordinate for this joint is locked.
|
void |
setPitchRange(double min,
double max)
Sets the pitch range limits for this joint, in degrees.
|
void |
setPitchRange(DoubleInterval range)
Sets the pitch range limits for this joint, in degrees.
|
void |
setRenderMesh(PolygonalMesh mesh)
Sets a polygonal mesh that can also be used for rendering.
|
void |
setRoll(double roll)
Sets this joint's roll value, in degrees.
|
void |
setRollLocked(boolean locked)
Set whether the roll coordinate for this joint is locked.
|
void |
setRollPitchRad(double[] angs)
Sets the roll and pitch angles for this joint, in radians.
|
void |
setRollRange(double min,
double max)
Sets the roll range limits for this joint, in degrees.
|
void |
setRollRange(DoubleInterval range)
Sets the roll range limits for this joint, in degrees.
|
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
addCoordinateMobilities, addCoordinateSolveBlocks, addCoordinateVelJacobian, applyCoordinateForce, coordinatesToTCD, getCoordinate, getCoordinateDeg, getCoordinateIndex, getCoordinateMotionType, getCoordinateName, getCoordinateRange, getCoordinateRangeDeg, getCoordinates, getCoordinateSpeed, getCoordinateValue, getCoordinateValueDeg, getMaxCoordinate, getMaxCoordinateDeg, getMinCoordinate, getMinCoordinateDeg, getPosition, getRangeLimitCompliance, getRangeLimitDamping, getRangeLimitForce, getShaftLength, getShaftRadius, getStoredCoordinates, getStoredTCD, getStoredTCD, isCoordinateLocked, numCoordinates, setCoordinate, setCoordinateDeg, setCoordinateLocked, setCoordinateName, setCoordinateRange, setCoordinateRangeDeg, setCoordinates, setRangeLimitCompliance, setShaftLength, setShaftRadiusaddBilateralConstraints, addBilateralConstraints, addFrictionConstraints, addMasterBlocks, addTransformableDependencies, addUnilateralConstraints, addUnilateralConstraints, computeConstraintMatrixA, computeConstraintMatrixB, connectToHierarchy, copy, disconnectFromHierarchy, findAttachedBodies, findConnectedBodies, getActivation, getAxisLength, getBilateralForceInA, getBilateralForceInA, getBilateralForceInB, getBilateralForceInB, getBilateralForceInC, getBilateralForceInC, getBilateralForces, getBilateralInfo, getBilateralSizes, getBodyA, getBodyB, getCompliance, getConstrainedComponents, getConstraint, getConstraintFlags, getConstraintForce, getCopyReferences, getCoupling, getCurrentTCD, getCurrentTCW, getCurrentTCW, getCurrentTDW, getCurrentTDW, getDamping, getDrawFrameC, getDrawFrameD, getFrameAttachmentA, getFrameAttachmentB, getFrictionForces, getFrictionState, getHardReferences, getLinearCompliance, getOtherBody, getPenetrationTol, getPenetrationTolMode, getPose, getRenderFrame, getRotaryCompliance, getRotaryLimitTol, getRotaryLimitTolMode, getState, getStateVersion, getTransformDGeometryOnly, getTransformPositionOnly, getUnilateralForceInA, getUnilateralForceInA, getUnilateralForceInB, getUnilateralForceInB, getUnilateralForceInC, getUnilateralForceInC, getUnilateralForces, getUnilateralInfo, getUnilateralSizes, getUnilateralState, hasState, isActive, isConnectedToBodies, isDuplicatable, isEnabled, isNotAttached, maxFrictionConstraintSets, numBilateralConstraints, numConstraints, numEngagedUnilateralConstraints, numUnilateralConstraints, printConnectedBodies, printConstraintInfo, scaleDistance, scaleMass, setAlwaysAdjustBodyA, setAxisLength, setBilateralForces, setBodies, setBodies, setBodies, setBodies, setBodyA, setBodyA, setBodyB, setBodyB, setCompliance, setCurrentTCW, setCurrentTDW, setDamping, setDrawFrameC, setDrawFrameD, setEnabled, setFrictionForces, setFrictionState, setLinearCompliance, setPenetrationTol, setPenetrationTolMode, setRotaryCompliance, setRotaryLimitTol, setRotaryLimitTolMode, setState, setTransformDGeometryOnly, setTransformPositionOnly, setUnilateralForces, setUnilateralState, transformGeometry, transformGeometry, updateAttachments, updateConstraints, withinLoop, zeroForcescreateRenderProps, defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, setRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopy, getCopyReferences, isDuplicatableconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenpostscanisWritable, writetransformPriorityadvanceState, getAuxVarDerivative, getAuxVarState, numAuxVars, requiresAdvance, setAuxVarStatepublic static final int ROLL_IDX
public static final int PITCH_IDX
public static final double DEFAULT_JOINT_RADIUS
public static PropertyList myProps
public UniversalJoint()
UniversalJoint which is not attached to any bodies. It
can subsequently be connected using one of the setBodies methods.public UniversalJoint(UniversalJoint.AxisSet axes)
public UniversalJoint(RigidBody bodyA, RigidTransform3d TCA, RigidBody bodyB, RigidTransform3d TDB)
UniversalJoint connecting two rigid bodies, bodyA and bodyB. If A and B describe the coordinate frames of
bodyA and bodyB, then TCA and TDB give
the (fixed) transforms from the joint's C and D frames to A and B,
respectively. Since C and D are specified independently, the joint
transform TCD may not necessarily be initialized to the identity.
Specifying bodyB as null will cause bodyA to
be connected to ground, with TDB then being the same as TDW.
bodyA - rigid body ATCA - transform from joint frame C to body frame AbodyB - rigid body B (or null)TDB - transform from joint frame D to body frame Bpublic UniversalJoint(ConnectableBody bodyA, ConnectableBody bodyB, RigidTransform3d TCW, RigidTransform3d TDW)
UniversalJoint connecting two connectable bodies,
bodyA and bodyB. The joint frames C and D are located
independently with respect to world coordinates by TCW and TDW.
Specifying bodyB as null will cause bodyA to
be connected to ground.
bodyA - body AbodyB - body B (or null)TCW - initial transform from joint frame C to worldTDW - initial transform from joint frame D to worldpublic UniversalJoint(ConnectableBody bodyA, ConnectableBody bodyB, RigidTransform3d TDW)
UniversalJoint connecting two connectable bodies,
bodyA and bodyB. The joint frames D and C are assumed to
be initially coincident, so that roll and pitch will have
initial values of 0. D (and C) is located by TDW, which gives the
transform from D to world coordinates.bodyA - body AbodyB - body BTDW - initial transform from joint frames D and C to worldpublic UniversalJoint(ConnectableBody bodyA, RigidTransform3d TDW)
UniversalJoint connecting a single connectable body,
bodyA, to ground. The joint frames D and C are assumed to be
initially coincident, so that roll and pitch will have
initial values of 0. D (and C) is located by TDW, which gives the
transform from D to world coordinates.bodyA - body ATDW - initial transform from joint frames D and C to worldpublic PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class JointBasepublic UniversalJoint.AxisSet getAxes()
public double[] getRollPitchRad()
setRoll(double) and setPitch(double) for the definition of these angles.public void setRollPitchRad(double[] angs)
setRoll(double) and setPitch(double) for the definition of these angles and
what happens when they are set.angs - new roll and pitch angles, in an array of length 2public double getRoll()
setRoll(double) for
more details.public void setRoll(double roll)
roll - new roll valuepublic DoubleInterval getRollRange()
setRollRange(DoubleInterval) for more details.public double getMinRoll()
public double getMaxRoll()
public void setRollRange(DoubleInterval range)
[-inf, inf], which implies no limits. If roll travels beyond
these limits during dynamic simulation, unilateral constraints will be
activated to enforce them. Setting the lower limit to -inf or the
upper limit to inf removes the lower or upper limit,
respectively. Specifying range as null will set the range
to (-inf, inf).range - roll range limits for this jointpublic void setRollRange(double min,
double max)
setRollRange(DoubleInterval).min - minimum roll valuemax - maximum roll valuepublic void setMaxRoll(double max)
inf removes the upper limit.max - upper roll range limitpublic void setMinRoll(double min)
-inf removes the lower limit.min - lower roll range limitpublic boolean isRollLocked()
true if roll is lockedpublic void setRollLocked(boolean locked)
locked - if true, locks rollpublic double getPitch()
setPitch(double) for
more details.public void setPitch(double pitch)
pitch - new pitch valuepublic DoubleInterval getPitchRange()
setPitchRange(DoubleInterval) for more details.public double getMinPitch()
public double getMaxPitch()
public void setPitchRange(DoubleInterval range)
[-inf, inf], which implies no limits. If pitch travels beyond
these limits during dynamic simulation, unilateral constraints will be
activated to enforce them. Setting the lower limit to -inf or the
upper limit to inf removes the lower or upper limit,
respectively. Specifying range as null will set the range
to (-inf, inf).range - pitch range limits for this jointpublic void setPitchRange(double min,
double max)
setPitchRange(DoubleInterval).min - minimum pitch valuemax - maximum pitch valuepublic void setMaxPitch(double max)
inf removes the upper limit.max - upper pitch range limitpublic void setMinPitch(double min)
-inf removes the lower limit.min - lower pitch range limitpublic boolean isPitchLocked()
true if pitch is lockedpublic void setPitchLocked(boolean locked)
locked - if true, locks pitchpublic double getJointRadius()
getJointRadius() for details.public void setJointRadius(double r)
r - joint rendering radiuspublic void setRenderMesh(PolygonalMesh mesh)
mesh - mesh to use as a render mesh. The mesh is copied internally.
Setting mesh to null will clear any existing mesh.public PolygonalMesh getRenderMesh()
setRenderMesh(maspack.geometry.PolygonalMesh).public void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderableupdateBounds in interface IsRenderableupdateBounds in class BodyConnectorpmin - minimum pointpmax - maximum pointpublic void prerender(RenderList list)
IsRenderablelist.addIfVisible (obj);
for each of the objects in question.prerender in interface IsRenderableprerender in class BodyConnectorlist - list of objects to be renderedpublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class BodyConnectorrenderer - provides the functionality used to perform the rendering.flags - flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT and
Renderer.SORT_FACES.