public abstract class JointBase extends BodyConnector
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_SHAFT_LENGTH |
static double |
DEFAULT_SHAFT_RADIUS |
static PropertyList |
myProps |
debug, useOldDerivativeMethod
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
JointBase() |
Modifier and Type | Method and Description |
---|---|
void |
addCoordinateSolveBlocks(SparseNumberedBlockMatrix M,
int idx) |
void |
addCoordinateVelJacobian(SparseNumberedBlockMatrix M,
int idx,
double s) |
void |
applyCoordinateForce(int idx,
double f)
Applies a generalized force to the
idx -th coordinate for this
joint. |
void |
coordinatesToTCD(RigidTransform3d TCD,
VectorNd coords)
Computes the TCD transform for a set of coordinates, if coordinates are
supported.
|
PropertyInfoList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
double |
getCoordinate(int idx)
Returns the
idx -th coordinate value for this joint. |
double |
getCoordinateDeg(int idx)
Returns the
idx -th coordinate value for this joint. |
int |
getCoordinateIndex(java.lang.String name)
Returns the index for the coordinate with a given name.
|
RigidBodyConstraint.MotionType |
getCoordinateMotionType(int idx)
Returns the motion type of the
idx -th coordinate for this joint. |
java.lang.String |
getCoordinateName(int idx)
Returns the name for the
idx -th coordinate for this
joint. |
DoubleInterval |
getCoordinateRange(int idx)
Queries the range for the
idx -th coordinate. |
DoubleInterval |
getCoordinateRangeDeg(int idx)
Queries the range for the
idx -th coordinate. |
void |
getCoordinates(VectorNd coords)
Returns the current coordinates, if any, for this joint.
|
double |
getCoordinateSpeed(int idx)
Returns the current speed of the
idx -th coordinate for this joint. |
double |
getCoordinateValue(int idx)
Returns the current stored value of the
idx -th coordinate for
this joint. |
double |
getMaxCoordinate(int idx)
Queries the maximum range value for the
idx -th coordinate. |
double |
getMaxCoordinateDeg(int idx)
Queries the maximum range value for the
idx -th coordinate. |
double |
getMinCoordinate(int idx)
Queries the minimum range value for the
idx -th coordinate. |
double |
getMinCoordinateDeg(int idx)
Queries the minimum range value for the
idx -th coordinate. |
void |
getPosition(Point3d pos) |
double |
getShaftLength()
Returns a length used for rendering shafts or axes associated with this
joint.
|
double |
getShaftRadius()
Returns a radius used for rendering shafts or axes associated this
joint.
|
void |
getStoredCoordinates(VectorNd coords)
Returns the coordinate values currently stored for this joint.
|
RigidTransform3d |
getStoredTCD() |
void |
getStoredTCD(RigidTransform3d TCD)
Returns the value of the TCD transform based on the coordinate values
currently stored for this joint.
|
boolean |
isCoordinateLocked(int idx)
Queries whether the
idx -th coordinate for this joint is locked. |
int |
numCoordinates()
Returns the number of coordinates, if any, associated with this joint.
|
void |
setCoordinate(int idx,
double value)
Sets the
idx -th coordinate for this joint. |
void |
setCoordinateDeg(int idx,
double value)
Sets the
idx -th coordinate for this joint. |
void |
setCoordinateLocked(int idx,
boolean locked)
Sets whether the
idx -th coordinate for this joint is locked,
meaning that it will hold its current value. |
void |
setCoordinateName(int idx,
java.lang.String name)
Sets the name for the
idx -th coordinate supported by this
coupling. |
void |
setCoordinateRange(int idx,
DoubleInterval range)
Sets the range for the
idx -th coordinate. |
void |
setCoordinateRangeDeg(int idx,
DoubleInterval range)
Sets the range for the
idx -th coordinate. |
void |
setCoordinates(VectorNd coords)
Sets the current coordinates, if any, for this joint.
|
void |
setShaftLength(double l)
Sets a length used for rendering shafts or axes associated with this
joint.
|
void |
setShaftRadius(double r)
Sets a radius used for rendering shafts or axes associated with this
joint.
|
addBilateralConstraints, addFrictionConstraints, addMasterBlocks, addTransformableDependencies, addUnilateralConstraints, computeConstraintMatrixA, computeConstraintMatrixB, connectToHierarchy, copy, disconnectFromHierarchy, findAttachedBodies, 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, 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, prerender, printConnectedBodies, printConstraintInfo, render, scaleDistance, scaleMass, setAlwaysAdjustBodyA, setAxisLength, setBilateralForces, setBodies, setBodies, setBodies, setBodies, setCompliance, setCurrentTCW, setCurrentTDW, setDamping, setDrawFrameC, setDrawFrameD, setEnabled, setFrictionForces, setFrictionState, setLinearCompliance, setPenetrationTol, setPenetrationTolMode, setRotaryCompliance, setRotaryLimitTol, setRotaryLimitTolMode, setState, setTransformDGeometryOnly, setTransformPositionOnly, setUnilateralForces, setUnilateralState, transformGeometry, transformGeometry, updateAttachments, updateBounds, updateConstraints, zeroForces
createRenderProps, defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderProps
checkFlag, 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, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transformPriority
advanceState, getAuxVarDerivative, getAuxVarState, numAuxVars, requiresAdvance, setAuxVarState
getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
public static final double DEFAULT_SHAFT_LENGTH
public static final double DEFAULT_SHAFT_RADIUS
public static PropertyList myProps
public PropertyInfoList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class BodyConnector
public double getShaftLength()
setShaftLength(double)
for details.public void setShaftLength(double l)
axisLength
property.l
- shaft rendering lengthpublic double getShaftRadius()
getShaftRadius()
for details.public void setShaftRadius(double r)
getShaftLength()
.r
- shaft rendering radiuspublic DoubleInterval getCoordinateRange(int idx)
idx
-th coordinate.idx
- coordinate indexpublic double getMinCoordinate(int idx)
idx
-th coordinate.idx
- coordinate indexpublic double getMaxCoordinate(int idx)
idx
-th coordinate.idx
- coordinate indexpublic void setCoordinateRange(int idx, DoubleInterval range)
idx
-th coordinate. Specifying range
as null
will set the range to (-inf, inf)
.idx
- coordinate indexrange
- new range valuepublic DoubleInterval getCoordinateRangeDeg(int idx)
idx
-th coordinate. If the coordinate
motion type is RigidBodyConstraint.MotionType.ROTARY
, then the range is returned in
degrees.idx
- coordinate indexpublic double getMinCoordinateDeg(int idx)
idx
-th coordinate. If
the coordinate motion type is RigidBodyConstraint.MotionType.ROTARY
, then the value
is returned in degrees.idx
- coordinate indexpublic double getMaxCoordinateDeg(int idx)
idx
-th coordinate. If
the coordinate motion type is RigidBodyConstraint.MotionType.ROTARY
, then the value
is returned in degrees.idx
- coordinate indexpublic void setCoordinateRangeDeg(int idx, DoubleInterval range)
idx
-th coordinate. If the coordinate
motion type is RigidBodyConstraint.MotionType.ROTARY
, then the range is specified in
degrees. Specifying range
as null
will set the range to
(-inf, inf)
.idx
- coordinate indexrange
- new range valuepublic int numCoordinates()
public double getCoordinateDeg(int idx)
idx
-th coordinate value for this joint. If the
coordinate motion type is RigidBodyConstraint.MotionType.ROTARY
, then the value is
returned in degrees.idx
- index of the coordinatepublic double getCoordinate(int idx)
idx
-th coordinate value for this joint. If the joint
is connected to other bodies, the value is inferred from the current TCD
transform. Otherwise, it is obtained from a stored internal value.idx
- index of the coordinatepublic double getCoordinateValue(int idx)
idx
-th coordinate for
this joint.idx
- index of the coordinatepublic double getCoordinateSpeed(int idx)
idx
-th coordinate for this joint.idx
- index of the coordinatepublic RigidBodyConstraint.MotionType getCoordinateMotionType(int idx)
idx
-th coordinate for this joint.idx
- index of the coordinatepublic java.lang.String getCoordinateName(int idx)
idx
-th coordinate for this
joint. If the coordinate does not have a name, null
is returned.idx
- index of the coordinatenull
public void setCoordinateName(int idx, java.lang.String name)
idx
-th coordinate supported by this
coupling.
This method allows joint coordinates to be renamed so as to be
compatible with the names used by equivalent joints in different modeling
systems (e.g., OpenSim). If the joint provides special methods with
hardwired names to access coordinate values (e.g., HingeJoint.setTheta(double)
and HingeJoint.getTheta()
in HingeJoint
), those methods will be unaffacted and will continue to
access the coordinate at the same location.
idx
- index of the coordinatename
- new coordinate namepublic int getCoordinateIndex(java.lang.String name)
-1
.name
- name of the coordinate-1
public void applyCoordinateForce(int idx, double f)
idx
-th coordinate for this
joint.idx
- index of the coordinatef
- generalized force to applypublic void addCoordinateSolveBlocks(SparseNumberedBlockMatrix M, int idx)
public void addCoordinateVelJacobian(SparseNumberedBlockMatrix M, int idx, double s)
public void getCoordinates(VectorNd coords)
coords
, whose size is set to the value returned by
numCoordinates()
. If the joint is connected to other bodies, the
coordinates are inferred from the current TCD transform. Otherwise, they
are obtained from stored internal values.coords
- returns the coordinate valuespublic void getStoredCoordinates(VectorNd coords)
coords
, whose size is set to
the value returned by numCoordinates()
.coords
- returns the coordinate valuespublic void getStoredTCD(RigidTransform3d TCD)
TCD
- returns the stored TCD transformpublic RigidTransform3d getStoredTCD()
public void setCoordinate(int idx, double value)
idx
-th coordinate for this joint. If the joint is
connected to other bodies, their poses are adjusted appropriately.idx
- index of the coordinatevalue
- new coordinate valuepublic void setCoordinateDeg(int idx, double value)
idx
-th coordinate for this joint. If the coordinate
motion type is RigidBodyConstraint.MotionType.ROTARY
, then the value is specified
in degrees.idx
- index of the coordinatevalue
- new coordinate valuepublic void setCoordinates(VectorNd coords)
coords
supplies the coordinates and should have a length >=
numCoordinates()
. If the joint is connected to other bodies, their poses
are adjusted appropriately.coords
- new coordinate valuespublic boolean isCoordinateLocked(int idx)
idx
-th coordinate for this joint is locked.
See setCoordinateLocked(int, boolean)
for details.idx
- index of the coordinatetrue
if the coordinate is lockedpublic void setCoordinateLocked(int idx, boolean locked)
idx
-th coordinate for this joint is locked,
meaning that it will hold its current value. Locking a coordinate will
reduce the number of joint DOFs by one.idx
- index of the coordinatelocked
- if true
, sets the coordinate to be lockedpublic void coordinatesToTCD(RigidTransform3d TCD, VectorNd coords)
TCD
- returns the TCD transformcoords
- supplies the coordinate values and
must have a length >= numCoordinates()
.public void getPosition(Point3d pos)