|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartisynth.core.modelbase.ModelComponentBase
artisynth.core.modelbase.RenderableComponentBase
artisynth.core.mechmodels.RigidBodyConnector
public abstract class RigidBodyConnector
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.HasAuxState |
---|
HasAuxState.StateContext |
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent |
---|
ModelComponent.NavpanelVisibility |
Field Summary | |
---|---|
static PropertyList |
myProps
|
Fields inherited from class artisynth.core.modelbase.ModelComponentBase |
---|
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames |
Fields inherited from interface artisynth.core.util.TransformableGeometry |
---|
ARTICULATED, SIMULATING |
Fields inherited from interface maspack.render.GLRenderable |
---|
TRANSLUCENT, TWO_DIMENSIONAL |
Method Summary | |
---|---|
int |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb,
IntHolder changeCnt)
|
int |
addFrictionConstraints(SparseBlockMatrix DT,
MechSystem.FrictionInfo[] finfo,
int numf)
|
static int |
addFrictionConstraints(SparseBlockMatrix DT,
MechSystem.FrictionInfo[] finfo,
int numf,
java.util.ArrayList<RigidBodyConstraint> unilaterals,
RigidBody bodyA,
RigidBody bodyB,
RigidTransform3d XCA)
|
int |
addUnilateralConstraints(SparseBlockMatrix NT,
VectorNd dn,
int numu,
IntHolder changeCnt)
|
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). |
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. |
MatrixNdBlock |
getBilateralBlockA(int numb)
|
MatrixNdBlock |
getBilateralBlockB(int numb)
|
int |
getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
Gets the bilateral constraints associated with this constrainer. |
Wrench |
getBilateralForceInA()
Returns the most recently computed bilateral constraint force as seen in the coordinate frame of body A. |
void |
getBilateralForceInA(Wrench wr)
Returns the most recently computed bilateral constraint force as seen in the coordinate frame of body A. |
int |
getBilateralImpulses(VectorNd lam,
int idx)
|
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx)
|
void |
getBilateralSizes(VectorNi sizes)
|
RigidBody |
getBodyA()
Returns the first body associated with this constrainer. |
RigidBody |
getBodyB()
Returns the second body associated with this constrainer, or null if there is no such body. |
double |
getBreakAccel()
|
double |
getBreakSpeed()
|
VectorNd |
getCompliance()
|
double |
getContactDistance()
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
|
void |
getCurrentXDB(RigidTransform3d XDB)
|
RigidTransform3d |
getCurrentXDW()
|
void |
getCurrentXFA(RigidTransform3d XFA)
|
RigidTransform3d |
getCurrentXFW()
|
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()
|
double |
getPenetrationTol()
|
PropertyMode |
getPenetrationTolMode()
|
void |
getPose(RigidTransform3d X)
|
double |
getRotaryCompliance()
|
MatrixNdBlock |
getUnilateralBlockA(int numb)
|
MatrixNdBlock |
getUnilateralBlockB(int numb)
|
double |
getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
boolean setEngaged)
Gets the unilateral constraints associated with this constrainer. |
Wrench |
getUnilateralForceInA()
Returns the most recently computed unilateral constraint force as seen in the coordinate frame of body A. |
void |
getUnilateralForceInA(Wrench wr)
Returns the most recently computed unilateral constraint force as seen in the coordinate frame of body A. |
int |
getUnilateralImpulses(VectorNd the,
int idx)
|
int |
getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo,
int idx)
|
void |
getUnilateralSizes(VectorNi sizes)
|
RigidTransform3d |
getXCA()
Returns the most recently updated value for XCA. |
RigidTransform3d |
getXCB()
Returns the most recently updated value for XCB. |
RigidTransform3d |
getXDB()
|
RigidTransform3d |
getXFA()
|
boolean |
hasState()
Returns true if this component has state. |
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 associated RigidBodies 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 |
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(RigidBody bodyA,
RigidTransform3d XFA,
RigidBody bodyB,
RigidTransform3d XDB)
|
void |
setBreakAccel(double a)
|
void |
setBreakSpeed(double s)
|
void |
setCompliance(VectorNd compliance)
|
void |
setContactDistance(double d)
|
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 |
setXDB(RigidTransform3d XDB)
|
void |
setXFA(RigidTransform3d XFA)
|
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 object. |
void |
transformGeometry(AffineTransform3dBase X,
TransformableGeometry topObject,
int flags)
Adjusts the global location of this constraint, assuming the global locations of A and B remain unchanged. |
void |
updateBodyStates(double t,
boolean setEngaged)
Updates internal information needed for computing constraints. |
void |
updateBounds(Point3d pmin,
Point3d pmax)
Update the minimum and maximum points for this object. |
double |
updateConstraints(double t,
int flags)
|
void |
updateForBodyPositionChange(RigidBody body,
RigidTransform3d XBodyToWorldNew)
|
void |
updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
int offset,
int numc)
Updates the unilateral constraints associated with this constrainer. |
void |
zeroImpulses()
|
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase |
---|
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, render, setRenderProps, updateRenderProps |
Methods inherited from class artisynth.core.modelbase.ModelComponentBase |
---|
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface artisynth.core.modelbase.ModelComponent |
---|
getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences |
Methods inherited from interface maspack.properties.HasProperties |
---|
getProperty |
Methods inherited from interface maspack.properties.HierarchyNode |
---|
getChildren, hasChildren |
Methods inherited from interface maspack.util.Scannable |
---|
isWritable, write |
Field Detail |
---|
public static PropertyList myProps
Method Detail |
---|
public void setPenetrationTol(double tol)
setPenetrationTol
in interface RigidBodyConstrainer
tol
- new penetration tolerancepublic double getPenetrationTol()
getPenetrationTol
in interface RigidBodyConstrainer
public PropertyMode getPenetrationTolMode()
public void setPenetrationTolMode(PropertyMode mode)
public void getBilateralForceInA(Wrench wr)
getBilateralForceInA(maspack.spatialmotion.Wrench)
since it does not allocate a Wrench object.
wr
- returns the constraint forcepublic Wrench getBilateralForceInA()
public void getUnilateralForceInA(Wrench wr)
getUnilateralForceInA(maspack.spatialmotion.Wrench)
since it does not allocate a Wrench object.
wr
- returns the constraint forcepublic Wrench getUnilateralForceInA()
public double getLinearCompliance()
public void setLinearCompliance(double c)
public double getRotaryCompliance()
public void setRotaryCompliance(double c)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ModelComponentBase
public 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 RigidBody getBodyA()
RigidBodyConstrainer
getBodyA
in interface RigidBodyConstrainer
public RigidBody getBodyB()
RigidBodyConstrainer
getBodyB
in interface RigidBodyConstrainer
public MatrixNdBlock getBilateralBlockA(int numb)
getBilateralBlockA
in interface RigidBodyConstrainer
public MatrixNdBlock getBilateralBlockB(int numb)
getBilateralBlockB
in interface RigidBodyConstrainer
public MatrixNdBlock getUnilateralBlockA(int numb)
getUnilateralBlockA
in interface RigidBodyConstrainer
public MatrixNdBlock getUnilateralBlockB(int numb)
getUnilateralBlockB
in interface RigidBodyConstrainer
public RigidTransform3d getXFA()
public void getCurrentXFA(RigidTransform3d XFA)
public void setXFA(RigidTransform3d XFA)
public RigidTransform3d getXDB()
public void getCurrentXDB(RigidTransform3d XDB)
public void setXDB(RigidTransform3d XDB)
public int numBilateralConstraints()
RigidBodyConstrainer
numBilateralConstraints
in interface RigidBodyConstrainer
public int numUnilateralConstraints()
RigidBodyConstrainer
getUnilateralConstraints
with
setEngaged
set to false
.
numUnilateralConstraints
in interface RigidBodyConstrainer
public void getBilateralSizes(VectorNi sizes)
getBilateralSizes
in interface Constrainer
getBilateralSizes
in interface RigidBodyConstrainer
public void getUnilateralSizes(VectorNi sizes)
getUnilateralSizes
in interface Constrainer
getUnilateralSizes
in interface RigidBodyConstrainer
public double updateConstraints(double t, int flags)
updateConstraints
in interface Constrainer
updateConstraints
in interface RigidBodyConstrainer
public int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb, IntHolder changeCnt)
addBilateralConstraints
in interface Constrainer
public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
getBilateralInfo
in interface Constrainer
public int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dn, int numu, IntHolder changeCnt)
addUnilateralConstraints
in interface Constrainer
public int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo, int idx)
getUnilateralInfo
in interface Constrainer
public int maxFrictionConstraintSets()
maxFrictionConstraintSets
in interface Constrainer
public int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf)
addFrictionConstraints
in interface Constrainer
public static int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf, java.util.ArrayList<RigidBodyConstraint> unilaterals, RigidBody bodyA, RigidBody bodyB, RigidTransform3d XCA)
public void setBodies(RigidBody bodyA, RigidTransform3d XFA, RigidBody bodyB, RigidTransform3d XDB)
public RigidTransform3d getCurrentXDW()
public void getPose(RigidTransform3d X)
getPose
in interface HasCoordinateFrame
public RigidTransform3d getCurrentXFW()
public double getActivation(int idx)
idx
- index of the constraint
public void updateBodyStates(double t, boolean setEngaged)
RigidBodyConstrainer
updateBodyStates
in interface RigidBodyConstrainer
t
- current time (seconds)setEngaged
- if true
, then the method should determine
which unilateral constraints are engagedpublic RigidTransform3d getXCA()
updateBodyStates()
is called. The returned value
must be treated as read-only and not modified.
public RigidTransform3d getXCB()
updateBodyStates()
is called. The returned value
must be treated as read-only and not modified.
public void scaleMass(double m)
scaleMass
in interface ScalableUnits
m
- scaling factorpublic void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
s
- scaling factorpublic int getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
RigidBodyConstrainer
getBilateralConstraints
in interface RigidBodyConstrainer
bilaterals
- array list into which the constrainer places the constraintspublic int setBilateralImpulses(VectorNd lam, double h, int idx)
setBilateralImpulses
in interface Constrainer
setBilateralImpulses
in interface RigidBodyConstrainer
public int getBilateralImpulses(VectorNd lam, int idx)
getBilateralImpulses
in interface Constrainer
getBilateralImpulses
in interface RigidBodyConstrainer
public void zeroImpulses()
zeroImpulses
in interface Constrainer
zeroImpulses
in interface RigidBodyConstrainer
public boolean hasUnilateralConstraints()
RigidBodyConstrainer
hasUnilateralConstraints
in interface RigidBodyConstrainer
public 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)
RigidBodyConstrainer
getUnilateralConstraints
in interface RigidBodyConstrainer
unilaterals
- 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)
RigidBodyConstrainer
getUnilateralConstraints
, located at a specific offset within an array
list.
updateUnilateralConstraints
in interface RigidBodyConstrainer
unilaterals
- contains constraints which should be updatedoffset
- starting location of constraints within unilaterals
numc
- number of constraints to updatepublic int setUnilateralImpulses(VectorNd the, double h, int idx)
setUnilateralImpulses
in interface Constrainer
setUnilateralImpulses
in interface RigidBodyConstrainer
public int getUnilateralImpulses(VectorNd the, int idx)
getUnilateralImpulses
in interface Constrainer
getUnilateralImpulses
in interface RigidBodyConstrainer
public boolean isActive()
public void transformGeometry(AffineTransform3dBase X)
TransformableGeometry
transformGeometry (X, this, 0);
transformGeometry
in interface TransformableGeometry
X
- affine transformationpublic void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
If XDW represents frame D in world coordinates, then XDW is adjusted according to
XDW' = X XDWThis transformation is done using
mulAffineLeft
, which
removes the stretching and shearing components from X when adjusting the
rotation matrix. The transforms XDB is then updated accordingly. A
similar procedure is used for XFA.
transformGeometry
in interface TransformableGeometry
X
- an affine transform applied to frames D and F in world coordinatestopObject
- top-most object being transformedflags
- public void getHardReferences(java.util.List<ModelComponent> refs)
ModelComponentBase
getHardReferences
in interface ModelComponent
getHardReferences
in class ModelComponentBase
refs
- 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 ModelComponent
connectToHierarchy
in class ModelComponentBase
public 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 ModelComponent
disconnectFromHierarchy
in class ModelComponentBase
public 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 RenderableComponentBase
public void updateBounds(Point3d pmin, Point3d pmax)
GLRenderable
updateBounds
in interface GLRenderable
updateBounds
in class RenderableComponentBase
pmin
- minimum pointpmax
- maximum pointpublic void updateForBodyPositionChange(RigidBody body, RigidTransform3d XBodyToWorldNew)
public void advanceAuxState(double t0, double t1)
HasAuxState
advanceAuxState
in interface HasAuxState
t0
- beginning time associated with the time step advancet1
- end time associated with the time step advancepublic void skipAuxState(DataBuffer data)
skipAuxState
in interface HasAuxState
data
- buffer containing the state informationpublic void getAuxState(DataBuffer data)
HasAuxState
getAuxState
in interface HasAuxState
data
- buffer for storing the state values.public void setAuxState(DataBuffer data)
HasAuxState
setAuxState
in interface HasAuxState
data
- buffer containing the state informationpublic void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
HasAuxState
If 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 HasAuxState
newData
- 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 ModelComponent
hasState
in class ModelComponentBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |