public class ConstraintForceTerm extends LeastSquaresTermBase
QPTerm.Type
ModelComponent.NavpanelVisibility
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_WEIGHT |
static PropertyList |
myProps |
DEFAULT_ENABLED
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
ConstraintForceTerm() |
ConstraintForceTerm(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
ForceTarget |
addForceTarget(BodyConnector con)
Deprecated.
Use
addTarget(BodyConnector) instead. |
ForceTarget |
addForceTarget(BodyConnector con,
double weight)
Deprecated.
Use
addTarget(BodyConnector,double) instead. |
ForceTarget |
addForceTarget(BodyConnector con,
VectorNd targetLambda)
Deprecated.
Use
addTarget(BodyConnector,VectorNd) instead. |
ForceTarget |
addForceTarget(BodyConnector con,
VectorNd targetLambda,
double weight)
Deprecated.
Use
addTarget(BodyConnector,VectorNd,double) instead. |
ConstraintForceTarget |
addTarget(BodyConnector con)
Adds a target to track the reaction force of the specified body connector
|
ConstraintForceTarget |
addTarget(BodyConnector con,
double weight)
Adds a target to track the reaction force of the specified body connector
|
ConstraintForceTarget |
addTarget(BodyConnector con,
VectorNd targetLambda)
Adds a target to track the reaction force of the specified body connector
|
ConstraintForceTarget |
addTarget(BodyConnector con,
VectorNd targetLambda,
double weight)
Adds a target to track the reaction force of the specified body connector
|
void |
clearTargets()
Removes all force targets
|
void |
connectToHierarchy(CompositeComponent hcomp)
Called by the system after this component, or an ancestor of this
component, is added to the component hierarchy (i.e., added as
a child of another CompositeComponent).
|
void |
disconnectFromHierarchy(CompositeComponent hcomp)
Called by the system after this component, or an ancestor of this
component, is removed from the component hierarchy (i.e., removed as a
child of its parent).
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
VectorNd |
getB() |
SparseBlockMatrix |
getForceJacobian(MechModel mech)
XXX This Jacobian needs to be re-computed at each time step
OR it needs to be transformed to global co-ordinates so that the
tracking controller can use it properly, since it does not change
as the model moves
|
ComponentList<ForceTarget> |
getForceTargets()
Deprecated.
Use
getTargets() instead. |
MatrixNd |
getH() |
void |
getQP(MatrixNd Q,
VectorNd p,
double t0,
double t1)
Adds the contribution of this term to the quadratic cost
components Q and p.
|
java.util.ArrayList<BodyConnector> |
getSources() |
VectorNd |
getTargetForce(double t0,
double t1) |
java.util.ArrayList<ConstraintForceTarget> |
getTargets() |
VectorNd |
getTargetWeights() |
void |
getTargetWeights(VectorNd weights) |
int |
getTerm(MatrixNd A,
VectorNd b,
int rowoff,
double t0,
double t1)
Fills
H and b with this motion term |
boolean |
isEnabled()
Queries the enabled status of this term.
|
int |
numConstraints(int qpsize)
Returns the number of constraints associated with this term.
|
void |
setEnabled(boolean enabled) |
void |
setTargetWeights(VectorNd weights) |
void |
setWeight(double w)
Weight used to scale the contribution of this term in the quadratic
optimization problem
|
void |
updateHb(TrackingController controller,
double t0,
double t1) |
void |
updateTargetForce(double t0,
double t1) |
componentChanged, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getType, hasChildren, hierarchyContainsReferences, indexOf, iterator, numComponents, postscan, scan, setDisplayMode, setType, updateNameMap
getController, getProperty, getWeight, isInternal, setInternal
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, copy, createTempFlag, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getController, getWeight
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
isWritable, write
public static final double DEFAULT_WEIGHT
public static PropertyList myProps
public ConstraintForceTerm()
public ConstraintForceTerm(java.lang.String name)
public PropertyList getAllPropertyInfo()
QPTermBase
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class QPTermBase
public VectorNd getTargetForce(double t0, double t1)
public void updateTargetForce(double t0, double t1)
public boolean isEnabled()
QPTermBase
isEnabled
in interface QPTerm
isEnabled
in class QPTermBase
public void setEnabled(boolean enabled)
QPTermBase
setEnabled
in class QPTermBase
public SparseBlockMatrix getForceJacobian(MechModel mech)
public ForceTarget addForceTarget(BodyConnector con)
addTarget(BodyConnector)
instead.public ForceTarget addForceTarget(BodyConnector con, double weight)
addTarget(BodyConnector,double)
instead.public ForceTarget addForceTarget(BodyConnector con, VectorNd targetLambda)
addTarget(BodyConnector,VectorNd)
instead.public ForceTarget addForceTarget(BodyConnector con, VectorNd targetLambda, double weight)
addTarget(BodyConnector,VectorNd,double)
instead.public ConstraintForceTarget addTarget(BodyConnector con)
con
- body connector to trackpublic ConstraintForceTarget addTarget(BodyConnector con, double weight)
con
- body connector to trackweight
- used in error trackingpublic ConstraintForceTarget addTarget(BodyConnector con, VectorNd targetLambda)
con
- body connector to tracktargetLambda
- target reaction force for the connectorpublic ConstraintForceTarget addTarget(BodyConnector con, VectorNd targetLambda, double weight)
con
- body connector to tracktargetLambda
- target reaction force for the connectorweight
- used in error trackingpublic void clearTargets()
public int getTerm(MatrixNd A, VectorNd b, int rowoff, double t0, double t1)
H
and b
with this motion termA
- LHS matrix to fillb
- RHS vector to fillrowoff
- row offset to start filling termt0
- starting time of time stept1
- ending time of time steppublic void updateHb(TrackingController controller, double t0, double t1)
public MatrixNd getH()
public VectorNd getB()
public void setWeight(double w)
setWeight
in interface QPTerm
setWeight
in class QPTermBase
w
- weight for the termpublic void setTargetWeights(VectorNd weights)
public void getTargetWeights(VectorNd weights)
public VectorNd getTargetWeights()
public int numConstraints(int qpsize)
QPConstraintTerm
qpsize
- size of the quadratic program. For the tracking
controller, this is the number of excitation values being used,public void getQP(MatrixNd Q, VectorNd p, double t0, double t1)
QPCostTerm
Q
- quadratic termp
- proportional termt0
- time at start of stept1
- time at end of steppublic ComponentList<ForceTarget> getForceTargets()
getTargets()
instead.public java.util.ArrayList<ConstraintForceTarget> getTargets()
public java.util.ArrayList<BodyConnector> getSources()
public void connectToHierarchy(CompositeComponent hcomp)
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
hcomp
- hierarchy component to which this component,
or its ancestor, was attachedpublic void disconnectFromHierarchy(CompositeComponent hcomp)
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
hcomp
- hierarchy component from which this component,
or its ancestor, was detached