public class MotionTargetTerm extends LeastSquaresTermBase
QPTerm.Type
ModelComponent.NavpanelVisibility
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_CHASE_TIME |
static double |
DEFAULT_Kd |
static double |
DEFAULT_Kp |
static boolean |
DEFAULT_LEGACY_CONTROL |
static boolean |
DEFAULT_USE_PD_CONTROL |
static boolean |
keepVelocityJacobianConstant |
boolean |
myLegacyControl |
static PropertyList |
myProps |
DEFAULT_ENABLED, DEFAULT_WEIGHT
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
MotionTargetTerm() |
MotionTargetTerm(TrackingController controller) |
Modifier and Type | Method and Description |
---|---|
TargetFrame |
addFrameTarget(Frame source)
Adds a frame target to track with weight 1
|
TargetFrame |
addFrameTarget(Frame source,
double weight)
Adds a frame target to track
|
TargetPoint |
addPointTarget(Point source)
Adds a point target to track with weight 1
|
TargetPoint |
addPointTarget(Point source,
double weight)
Adds a point target to track
|
MotionTargetComponent |
addTarget(MotionTargetComponent target)
Deprecated.
Use
addPointTarget(Point) or
addFrameTarget(Frame) instead. |
MotionTargetComponent |
addTarget(MotionTargetComponent source,
double weight)
Deprecated.
Use
addPointTarget(Point,double) or
addFrameTarget(Frame,double) instead. |
void |
clearTargets()
Removes targets
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
VectorNd |
getB() |
double |
getChaseTime()
Queries the chase time.
|
MatrixNd |
getH() |
double |
getKd()
Returns the Derivative gain for PD controller.
|
double |
getKp()
Returns the Proportional gain for PD controller.
|
boolean |
getLegacyControl() |
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 |
setChaseTime(double t)
Sets the chase time.
|
void |
setKd(double k)
Derivative gain for PD controller
|
void |
setKp(double k)
Proportional gain for PD controller
|
void |
setLegacyControl(boolean enable) |
void |
setSourceRenderProps(RenderProps rend)
Sets render props for sources
|
void |
setTargetRenderProps(RenderProps rend)
Sets render props for the target points/frames
|
void |
setTargetsPointRadius(double rad) |
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 |
updateSourceVelocity(VectorNd vel) |
void |
updateTarget(double t0,
double t1) |
void |
updateVelocityError(VectorNd verror) |
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 static final boolean DEFAULT_LEGACY_CONTROL
public boolean myLegacyControl
public static final boolean DEFAULT_USE_PD_CONTROL
public static double DEFAULT_CHASE_TIME
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 void setTargetsPointRadius(double rad)
public PointList<TargetPoint> getTargetPoints()
public RenderableComponentList<TargetFrame> getTargetFrames()
public void updateTarget(double t0, double t1)
public double getPositionError()
public double getVelocityError()
public void updateVelocityError(VectorNd verror)
public void updateSourceVelocity(VectorNd vel)
public void initTargetRenderProps(TrackingController controller)
public void initSourceRenderProps()
public MotionTargetComponent addTarget(MotionTargetComponent source, double weight)
addPointTarget(Point,double)
or
addFrameTarget(Frame,double)
instead.public MotionTargetComponent addTarget(MotionTargetComponent target)
addPointTarget(Point)
or
addFrameTarget(Frame)
instead.public TargetPoint addPointTarget(Point source, double weight)
source
- point in the model you wish to drive to a target positionweight
- used in error trackingpublic TargetPoint addPointTarget(Point source)
source
- point in the model you wish to drive to a target
positionpublic TargetFrame addFrameTarget(Frame source, double weight)
source
- frame in the model you wish to drive to a target positionweight
- used in error trackingpublic TargetFrame addFrameTarget(Frame source)
source
- frame in 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 setChaseTime(double t)
>=
the
simulation step size.t
- new chase timepublic double getChaseTime()
setChaseTime(double)
for details.public void setKp(double k)
public double getKp()
setKp(double)
.public void setKd(double k)
public double getKd()
setKd(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()
public void setLegacyControl(boolean enable)
public boolean getLegacyControl()