public abstract class BodyConnector extends RenderableComponentBase implements ScalableUnits, TransformableGeometry, BodyConstrainer, Constrainer, HasCoordinateFrame
HasAuxState.StateContextModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Modifier and Type | Method and Description |
|---|---|
int |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb) |
int |
addFrictionConstraints(SparseBlockMatrix DT,
MechSystem.FrictionInfo[] finfo,
int numf) |
void |
addMasterBlocks(SparseBlockMatrix GT,
int bj,
MatrixNdBlock GC,
FrameAttachment attachment) |
void |
addTransformableDependencies(TransformGeometryContext context,
int flags)
Adds to
context any transformable components which should be
transformed as the same time as this component. |
int |
addUnilateralConstraints(SparseBlockMatrix NT,
VectorNd dn,
int numu) |
void |
advanceAuxState(double t0,
double t1)
Called at the very beginning of the time step (in the system's
preadvance() method) to perform any required updating of the component's
state before the application in input probes or controllers.
|
void |
connectToHierarchy()
Called by the system after this component is added to the
component hierarchy (i.e., when it is added as a child of another
CompositeComponent).
|
ModelComponent |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap) |
void |
disconnectFromHierarchy()
Called by the system after this component is removed from the component
hierarchy (i.e., when it is removed as a child of its parent).
|
static boolean |
findAttachedBodies(ConnectableBody body,
ConnectableBody exclude,
java.util.List<ConnectableBody> bodies) |
double |
getActivation(int idx)
Returns the activation level associated with a specific constraint.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
void |
getAuxState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
int |
getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
Gets the bilateral constraints associated with this constrainer.
|
Wrench |
getBilateralForceInA()
If body A is a Frame, computes the wrench acting on body A
in response to the most recent bilateral constraint forces.
|
void |
getBilateralForceInA(Wrench wr)
If body A is a Frame, computes the wrench acting on body A
in response to the most recent bilateral constraint forces.
|
int |
getBilateralImpulses(VectorNd lam,
int idx) |
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx) |
void |
getBilateralSizes(VectorNi sizes) |
ConnectableBody |
getBodyA()
Returns the first body associated with this constrainer.
|
ConnectableBody |
getBodyB()
Returns the second body associated with this constrainer, or null if there
is no such body.
|
double |
getBreakAccel() |
double |
getBreakSpeed() |
VectorNd |
getCompliance() |
void |
getConstrainedComponents(java.util.List<DynamicComponent> list) |
double |
getContactDistance() |
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor) |
RigidTransform3d |
getCurrentTCW() |
void |
getCurrentTCW(RigidTransform3d TCW) |
RigidTransform3d |
getCurrentTDW() |
void |
getCurrentTDW(RigidTransform3d TDW) |
RigidTransform3d |
getCurrentTXW(FrameAttachable body) |
VectorNd |
getDamping() |
void |
getHardReferences(java.util.List<ModelComponent> refs)
Appends all hard references for this component to a list.
|
void |
getInitialAuxState(DataBuffer newData,
DataBuffer oldData)
Saves initial state information data for this component by adding data
to the supplied data buffer.
|
double |
getLinearCompliance() |
ConnectableBody |
getOtherBody(ConnectableBody body) |
double |
getPenetrationTol() |
PropertyMode |
getPenetrationTolMode() |
void |
getPose(RigidTransform3d X) |
double |
getRotaryCompliance() |
double |
getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
boolean setEngaged)
Gets the unilateral constraints associated with this constrainer.
|
Wrench |
getUnilateralForceInA()
If body A is a Frame, computes the wrench acting on body A
in response to the most recent unilateral constraint forces.
|
void |
getUnilateralForceInA(Wrench wr)
If body A is a Frame, computes the wrench acting on body A
in response to the most recent unilateral constraint forces.
|
int |
getUnilateralImpulses(VectorNd the,
int idx) |
int |
getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo,
int idx) |
void |
getUnilateralSizes(VectorNi sizes) |
boolean |
hasState()
Queries if this component has state.
|
boolean |
hasTranslation() |
boolean |
hasUnilateralConstraints()
Returns true if this constrainer has unilateral constraints.
|
boolean |
isActive()
Returns true if this RigidBodyConnectorX is enabled and at least one of
it's underlying master components is active.
|
boolean |
isDuplicatable() |
boolean |
isEnabled() |
int |
maxFrictionConstraintSets() |
int |
numBilateralConstraints()
Returns the number of bilateral constraints associated with this
constrainer.
|
int |
numBodies() |
int |
numUnilateralConstraints()
Returns the number of unilateral constraints which are currently
engaged.
|
void |
printConstraintInfo()
For debugging only
|
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double m)
Nothing to do for scale mass.
|
void |
setAuxState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
int |
setBilateralImpulses(VectorNd lam,
double h,
int idx) |
void |
setBodies(ConnectableBody bodyA,
ConnectableBody bodyB,
RigidTransform3d TDW) |
void |
setBodies(ConnectableBody bodyA,
ConnectableBody bodyB,
RigidTransform3d TCW,
RigidTransform3d TDW) |
void |
setBodies(ConnectableBody bodyA,
FrameAttachment attachmentA,
ConnectableBody bodyB,
FrameAttachment attachmentB) |
void |
setBodies(RigidBody bodyA,
RigidTransform3d TCA,
RigidBody bodyB,
RigidTransform3d TDB) |
void |
setBreakAccel(double a) |
void |
setBreakSpeed(double s) |
void |
setCompliance(VectorNd compliance) |
void |
setContactDistance(double d) |
void |
setCurrentTCW(RigidTransform3d TCW) |
void |
setCurrentTDW(RigidTransform3d TDW) |
void |
setDamping(VectorNd damping) |
void |
setEnabled(boolean enabled) |
void |
setLinearCompliance(double c) |
void |
setPenetrationTol(double tol)
Sets the penetration tolerance for this component.
|
void |
setPenetrationTolMode(PropertyMode mode) |
void |
setRotaryCompliance(double c) |
int |
setUnilateralImpulses(VectorNd the,
double h,
int idx) |
void |
skipAuxState(DataBuffer data)
Skips over the state information for this component contained
in the supplied data buffer, starting at the current buffer offsets.
|
void |
transformGeometry(AffineTransform3dBase X)
Applies an affine transformation to the geometry of this component.
|
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
void |
updateBodyStates(double t,
boolean setEngaged)
Updates internal information needed for computing constraints.
|
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
double |
updateConstraints(double t,
int flags) |
void |
updateForBodyPositionChange(ConnectableBody body,
RigidTransform3d TXW) |
void |
updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
int offset,
int numc)
Updates the unilateral constraints associated with this constrainer.
|
void |
zeroImpulses() |
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, render, setRenderProps, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferencesgetPropertygetChildren, hasChildrenisWritable, writepublic static PropertyList myProps
public boolean hasTranslation()
public void setPenetrationTol(double tol)
setPenetrationTol in interface BodyConstrainertol - new penetration tolerancepublic double getPenetrationTol()
getPenetrationTol in interface BodyConstrainerpublic PropertyMode getPenetrationTolMode()
public void setPenetrationTolMode(PropertyMode mode)
public void getBilateralForceInA(Wrench wr)
wr - returns the bilateral constraint wrench acting on A,
in the coordinates of Apublic void printConstraintInfo()
public Wrench getBilateralForceInA()
public void getUnilateralForceInA(Wrench wr)
wr - returns the unilateral constraint wrench acting on A,
in the coordinates of Apublic Wrench getUnilateralForceInA()
public double getLinearCompliance()
public void setLinearCompliance(double c)
public double getRotaryCompliance()
public void setRotaryCompliance(double c)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class ModelComponentBasepublic VectorNd getCompliance()
public void setCompliance(VectorNd compliance)
public VectorNd getDamping()
public void setDamping(VectorNd damping)
public void setEnabled(boolean enabled)
public boolean isEnabled()
public int numBodies()
public ConnectableBody getBodyA()
BodyConstrainergetBodyA in interface BodyConstrainerpublic ConnectableBody getBodyB()
BodyConstrainergetBodyB in interface BodyConstrainerpublic ConnectableBody getOtherBody(ConnectableBody body)
public int numBilateralConstraints()
BodyConstrainernumBilateralConstraints in interface BodyConstrainerpublic int numUnilateralConstraints()
BodyConstrainergetUnilateralConstraints with
setEngaged set to false.numUnilateralConstraints in interface BodyConstrainerpublic void getBilateralSizes(VectorNi sizes)
getBilateralSizes in interface BodyConstrainergetBilateralSizes in interface Constrainerpublic void getUnilateralSizes(VectorNi sizes)
getUnilateralSizes in interface BodyConstrainergetUnilateralSizes in interface Constrainerpublic double updateConstraints(double t,
int flags)
updateConstraints in interface BodyConstrainerupdateConstraints in interface Constrainerpublic void getConstrainedComponents(java.util.List<DynamicComponent> list)
getConstrainedComponents in interface Constrainerpublic void addMasterBlocks(SparseBlockMatrix GT, int bj, MatrixNdBlock GC, FrameAttachment attachment)
public int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
addBilateralConstraints in interface Constrainerpublic int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dn, int numu)
addUnilateralConstraints in interface Constrainerpublic int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
getBilateralInfo in interface Constrainerpublic int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo, int idx)
getUnilateralInfo in interface Constrainerpublic int maxFrictionConstraintSets()
maxFrictionConstraintSets in interface Constrainerpublic int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf)
addFrictionConstraints in interface Constrainerpublic void setBodies(RigidBody bodyA, RigidTransform3d TCA, RigidBody bodyB, RigidTransform3d TDB)
public void setBodies(ConnectableBody bodyA, FrameAttachment attachmentA, ConnectableBody bodyB, FrameAttachment attachmentB)
public void setBodies(ConnectableBody bodyA, ConnectableBody bodyB, RigidTransform3d TDW)
public void setBodies(ConnectableBody bodyA, ConnectableBody bodyB, RigidTransform3d TCW, RigidTransform3d TDW)
public RigidTransform3d getCurrentTDW()
public void getCurrentTDW(RigidTransform3d TDW)
public void setCurrentTDW(RigidTransform3d TDW)
public void getPose(RigidTransform3d X)
getPose in interface HasCoordinateFramepublic RigidTransform3d getCurrentTCW()
public void getCurrentTCW(RigidTransform3d TCW)
public void setCurrentTCW(RigidTransform3d TCW)
public RigidTransform3d getCurrentTXW(FrameAttachable body)
public double getActivation(int idx)
idx - index of the constraintpublic void updateBodyStates(double t,
boolean setEngaged)
BodyConstrainerupdateBodyStates in interface BodyConstrainert - current time (seconds)setEngaged - if true, then the method should determine
which unilateral constraints are engagedpublic void scaleMass(double m)
scaleMass in interface ScalableUnitsm - scaling factorpublic void scaleDistance(double s)
ScalableUnitsscaleDistance in interface ScalableUnitss - scaling factorpublic int getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
BodyConstrainergetBilateralConstraints in interface BodyConstrainerbilaterals - array list into which the constrainer places the constraintspublic int setBilateralImpulses(VectorNd lam, double h, int idx)
setBilateralImpulses in interface BodyConstrainersetBilateralImpulses in interface Constrainerpublic int getBilateralImpulses(VectorNd lam, int idx)
getBilateralImpulses in interface BodyConstrainergetBilateralImpulses in interface Constrainerpublic void zeroImpulses()
zeroImpulses in interface BodyConstrainerzeroImpulses in interface Constrainerpublic boolean hasUnilateralConstraints()
BodyConstrainerhasUnilateralConstraints in interface BodyConstrainerpublic void setContactDistance(double d)
public double getContactDistance()
public void setBreakSpeed(double s)
public double getBreakSpeed()
public void setBreakAccel(double a)
public double getBreakAccel()
public double getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals, boolean setEngaged)
BodyConstrainergetUnilateralConstraints in interface BodyConstrainerunilaterals - array list into which the constrainer places the constraintssetEngaged - if true, recompute the set of unilateral constraints.
If false, the set of unilateral constraints will stay the same.public void updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals, int offset, int numc)
BodyConstrainergetUnilateralConstraints, located at a specific offset within an array
list.updateUnilateralConstraints in interface BodyConstrainerunilaterals - contains constraints which should be updatedoffset - starting location of constraints within unilateralsnumc - number of constraints to updatepublic int setUnilateralImpulses(VectorNd the, double h, int idx)
setUnilateralImpulses in interface BodyConstrainersetUnilateralImpulses in interface Constrainerpublic int getUnilateralImpulses(VectorNd the, int idx)
getUnilateralImpulses in interface BodyConstrainergetUnilateralImpulses in interface Constrainerpublic boolean isActive()
public void transformGeometry(AffineTransform3dBase X)
TransformableGeometryTransformGeometryContext.transform (this, X, 0);
transformGeometry in interface TransformableGeometryX - affine transformation to apply to the componentpublic void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometrygtr to transform its individual attributes. The
context argument supplies information about what other
components are currently being transformed, and also allows the
requesting of update actions to be performed after all transform called
have completed. The context is also the usual entity that calls
this method, from within its TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method. The argument flags provides flags to specify
various conditions associated with the the transformation.
At present, the available flags are TransformableGeometry.TG_SIMULATING and
TransformableGeometry.TG_ARTICULATED.
This method is not usually called directly by applications.
Instead, it is typically called from within the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int) method of the context,
which takes care of the various operations needed for a
complete transform operation, including calling
TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int) to collect other
components that should be transformed, calling
TransformableGeometry.transformGeometry(maspack.matrix.AffineTransform3dBase) for each component, notifying
component parents that the geometry has changed, and calling
any requested TransformGeometryActions. More details
are given in the documentation for
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int).
TransformGeometryContext provides a number of
static convenience transform methods
which take care of building the context and calling
apply() for a specified set of components.
This method should not
generally call transformGeometry() for its descendant
components. Instead, descendants needing transformation should be
specified by adding them to the context in the method TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int).
transformGeometry in interface TransformableGeometrygtr - transformer implementing the transformcontext - context information, including what other components
are being transformedflags - specifies conditions associated with the transformationpublic void addTransformableDependencies(TransformGeometryContext context, int flags)
TransformableGeometrycontext any transformable components which should be
transformed as the same time as this component. This will generally
include descendant components, and may also include other components to
which this component is connected in some way.
This method is generally called from with the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int) method of a
TransformGeometryContext.
addTransformableDependencies in interface TransformableGeometrycontext - context information, to which the dependent components
are added.flags - specifies conditions associated with the transformationpublic void getHardReferences(java.util.List<ModelComponent> refs)
ModelComponentBasegetHardReferences in interface ModelComponentgetHardReferences in class ModelComponentBaserefs - list to which hard references are appendedpublic void connectToHierarchy()
ModelComponentBase
When this method is called, ModelComponent.getParent() will return
the new parent component; the system will have set this beforehand.
connectToHierarchy in interface ModelComponentconnectToHierarchy in class ModelComponentBasepublic void disconnectFromHierarchy()
ModelComponentBase When this
method is called, ModelComponent.getParent() will still return this original
parent component; the system will set this to null after.
disconnectFromHierarchy in interface ModelComponentdisconnectFromHierarchy in class ModelComponentBasepublic boolean isDuplicatable()
public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
public ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
copy in class RenderableComponentBasepublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderableupdateBounds in interface IsRenderableupdateBounds in class RenderableComponentBasepmin - minimum pointpmax - maximum pointpublic void updateForBodyPositionChange(ConnectableBody body, RigidTransform3d TXW)
public void advanceAuxState(double t0,
double t1)
HasAuxStateadvanceAuxState in interface HasAuxStatet0 - beginning time associated with the time step advancet1 - end time associated with the time step advancepublic void skipAuxState(DataBuffer data)
skipAuxState in interface HasAuxStatedata - buffer containing the state informationpublic void getAuxState(DataBuffer data)
HasAuxStategetAuxState in interface HasAuxStatedata - buffer for storing the state values.public void setAuxState(DataBuffer data)
HasAuxStatesetAuxState in interface HasAuxStatedata - buffer containing the state informationpublic void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
HasAuxStateIf oldData is non-null, then this contains
previously stored initial state information (starting at its current
buffer offsets), which should be stored into
newData in place of the current component state data.
This may only be partially possible if the component's state structure
has changed since oldData was written.
getInitialAuxState in interface HasAuxStatenewData - buffer for storing the state values.oldData - if non-null, contains old state information that should be
written into newData in place of the current state
information.public boolean hasState()
hasState in interface ModelComponenthasState in class ModelComponentBasetrue if this component has statepublic static boolean findAttachedBodies(ConnectableBody body, ConnectableBody exclude, java.util.List<ConnectableBody> bodies)