public class MotionTargetTerm extends LeastSquaresTermBase
QPTerm.Type
ModelComponent.NavpanelVisibility
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_Kd |
static double |
DEFAULT_Kp |
static boolean |
DEFAULT_USE_PD_CONTROL |
static boolean |
keepVelocityJacobianConstant |
static PropertyList |
myProps |
boolean |
useNewPDControl |
DEFAULT_ENABLED, DEFAULT_WEIGHT
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
MotionTargetTerm() |
MotionTargetTerm(TrackingController controller) |
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
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
VectorNd |
getB() |
MatrixNd |
getH() |
double |
getKd()
Returns the Derivative gain for PD controller.
|
double |
getKp()
Returns the Proportional gain for PD controller.
|
double |
getPositionError() |
void |
getQP(MatrixNd Q,
VectorNd p,
double t0,
double t1)
Adds the contribution of this term to the quadratic cost
components Q and p.
|
Frame |
getSourceFrame(int idx) |
Point |
getSourcePoint(int idx) |
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
|
RenderableComponentList<TargetFrame> |
getTargetFrames() |
PointList<TargetPoint> |
getTargetPoints() |
RenderProps |
getTargetRenderProps()
Render props for targets
|
java.util.ArrayList<MotionTargetComponent> |
getTargets()
Returns list of target points/frames
|
VectorNd |
getTargetVel(double t0,
double t1) |
void |
getTargetWeights(VectorNd weights)
Gets weights for targets.
|
int |
getTerm(MatrixNd A,
VectorNd b,
int rowoff,
double t0,
double t1)
Fills
H and b with this motion term |
boolean |
getUsePDControl() |
double |
getVelocityError() |
void |
initSourceRenderProps() |
void |
initTargetRenderProps(TrackingController controller) |
int |
numConstraints(int qpsize)
Returns the number of constraints associated with this term.
|
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 |
setKd(double k)
Derivative gain for PD controller
|
void |
setKp(double k)
Proportional gain for PD controller
|
void |
setSourceRenderProps(RenderProps rend)
Sets render props for sources
|
void |
setTargetRenderProps(RenderProps rend)
Sets render props for the target points/frames
|
void |
setTargetWeights(VectorNd weights)
Sets weights for targets.
|
void |
setUsePDControl(boolean usePD) |
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 |
updateTarget(double t0,
double t1) |
void |
updateVelocityError() |
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, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, 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
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
isWritable, write
public static boolean keepVelocityJacobianConstant
public boolean useNewPDControl
public static final boolean DEFAULT_USE_PD_CONTROL
public static double DEFAULT_Kd
public static double DEFAULT_Kp
public static PropertyList myProps
public MotionTargetTerm()
public MotionTargetTerm(TrackingController controller)
public PropertyList getAllPropertyInfo()
QPTermBase
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class QPTermBase
public PointList<TargetPoint> getTargetPoints()
public RenderableComponentList<TargetFrame> getTargetFrames()
public void updateTarget(double t0, double t1)
public double getPositionError()
public double getVelocityError()
public void updateVelocityError()
public void initTargetRenderProps(TrackingController controller)
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 Point getSourcePoint(int idx)
public Frame getSourceFrame(int idx)
public VectorNd getTargetVel(double t0, double t1)
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 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
w
- weight for the termpublic void setTargetWeights(VectorNd weights)
H
(allows you to scale x,y,z components of
velocity separately).weights
- weights vectorpublic void getTargetWeights(VectorNd weights)
weights
- weights vectorpublic RenderProps getTargetRenderProps()
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 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 setUsePDControl(boolean usePD)
public boolean getUsePDControl()