public class SimpleCoordinateCoupler extends ConstrainerBase
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibilityenforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames| Constructor and Description |
|---|
SimpleCoordinateCoupler() |
SimpleCoordinateCoupler(OpenSimCustomJoint joint0,
int coordNum0,
OpenSimCustomJoint joint1,
int coordNum1) |
| Modifier and Type | Method and Description |
|---|---|
int |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb)
Appends the current bilateral force constraint matrix
Gc^T to the
matrix GT, by appending block columns to it. |
int |
getBilateralForces(VectorNd lam,
int idx)
Returns the bilateral forces that were most recently set for this
constrainer using
Constrainer.setBilateralForces(maspack.matrix.VectorNd, double, int). |
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx)
Returns constraint information for each row of the bilateral
constraint system
|
void |
getBilateralSizes(VectorNi sizes)
Returns the sizes of each block column in the bilateral force constraint
matrix.
|
void |
getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
Collected all the dynamic components constrained by this constrainer.
|
int |
setBilateralForces(VectorNd lam,
double s,
int idx)
Sets the bilateral forces that were computed to enforce this
constraint.
|
double |
updateConstraints(double t,
int flags)
Updates the current set of constraints, and returns the maximum
penetration
> 0 associated with all of them. |
void |
zeroForces()
Zeros all bilateral and unilateral constraint forces in this constraint.
|
addFrictionConstraints, addUnilateralConstraints, getFrictionForces, getFrictionState, getState, getUnilateralForces, getUnilateralInfo, getUnilateralSizes, getUnilateralState, hasState, maxFrictionConstraintSets, setFrictionForces, setFrictionState, setState, setUnilateralForces, setUnilateralStatecheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getAllPropertyInfo, getChildren, getGrandParent, getHardReferences, 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, waitadvanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarStatepublic SimpleCoordinateCoupler()
public SimpleCoordinateCoupler(OpenSimCustomJoint joint0, int coordNum0, OpenSimCustomJoint joint1, int coordNum1)
public void getBilateralSizes(VectorNi sizes)
Constrainersizes.getBilateralSizes in interface ConstrainergetBilateralSizes in class ConstrainerBasesizes - vector to which the block column sizes are appendedpublic int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
ConstrainerGc^T to the
matrix GT, by appending block columns to it. If the argument
dg is non-null, it should be used to return the
velocity constraint time derivative, defined by
\dot Gc velstarting at the location
numb. In all cases, the method must
return an updated value of numb, incremented by the total row
size of Gc.addBilateralConstraints in interface ConstraineraddBilateralConstraints in class ConstrainerBaseGT - matrix to which the bilateral force contraint matrix
is appended.dg - if non-null, returns the velocity constraint time
derivativenumb - starting index for time derivative in dgnumbpublic int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
ConstrainerGc vel = 0.This information is placed in pre-allocated
MechSystem.ConstraintInfo
structures in ginfo, starting at idx. The method must
return an updated value of idx, incremented by the number of
rows of Gc.
The constraint information to be set in ConstraintInfo includes:
dist // distance to the constraint surface. compliance // if > 0, gives constraint compliance value damping // damping; only used if compliance > 0 force // used for computing non-linear compliance
getBilateralInfo in interface ConstrainergetBilateralInfo in class ConstrainerBaseginfo - returns the constraint informationidx - starting location in ginfo for returning constraint
infoidxpublic int setBilateralForces(VectorNd lam, double s, int idx)
Constrainerlam, starting at the index idx, and should be
scaled by s. (In practice, s is used to convert from
impulses to forces.) The method must return an updated value of idx, incremented by the number of forces associated with this constraint.setBilateralForces in interface ConstrainersetBilateralForces in class ConstrainerBaselam - supplies the force impulses, which should be scaled by ss - scaling factor for the force valuesidx - starting index of forces in lamidxpublic int getBilateralForces(VectorNd lam, int idx)
ConstrainerConstrainer.setBilateralForces(maspack.matrix.VectorNd, double, int). The forces are returned in
lam, starting at the index idx. The method must return
an updated value of idx, incremented by the number of forces
associated with this constraint.getBilateralForces in interface ConstrainergetBilateralForces in class ConstrainerBaselam - returns the forcesidx - starting index for forces in lamidxpublic void zeroForces()
ConstrainerzeroForces in interface ConstrainerzeroForces in class ConstrainerBasepublic double updateConstraints(double t,
int flags)
Constrainer> 0 associated with all of them. If no constraints are
presently active, returns -1.updateConstraints in interface ConstrainerupdateConstraints in class ConstrainerBasepublic void getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
ConstrainergetConstrainedComponents in interface ConstrainergetConstrainedComponents in class ConstrainerBasecomps - set to which constrained components should be added