public class ForceTargetTerm extends LeastSquaresTermBase
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_NORMALIZE_H |
static double |
DEFAULT_WEIGHT |
static PropertyList |
myProps |
DEFAULT_ENABLED, defaultWeight
Constructor and Description |
---|
ForceTargetTerm(TrackingController controller) |
ForceTargetTerm(TrackingController controller,
double weight) |
Modifier and Type | Method and Description |
---|---|
ForceTarget |
addForceTarget(BodyConnector con)
Adds a target to track the reaction force of the specified body connector
|
ForceTarget |
addForceTarget(BodyConnector con,
double weight)
Adds a target to track the reaction force of the specified body connector
|
ForceTarget |
addForceTarget(BodyConnector con,
VectorNd targetLambda)
Adds a target to track the reaction force of the specified body connector
|
ForceTarget |
addForceTarget(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
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
SparseBlockMatrix |
getForceJacobian()
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
|
java.util.ArrayList<ForceTarget> |
getForceTargets() |
boolean |
getNormalizeH()
Returns whether or not we're normalizing this term's contribution to
H and b . |
int |
getRowSize()
Returns the number of rows.
|
VectorNd |
getTargetWeights() |
void |
getTargetWeights(VectorNd out) |
int |
getTerm(MatrixNd H,
VectorNd b,
int rowoff,
double t0,
double t1)
Fills
H and b with this motion term |
boolean |
isEnabled()
Returns that enabled status of this term, for use if term is
an inequality / equality constraint
|
void |
setEnabled(boolean enabled) |
void |
setNormalizeH(boolean enable)
Sets whether or not to normalize the contribution to
H
and b by the Frobenius norm of this term's H block. |
void |
setTargetWeights(VectorNd wgts) |
void |
setWeight(double w)
Weight used to scale the contribution of this term in the quadratic optimization problem
|
void |
updateTargetForce(double t0,
double t1) |
addRows, getQP, setSize
dispose, getProperty, getSize, getWeight
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProperty
public static final double DEFAULT_WEIGHT
public static boolean DEFAULT_NORMALIZE_H
public static PropertyList myProps
public ForceTargetTerm(TrackingController controller)
public ForceTargetTerm(TrackingController controller, double weight)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class LeastSquaresTermBase
public void updateTargetForce(double t0, double t1)
public boolean isEnabled()
LeastSquaresTerm
isEnabled
in interface LeastSquaresTerm
isEnabled
in class LeastSquaresTermBase
public void setEnabled(boolean enabled)
setEnabled
in class LeastSquaresTermBase
public SparseBlockMatrix getForceJacobian()
public ForceTarget addForceTarget(BodyConnector con)
con
- body connector to trackpublic ForceTarget addForceTarget(BodyConnector con, double weight)
con
- body connector to trackweight
- used in error trackingpublic ForceTarget addForceTarget(BodyConnector con, VectorNd targetLambda)
con
- body connector to tracktargetLambda
- target reaction force for the connectorpublic ForceTarget addForceTarget(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 H, VectorNd b, int rowoff, double t0, double t1)
H
and b
with this motion termgetTerm
in interface LeastSquaresTerm
getTerm
in class LeastSquaresTermBase
H
- 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 setWeight(double w)
setWeight
in interface QPTerm
setWeight
in class QPTermBase
public void setTargetWeights(VectorNd wgts)
public void getTargetWeights(VectorNd out)
public VectorNd getTargetWeights()
public void setNormalizeH(boolean enable)
H
and b
by the Frobenius norm of this term's H
block.
This is for scaling purposes when damping is important. If set to false,
then the damping term's scale will depend on the time and spatial scales.
However, if set to true, we will likely scale this term differently every
time step.enable
- if true
, enables normalizationpublic boolean getNormalizeH()
H
and b
. See setNormalizeH(boolean)
H
and b
public int getRowSize()
LeastSquaresTerm
public java.util.ArrayList<ForceTarget> getForceTargets()