public class MotionTargetTerm extends LeastSquaresTermBase
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_Kd |
static double |
DEFAULT_Kp |
static boolean |
DEFAULT_NORMALIZE_H |
static boolean |
DEFAULT_USE_PD_CONTROL |
static PropertyList |
myProps |
VectorNd |
postionError |
VectorNd |
velocityError |
defaultWeight
Constructor and Description |
---|
MotionTargetTerm(TrackingController trackingController) |
Modifier and Type | Method and Description |
---|---|
MotionTargetComponent |
addTarget(MotionTargetComponent target)
Adds a target to track
|
MotionTargetComponent |
addTarget(MotionTargetComponent source,
double weight)
Adds a target to track
|
void |
clearTargets()
Removes targets
|
void |
dispose() |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
VectorNd |
getCurrentVel() |
double |
getDerr() |
double |
getKd()
Returns the Derivative gain for PD controller.
|
double |
getKp()
Returns the Proportional gain for PD controller.
|
boolean |
getNormalizeH()
Returns whether or not we're normalizing this term's contribution to
H and b . |
double |
getPerr() |
RenderProps |
getSourceRenderProps()
Render props for the sources
|
java.util.ArrayList<MotionTargetComponent> |
getSources()
Returns list of source points/frames that are part of the model
that will move to the targets
|
RenderProps |
getTargetRenderProps()
Render props for targets
|
java.util.ArrayList<MotionTargetComponent> |
getTargets()
Returns list of target points/frames
|
int |
getTargetSize()
Returns complete size of velocity vector (not number of targets)
|
int |
getTargetVelSize() |
VectorNd |
getTargetWeights()
Returns target weights, one per target point.
|
void |
getTargetWeights(VectorNd out)
Gets weights for targets.
|
int |
getTerm(MatrixNd H,
VectorNd b,
int rowoff,
double t0,
double t1)
Fills
H and b with this motion term |
SparseBlockMatrix |
getVelocityJacobian()
Returns the velocity Jacobian, creates if null
|
void |
initSourceRenderProps() |
void |
initTargetRenderProps() |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled) |
void |
setKd(double k)
Derivative gain for PD controller
|
void |
setKp(double k)
Proportional gain for PD controller
|
void |
setNormalizeH(boolean set)
Sets whether or not to normalize the contribution to
H
and b by the Frobenius norm of this term's H block. |
void |
setSourceRenderProps(RenderProps rend)
Sets render props for sources
|
void |
setTargetRenderProps(RenderProps rend)
Sets render props for the target points/frames
|
void |
setTargetWeights(VectorNd wgts)
Sets weights for targets.
|
void |
setWeight(double w)
Weight used to scale the contribution of this term in the quadratic optimization problem
|
void |
updatePositionError() |
void |
updateTarget(double t0,
double t1) |
void |
updateVelocityError() |
getProperty, getWeight
public static final boolean DEFAULT_USE_PD_CONTROL
public static boolean DEFAULT_NORMALIZE_H
public static double DEFAULT_Kd
public static double DEFAULT_Kp
public static PropertyList myProps
public VectorNd postionError
public VectorNd velocityError
public MotionTargetTerm(TrackingController trackingController)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class LeastSquaresTermBase
public void updateTarget(double t0, double t1)
public void updatePositionError()
public void updateVelocityError()
public void dispose()
public boolean isEnabled()
public void setEnabled(boolean enabled)
public VectorNd getCurrentVel()
public void initTargetRenderProps()
public void initSourceRenderProps()
public MotionTargetComponent addTarget(MotionTargetComponent source, double weight)
source
- point or frame on the model you wish to drive to
a target positionweight
- used in error trackingpublic MotionTargetComponent addTarget(MotionTargetComponent target)
target
- point or frame on the model you wish to drive to
a target positionpublic void clearTargets()
public java.util.ArrayList<MotionTargetComponent> getTargets()
public java.util.ArrayList<MotionTargetComponent> getSources()
public int getTargetVelSize()
public SparseBlockMatrix getVelocityJacobian()
public int getTargetSize()
public int getTerm(MatrixNd H, VectorNd b, int rowoff, double t0, double t1)
H
and b
with this motion termH
- 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 LeastSquaresTerm
setWeight
in class LeastSquaresTermBase
public void setTargetWeights(VectorNd wgts)
H
(allows you to scale x,y,z
components of velocity separately).wgts
- weights vectorpublic void getTargetWeights(VectorNd out)
out
- weights vectorpublic RenderProps getTargetRenderProps()
public VectorNd getTargetWeights()
public void setTargetRenderProps(RenderProps rend)
public RenderProps getSourceRenderProps()
public void setSourceRenderProps(RenderProps rend)
public void setKd(double k)
public double getKd()
setKd(double)
.public void setKp(double k)
public double getKp()
setKp(double)
.public double getPerr()
public double getDerr()
public void setNormalizeH(boolean set)
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.set
- public boolean getNormalizeH()
H
and b
. See setNormalizeH(boolean)
H
and b