public class ForceMinimizationTerm extends LeastSquaresTermBase
Modifier and Type | Field and Description |
---|---|
boolean |
debugHf |
static boolean |
DEFAULT_DELTA_ACTIVATIONS |
static boolean |
DEFAULT_NORMALIZE_H |
static boolean |
DEFAULT_USE_KKT_FACTORANDSOLVE |
static boolean |
DEFAULT_USE_TRAPEZOIDAL_SOLVER |
static double |
DEFAULT_WEIGHT |
static PropertyList |
myProps |
VectorNd |
myTotalForce |
defaultWeight
DEFAULT_ENABLED
Constructor and Description |
---|
ForceMinimizationTerm(TrackingController controller) |
ForceMinimizationTerm(TrackingController controller,
double weight) |
Modifier and Type | Method and Description |
---|---|
void |
addForce(MinimizableForceComponent fcomp)
Adds a force component whose force should be minimized
|
void |
addForce(MinimizableForceComponent fcomp,
double weight)
Adds a force component whose force should be minimized
|
void |
addForce(MinimizableForceComponent fcomp,
double weight,
boolean staticOnly)
Adds a force component whose force should be minimized
|
void |
addForce(MinimizableForceComponent fcomp,
VectorNd weights,
boolean staticOnly)
Adds a force component whose force should be minimized
|
void |
clearTargets()
Removes targets
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
java.util.ArrayList<MinimizableForceComponent> |
getForces()
Returns list of target points/frames
|
int |
getModelVelSize() |
boolean |
getNormalizeH()
Returns whether or not we're normalizing this term's contribution to
H and b . |
int |
getRowSize()
Returns the number of rows.
|
SparseBlockMatrix |
getStiffnessJacobian(double h)
Returns the velocity Jacobian, creates if null
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
|
VectorNd |
getTargetWeights(int idx)
Returns target weights, one per force.
|
int |
getTerm(MatrixNd H,
VectorNd b,
int rowoff,
double t0,
double t1)
Fills
H and b with this motion term |
void |
getTotalForce(VectorNd totalForce) |
int |
getTotalForceSize() |
boolean |
getUseKKTFactorAndSolve() |
boolean |
isStaticOnly() |
void |
reGetTerm(MatrixNd H,
VectorNd b)
Fills
H and b with this motion term
In contrast to getTerm , this method does not
recompute the values. |
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(int idx,
double weight)
Sets overall weight for a force component.
|
void |
setTargetWeights(int idx,
VectorNd weights)
Sets weights for a force component.
|
void |
setUseKKTFactorAndSolve(boolean useKKTFactorAndSolve) |
void |
setWeight(double w)
Weight used to scale the contribution of this term in the quadratic
optimization problem
|
void |
updateTotalForce() |
addRows, getQP, setSize
dispose, getProperty, getSize, getWeight, isEnabled, setEnabled
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEnabled
getProperty
public static final double DEFAULT_WEIGHT
public static final boolean DEFAULT_DELTA_ACTIVATIONS
public static boolean DEFAULT_USE_KKT_FACTORANDSOLVE
public static boolean DEFAULT_USE_TRAPEZOIDAL_SOLVER
public static boolean DEFAULT_NORMALIZE_H
public boolean debugHf
public static PropertyList myProps
public VectorNd myTotalForce
public ForceMinimizationTerm(TrackingController controller)
public ForceMinimizationTerm(TrackingController controller, double weight)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class LeastSquaresTermBase
public void getTotalForce(VectorNd totalForce)
public void updateTotalForce()
public void addForce(MinimizableForceComponent fcomp, double weight, boolean staticOnly)
fcomp
- force componentweight
- used in the minimizationstaticOnly
- true
if only static forces should be minimizedpublic void addForce(MinimizableForceComponent fcomp, double weight)
fcomp
- force componentweight
- used in the minimizationpublic void addForce(MinimizableForceComponent fcomp)
fcomp
- force componentpublic void addForce(MinimizableForceComponent fcomp, VectorNd weights, boolean staticOnly)
fcomp
- force componentweights
- used in the minimizationstaticOnly
- true
if only static forces should be minimizedpublic void clearTargets()
public java.util.ArrayList<MinimizableForceComponent> getForces()
public int getModelVelSize()
public int getTotalForceSize()
public SparseBlockMatrix getStiffnessJacobian(double h)
public boolean isStaticOnly()
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 reGetTerm(MatrixNd H, VectorNd b)
H
and b
with this motion term
In contrast to getTerm
, this method does not
recompute the values.public void setWeight(double w)
setWeight
in interface QPTerm
setWeight
in class QPTermBase
public 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 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 boolean getUseKKTFactorAndSolve()
public void setUseKKTFactorAndSolve(boolean useKKTFactorAndSolve)