public class SimpleCoordinateCoupler extends ConstrainerBase
ModelComponent.NavpanelVisibility
enforceUniqueCompositeNames, 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.List<DynamicComponent> list)
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, setUnilateralState
checkFlag, 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, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarState
public SimpleCoordinateCoupler()
public SimpleCoordinateCoupler(OpenSimCustomJoint joint0, int coordNum0, OpenSimCustomJoint joint1, int coordNum1)
public void getBilateralSizes(VectorNi sizes)
Constrainer
sizes
.getBilateralSizes
in interface Constrainer
getBilateralSizes
in class ConstrainerBase
sizes
- vector to which the block column sizes are appendedpublic int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
Constrainer
Gc^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 Constrainer
addBilateralConstraints
in class ConstrainerBase
GT
- 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 dg
numb
public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
Constrainer
Gc 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 Constrainer
getBilateralInfo
in class ConstrainerBase
ginfo
- returns the constraint informationidx
- starting location in ginfo
for returning constraint
infoidx
public int setBilateralForces(VectorNd lam, double s, int idx)
Constrainer
lam
, 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 Constrainer
setBilateralForces
in class ConstrainerBase
lam
- supplies the force impulses, which should be scaled by s
s
- scaling factor for the force valuesidx
- starting index of forces in lam
idx
public int getBilateralForces(VectorNd lam, int idx)
Constrainer
Constrainer.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 Constrainer
getBilateralForces
in class ConstrainerBase
lam
- returns the forcesidx
- starting index for forces in lam
idx
public void zeroForces()
Constrainer
zeroForces
in interface Constrainer
zeroForces
in class ConstrainerBase
public double updateConstraints(double t, int flags)
Constrainer
>
0 associated with all of them. If no constraints are
presently active, returns -1.updateConstraints
in interface Constrainer
updateConstraints
in class ConstrainerBase
public void getConstrainedComponents(java.util.List<DynamicComponent> list)
Constrainer
getConstrainedComponents
in interface Constrainer
getConstrainedComponents
in class ConstrainerBase
list
- list to which constrained components should be appended