|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmsim.trajectory.TrajectoryActor
msim.trajectory.TrajectoryDriver
msim.ui.InteractorDriver
@ThreadSafe public class InteractorDriver
Drives a Joint sub-transform trajectory from an InteractorDriver.JointInteractor.
Copyright (C) 2008 Marsette A. Vona, III
| Nested Class Summary | |
|---|---|
protected class |
InteractorDriver.JointInteractor
Special RXSInteractor for manipulating Joint
sub-transforms. |
| Field Summary | |
|---|---|
private static java.lang.String |
cvsid
|
static double |
DEF_MIN_UPDATE_TIME
default value for getMinUpdateTime() in TrajectoryActor.clock time |
protected boolean |
driveFullGoal
whether to not onlySetChangedGoalComponents() |
InteractorDriver.JointInteractor |
jointInteractor
the interactor |
vona.math.RXSInterpolator |
jointInterpolator
the interpolator |
protected vona.math.RX |
manipulationToGroundRX
An arbitrary rigid transform taking RXSInteractor manipulation
frame coordinates to Linkage ground frame. |
protected vona.math.RX |
restoreRX
the original Joint sub-transform state at activate() |
protected vona.math.RX |
subFrameCMT
Temp storage for transform taking the parent frame of the manipulated Joint sub-transform to world frame. |
| Fields inherited from class msim.trajectory.TrajectoryDriver |
|---|
lastUpdateTime |
| Fields inherited from class msim.trajectory.TrajectoryActor |
|---|
active, clock, joint, slackID, xform, xformID |
| Constructor Summary | |
|---|---|
InteractorDriver()
Makes a new interactor driver using a default Clock (wall-clock
time). |
|
InteractorDriver(vona.time.Clock clock)
makes a new interactor driver |
|
| Method Summary | |
|---|---|
void |
activate()
extends superclass impl to updateInteractor() and enable it |
int |
bind(java.lang.Object... specs)
Fill the set of transforms which this TrajectoryActor reads/writes, in order. |
protected void |
checkBindings()
Check that the Joint of each binding is still present. |
protected boolean |
compareXFormsInNeedsUpdate()
Whether to TrajectoryActor.compareXFormsToModel() in TrajectoryDriver.needsUpdate(). |
void |
deactivate()
extends superclass impl to disable jointInteractor |
vona.ui.RXSInteractor |
getInteractor()
get jointInteractor |
vona.math.RXSInterpolator |
getInterpolator()
get jointInterpolator |
double |
getMinUpdateTime()
Get the minimum time in TrajectoryActor.clock time between calls to TrajectoryDriver.needsUpdate() which return true. |
protected vona.math.RX |
getOriginalUnsetGoal(int i)
Get the original goal transform to use for comparison purposes in TrajectoryActor.writeXFormsToModel(). |
void |
modelStructureChanged()
Called by the update thread when this TrajectoryActor is active after the model structure changes. |
protected boolean |
onlySetChangedGoalComponents()
Whether to only set changed goal transform components in TrajectoryActor.writeXFormsToModel(). |
boolean |
restore()
restore(boolean) without jumping |
boolean |
restore(boolean jump)
Restore the Joint sub-transform to its original state at activate(). |
void |
setDriveFullGoal(boolean driveFullGoal)
set driveFullGoal |
void |
setManipulationToGround(vona.math.RX rx,
boolean invert)
Set the manipulationToGroundRX transform by copy. |
void |
unbind()
extends superclass impl to updateInteractor() after unbinding |
protected void |
updateInteractor()
InteractorDriver.JointInteractor.bind(msim.model.Joint, int) or InteractorDriver.JointInteractor.unbind() jointInteractor, as appropriate. |
void |
updateManipulationFrameRX()
Update jointInteractor's "manipulation"-to-"world"
transform. |
protected void |
updateXForms()
Update the TrajectoryActor.xform values from their driving source. |
| Methods inherited from class msim.trajectory.TrajectoryDriver |
|---|
needsUpdate, update, updateXFormsInNeedsUpdate |
| Methods inherited from class msim.trajectory.TrajectoryActor |
|---|
clampXForms, compareXFormsToModel, getBoundJoint, getBoundXForm, getConstrainedInterpolationType, getDefaultXForm, getNumBindings, getUnconstrainedInterpolationType, isActive, modelStateChanged, readXFormsFromModel, writeXFormsToModel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String cvsid
public static final double DEF_MIN_UPDATE_TIME
getMinUpdateTime() in TrajectoryActor.clock time
public final InteractorDriver.JointInteractor jointInteractor
public final vona.math.RXSInterpolator jointInterpolator
protected boolean driveFullGoal
onlySetChangedGoalComponents()
protected final vona.math.RX restoreRX
Joint sub-transform state at activate()
protected final vona.math.RX manipulationToGroundRX
An arbitrary rigid transform taking RXSInteractor manipulation
frame coordinates to Linkage ground frame.
This is one component of the manipulation frame to RXSInteractor world frame transform, see updateManipulationFrameRX() for details.
Display uses an InteractorDriver to implement joint
manipulation, and tracks manipulationToGroundRX to the rigid part of the
navigation view-to-world transform. It also tracks the RXSInteractor world-to-canvas scale to the product of the Display
world-to-view and view-to-canvas scales.
protected final vona.math.RX subFrameCMT
Temp storage for transform taking the parent frame of the
manipulated Joint sub-transform to world frame.
Used in updateManipulationFrameRX().
| Constructor Detail |
|---|
public InteractorDriver(vona.time.Clock clock)
public InteractorDriver()
Makes a new interactor driver using a default Clock (wall-clock
time).
| Method Detail |
|---|
public int bind(java.lang.Object... specs)
Fill the set of transforms which this TrajectoryActor reads/writes, in order.
This impl extends the superclass impl to ensure that at most one transform is bound.
bind in class TrajectoryActorspecs - a set of Joint sub-transform specifiers, in order,
each of the the form (joint, name, or path, sub-transform
ID...). If no sub-transform IDs are given then TrajectoryActor.getDefaultXForm() is implied. If more than one sub-transform ID is given
then more than one binding is specified.
public void unbind()
updateInteractor() after unbinding
unbind in class TrajectoryActorpublic void activate()
updateInteractor() and enable it
activate in class TrajectoryDriverpublic void deactivate()
jointInteractor
deactivate in class TrajectoryDriverpublic void modelStructureChanged()
Called by the update thread when this TrajectoryActor is active after the model structure changes.
Default impl calls TrajectoryActor.checkBindings().
This impl chains to the superclass impl and then does updateInteractor().
modelStructureChanged in class TrajectoryActorpublic boolean restore(boolean jump)
Restore the Joint sub-transform to its original state at activate().
public boolean restore()
restore(boolean) without jumping
protected void checkBindings()
Check that the Joint of each binding is still present.
Extends superclass impl with additional checks.
checkBindings in class TrajectoryActorjava.lang.IllegalStateException - if manipulating mobility and either goal
becomes set
java.lang.IllegalStateException - if manipulating mobility and joint
becomes a closure
java.lang.IllegalStateException - if manipulating posture and target
becomes setprotected void updateXForms()
Update the TrajectoryActor.xform values from their driving source.
This impl reads the current transform from jointInteractor.
updateXForms in class TrajectoryDriverprotected boolean compareXFormsInNeedsUpdate()
Whether to TrajectoryActor.compareXFormsToModel() in TrajectoryDriver.needsUpdate().
Default impl returns true.
This impl returns false.
compareXFormsInNeedsUpdate in class TrajectoryDriverprotected void updateInteractor()
InteractorDriver.JointInteractor.bind(msim.model.Joint, int) or InteractorDriver.JointInteractor.unbind() jointInteractor, as appropriate.
We also re-read TrajectoryActor.xform (and restoreRX if the joint
or transform id changed) from the bound sub-transform, and we jump the
interactor to this initial state.
public double getMinUpdateTime()
Get the minimum time in TrajectoryActor.clock time between calls to TrajectoryDriver.needsUpdate() which return true.
Default impl returns 0.
This impl returns DEF_MIN_UPDATE_TIME.
getMinUpdateTime in class TrajectoryDriverpublic vona.ui.RXSInteractor getInteractor()
jointInteractor
public vona.math.RXSInterpolator getInterpolator()
jointInterpolator
public void setManipulationToGround(vona.math.RX rx,
boolean invert)
Set the manipulationToGroundRX transform by copy.
invert - whether to invert manipulationToGroundRX after
setting itpublic void updateManipulationFrameRX()
Update jointInteractor's "manipulation"-to-"world"
transform.
The interactor's manipulation frame is actually the Display view frame, and the interactor's "world" frame is the
parent frame of the manipulated transform, which will in general be a
sub-frame of the manipulated joint. The full transform chain in order
is
manipulationToGroundRX by DisplayJoint.getSubFrameRX(int, RX))This is called automatically for all active InteractorDrivers whose interactor is currently controlling in manipulation frame by the update thread.
public void setDriveFullGoal(boolean driveFullGoal)
driveFullGoal
protected boolean onlySetChangedGoalComponents()
Whether to only set changed goal transform components in TrajectoryActor.writeXFormsToModel().
Also see TrajectoryActor.getOriginalUnsetGoal(int).
Default impl returns false.
This impl returns the opposite of driveFullGoal.
onlySetChangedGoalComponents in class TrajectoryActorprotected vona.math.RX getOriginalUnsetGoal(int i)
Get the original goal transform to use for comparison purposes in
TrajectoryActor.writeXFormsToModel().
This is used to implement TrajectoryActor.onlySetChangedGoalComponents().
Return null to use the current value of the goal transform of TrajectoryActor.joint i.
Default impl returns null.
This impl returns restoreRX.
getOriginalUnsetGoal in class TrajectoryActor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||