public class ForceEffectorTerm extends LeastSquaresTermBase
QPTerm.Type
ModelComponent.NavpanelVisibility
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
boolean |
debugHf |
VectorNd |
myForceError |
static PropertyList |
myProps |
DEFAULT_ENABLED, DEFAULT_WEIGHT
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
ForceEffectorTerm() |
ForceEffectorTerm(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
ForceEffectorTarget |
addForce(ForceTargetComponent fcomp)
Deprecated.
Use
addTarget(ForceTargetComponent) instead. |
ForceEffectorTarget |
addForce(ForceTargetComponent fcomp,
double weight,
boolean staticOnly)
Deprecated.
Use
addTarget(ForceTargetComponent,double,boolean)
instead. |
ForceEffectorTarget |
addTarget(ForceTargetComponent fcomp)
Adds a force component whose force should be controlled
|
ForceEffectorTarget |
addTarget(ForceTargetComponent fcomp,
double weight)
Adds a force component whose force should be controlled
|
ForceEffectorTarget |
addTarget(ForceTargetComponent fcomp,
double weight,
boolean staticOnly)
Adds a force component whose force should be controlled
|
void |
clearTargets()
Removes 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() |
void |
getForceError(VectorNd totalForce) |
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<ForceTargetComponent> |
getSources()
Returns a list of the ForceTargetComponents being controlled.
|
java.util.ArrayList<ForceEffectorTarget> |
getTargets()
Returns a list of the ForceEffectorTargets for all the
ForceTargetComponents being controlled.
|
VectorNd |
getTargetWeights(int idx)
Returns target weights, one per force.
|
int |
getTerm(MatrixNd A,
VectorNd b,
int rowoff,
double t0,
double t1)
Fills
H and b with this motion term |
boolean |
isStaticOnly() |
int |
numConstraints(int qpsize)
Returns the number of constraints associated with this term.
|
void |
setTargetWeights(int idx,
double weight)
Sets overall weight for a force component.
|
void |
setTargetWeights(int idx,
VectorNd weights)
Sets weights for a force component.
|
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) |
componentChanged, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getType, hasChildren, hierarchyContainsReferences, indexOf, iterator, numComponents, postscan, scan, setDisplayMode, setType, updateNameMap
getController, getProperty, getWeight, isEnabled, isInternal, setEnabled, 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, isEnabled
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
isWritable, write
public boolean debugHf
public VectorNd myForceError
public static PropertyList myProps
public ForceEffectorTerm()
public ForceEffectorTerm(java.lang.String name)
public PropertyList getAllPropertyInfo()
QPTermBase
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class QPTermBase
public void getForceError(VectorNd totalForce)
public ForceEffectorTarget addForce(ForceTargetComponent fcomp, double weight, boolean staticOnly)
addTarget(ForceTargetComponent,double,boolean)
instead.public ForceEffectorTarget addForce(ForceTargetComponent fcomp)
addTarget(ForceTargetComponent)
instead.public ForceEffectorTarget addTarget(ForceTargetComponent fcomp, double weight, boolean staticOnly)
fcomp
- force componentweight
- used for the componentstaticOnly
- true
if only static forces should be controlledpublic ForceEffectorTarget addTarget(ForceTargetComponent fcomp, double weight)
fcomp
- force componentweight
- used for the componentpublic ForceEffectorTarget addTarget(ForceTargetComponent fcomp)
fcomp
- force componentpublic void clearTargets()
public java.util.ArrayList<ForceTargetComponent> getSources()
public java.util.ArrayList<ForceEffectorTarget> getTargets()
public boolean isStaticOnly()
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(int idx, VectorNd weights)
idx
- force component indexweights
- vector of weightspublic void setTargetWeights(int idx, double weight)
idx
- force component indexweight
- weight factorpublic VectorNd getTargetWeights(int idx)
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 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 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