public class TrajectoryEnvelope extends MultiVariable implements Activity
TrajectoryEnvelope is a MultiVariable composed of an AllenInterval (temporal part)
and two GeometricShapeVariables. One GeometricShapeVariable represents the reference path, the other
represents the spatial envelope. Constraints of type AllenIntervalConstraint and
DE9IMRelation can be added to TrajectoryEnvelopes.| Modifier and Type | Field and Description |
|---|---|
static long |
RESOLUTION |
backupForSerialization, constraints, internalSolvers, variablesattributes, dependentVariables, id, logger, solver| Constructor and Description |
|---|
TrajectoryEnvelope(ConstraintSolver cs,
int id,
ConstraintSolver[] internalSolvers,
Variable[] internalVars) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubEnvelope(TrajectoryEnvelope se)
Add a sub-envelope to this
TrajectoryEnvelope. |
int |
compareTo(Variable o) |
static com.vividsolutions.jts.geom.Polygon |
createFootprintPolygon(com.vividsolutions.jts.geom.Coordinate... coords) |
protected Constraint[] |
createInternalConstraints(Variable[] variables)
This method must be implemented to define the internal lower-level
Constraints of this
MultiVariable. |
static void |
drawTrajectoryEnvelopeHierarchy(edu.uci.ics.jung.graph.DelegateTree<TrajectoryEnvelope,java.lang.String> tree)
Draw a hierarchy of
TrajectoryEnvelopes. |
TrajectoryEnvelope |
getClosestGroundEnvelope(long time)
Get the ground
TrajectoryEnvelope in which the robot will be
at a given time. |
double[] |
getCTs()
Get the start and end times of the path points representing beginning and ending of
ground
TrajectoryEnvelopes of this TrajectoryEnvelope. |
edu.uci.ics.jung.graph.DelegateTree<TrajectoryEnvelope,java.lang.String> |
getEnvelopeHierarchy() |
GeometricShapeVariable |
getEnvelopeVariable()
Returns the spatial part of this
TrajectoryEnvelope (spatial envelope). |
com.vividsolutions.jts.geom.Polygon |
getFootprint()
Get a
Polygon representing the footprint of this TrajectoryEnvelope. |
static com.vividsolutions.jts.geom.Geometry |
getFootprint(com.vividsolutions.jts.geom.Polygon fp,
double x,
double y,
double theta)
Returns a
Geometry representing the footprint of a robot in a given pose. |
TrajectoryEnvelope |
getGroundEnvelope(int seqNum)
Get the ground
TrajectoryEnvelope in which the robot will be a the given sequence number along
the trajectory. |
TrajectoryEnvelope |
getGroundEnvelope(long time)
Get the ground
TrajectoryEnvelope in which the robot will be
at a given time. |
java.util.TreeSet<TrajectoryEnvelope> |
getGroundEnvelopes()
Get the ground
TrajectoryEnvelopes of this TrajectoryEnvelope, ordered
by increasing start time. |
java.lang.String |
getInfo()
Get a summary of this
TrajectoryEnvelope. |
com.vividsolutions.jts.geom.Polygon |
getInnerFootprint()
Get a
Polygon representing the inner footprint of this TrajectoryEnvelope. |
GeometricShapeVariable |
getInternalEnvelopeVariable()
Returns the spatial part of this
TrajectoryEnvelope (internal spatial envelope). |
double |
getPartialTimeLeftEstimate(int seqNum)
Get an estimate of the time left to move on the reference
Trajectory of this TrajectoryEnvelope
given the current path index. |
int |
getPathLength()
Get the length of the
Trajectory underlying this TrajectoryEnvelope. |
PoseSteering |
getPoseSteering(long time)
Get the
PoseSteering along the Trajectory where the robot will be
at a given time. |
GeometricShapeVariable |
getReferencePathVariable()
Returns the spatial part of this
TrajectoryEnvelope (reference path or point). |
boolean |
getRefinable()
Assess whether this
TrajectoryEnvelope can be refined into sub-envelopes. |
int |
getRobotID()
Get the robot ID of this
TrajectoryEnvelope. |
int |
getSequenceNumber(com.vividsolutions.jts.geom.Coordinate coord)
Get the sequence number of the path point that is closest to a
given coordinate.
|
int |
getSequenceNumberEnd()
Get the end sequence number of this
TrajectoryEnvelope (length of trajectory -1 if this envelope has
no super envelopes). |
int |
getSequenceNumberStart()
Get the start sequence number of this
TrajectoryEnvelope (0 if this envelope has
no super envelopes). |
java.util.ArrayList<TrajectoryEnvelope> |
getSubEnvelopes()
Get the sub-envelopes of this
TrajectoryEnvelope. |
TrajectoryEnvelope |
getSuperEnvelope()
Get the super-envelope of this
TrajectoryEnvelope. |
SymbolicVariableActivity |
getSymbolicVariableActivity()
Returns the symbolic part of this
TrajectoryEnvelope. |
java.lang.String[] |
getSymbols() |
AllenInterval |
getTemporalVariable()
Returns the temporal part of this
TrajectoryEnvelope. |
double |
getTimeLeftEstimate(int seqNum)
Get an estimate of the time left to move on the reference
Trajectory of this TrajectoryEnvelope
given the current path index. |
double |
getTimeToEstimate(int seqNumNow,
int seqNumTo)
Get an estimate of the time left to move on the reference
Trajectory of this TrajectoryEnvelope
between two given path indices. |
Trajectory |
getTrajectory()
Get the
Trajectory of this TrajectoryEnvelope. |
Variable |
getVariable() |
boolean |
hasSubEnvelopes()
Assess whether this
TrajectoryEnvelope has one or more sub-envelopes. |
boolean |
hasSuperEnvelope()
Assess whether this
TrajectoryEnvelope has a super-envelope. |
com.vividsolutions.jts.geom.Geometry |
makeFootprint(double x,
double y,
double theta)
Returns a
Geometry representing the footprint of the robot in a given pose. |
com.vividsolutions.jts.geom.Geometry |
makeFootprint(PoseSteering ps)
Returns a
Geometry representing the footprint of the robot in a given PoseSteering. |
com.vividsolutions.jts.geom.Geometry |
makeInnerFootprint(double x,
double y,
double theta)
Returns a
Geometry representing the inner footprint of the robot in a given pose. |
com.vividsolutions.jts.geom.Geometry |
makeInnerFootprint(PoseSteering ps)
Returns a
Geometry representing the inner footprint of the robot in a given PoseSteering. |
void |
setDomain(Domain d)
Set the domain of this variable.
|
void |
setFootprint(com.vividsolutions.jts.geom.Coordinate... coords)
Set the footprint of this
TrajectoryEnvelope, which is used for computing the spatial envelope. |
void |
setFootprint(double w,
double l,
double dw,
double dl)
Set the footprint of this
TrajectoryEnvelope, which is used for computing the spatial envelope. |
void |
setFootprint(com.vividsolutions.jts.geom.Polygon footprint) |
void |
setInnerFootprint(com.vividsolutions.jts.geom.Coordinate... coords)
Set the Inner footprint of this
TrajectoryEnvelope, which is used for computing the spatial envelope. |
void |
setRefinable(boolean refinable)
Set whether this
TrajectoryEnvelope can be refined into sub-envelopes. |
void |
setRobotID(int robotID)
Set the robot ID of this
TrajectoryEnvelope. |
void |
setSuperEnvelope(TrajectoryEnvelope superEnvelope)
Set the super-envelope of this
TrajectoryEnvelope. |
void |
setTrajectory(Trajectory traj)
Set the
Trajectory of this TrajectoryEnvelope. |
java.lang.String |
toString()
Get a
String representation of this Variable. |
void |
updateDuration()
Imposes a temporal constraint that models the minimum duration
of this
TrajectoryEnvelope, derived from the minimum transition times
between path poses (deltaTs). |
drawVariableHierarchy, getDescription, getDomain, getInternalConstraints, getInternalConstraintSolvers, getInternalVariables, getVariableHierarchy, getVariablesFromVariableHierarchy, setComponentaddDependentVariables, dependsOn, equals, getAncestorVariable, getAttributes, getColor, getComponent, getConstraintSolver, getDependentVariables, getID, getMarking, getOwner, getParentVariable, getRecursivelyDependentVariables, getRootVariable, hashCode, isDependentVariable, removeDependentVariables, setAttributes, setColor, setDependentVariables, setMarking, setOwner, setParentVariablepublic TrajectoryEnvelope(ConstraintSolver cs, int id, ConstraintSolver[] internalSolvers, Variable[] internalVars)
public com.vividsolutions.jts.geom.Polygon getFootprint()
Polygon representing the footprint of this TrajectoryEnvelope.Polygon representing the footprint of this TrajectoryEnvelope.public com.vividsolutions.jts.geom.Polygon getInnerFootprint()
Polygon representing the inner footprint of this TrajectoryEnvelope.Polygon representing the footprint of this TrajectoryEnvelope.public edu.uci.ics.jung.graph.DelegateTree<TrajectoryEnvelope,java.lang.String> getEnvelopeHierarchy()
public static void drawTrajectoryEnvelopeHierarchy(edu.uci.ics.jung.graph.DelegateTree<TrajectoryEnvelope,java.lang.String> tree)
TrajectoryEnvelopes.tree - The hierarchy of TrajectoryEnvelopes to draw.public java.lang.String getInfo()
TrajectoryEnvelope.String summarizing this TrajectoryEnvelope.public void setFootprint(com.vividsolutions.jts.geom.Polygon footprint)
public void setFootprint(com.vividsolutions.jts.geom.Coordinate... coords)
TrajectoryEnvelope, which is used for computing the spatial envelope. Provide
the bounding box of the machine assuming its reference point is in (0,0).coords - Coordinates of the footprint.public void setInnerFootprint(com.vividsolutions.jts.geom.Coordinate... coords)
TrajectoryEnvelope, which is used for computing the spatial envelope. Provide
the bounding box of the machine assuming its reference point is in (0,0).coords - Coordinates of the footprint.public void setFootprint(double w,
double l,
double dw,
double dl)
TrajectoryEnvelope, which is used for computing the spatial envelope.w - The width of the robot's footprint (dimension along the perpendicular to the driving direction).l - The length of the robot's footprint (dimension along the driving direction).dw - Lateral displacement of the reference point of the robot (along the perpendicular to the driving direction).dl - Forward displacement of the reference point of the robot (along the driving direction).public void addSubEnvelope(TrajectoryEnvelope se)
TrajectoryEnvelope.se - A sub-envelope to add to this TrajectoryEnvelope.public boolean hasSubEnvelopes()
TrajectoryEnvelope has one or more sub-envelopes.true iff this TrajectoryEnvelope has one or more sub-envelopes.public java.util.ArrayList<TrajectoryEnvelope> getSubEnvelopes()
TrajectoryEnvelope.TrajectoryEnvelope.public double getTimeToEstimate(int seqNumNow,
int seqNumTo)
Trajectory of this TrajectoryEnvelope
between two given path indices. The estimate is based on the reference Trajectory's
temporal profile.seqNumNow - The path index from which the estimate should be computed.seqNumTo - The path index to which the estimate should be computed.Trajectory
of this TrajectoryEnvelope, given the current path index.public double getTimeLeftEstimate(int seqNum)
Trajectory of this TrajectoryEnvelope
given the current path index. The estimate is based on the reference Trajectory's
temporal profile.seqNum - The path index from which the estimate should be computed.Trajectory
of this TrajectoryEnvelope, given the current path index.public double getPartialTimeLeftEstimate(int seqNum)
Trajectory of this TrajectoryEnvelope
given the current path index. The estimate is based on the reference Trajectory's
temporal profile. This method returns the time left on the ground TrajectoryEnvelope on which
the given path index lies.seqNum - The path index from which the estimate should be computed.Trajectory
of this TrajectoryEnvelope, given the current path index.public java.util.TreeSet<TrajectoryEnvelope> getGroundEnvelopes()
TrajectoryEnvelopes of this TrajectoryEnvelope, ordered
by increasing start time.TrajectoryEnvelopes of this TrajectoryEnvelope.public TrajectoryEnvelope getGroundEnvelope(int seqNum)
TrajectoryEnvelope in which the robot will be a the given sequence number along
the trajectory.seqNum - The index of sequence number which the returned ground TrajectoryEnvelope should contain.TrajectoryEnvelope at the given index in the reference Trajectory.public TrajectoryEnvelope getGroundEnvelope(long time)
TrajectoryEnvelope in which the robot will be
at a given time. Returns null if the robot will not be in this
TrajectoryEnvelope at the given time, or if the robot is not in any ground envelope
at the given time (e.g., traveling between the end point of one ground envelope and
the starting point of the next one).time - The time at which to return the TrajectoryEnvelope.TrajectoryEnvelope in which the robot will be
at a given time.public TrajectoryEnvelope getClosestGroundEnvelope(long time)
TrajectoryEnvelope in which the robot will be
at a given time. Returns null if the robot will not be in this
TrajectoryEnvelope at the given time.time - The time at which to return the TrajectoryEnvelope.TrajectoryEnvelope in which the robot will be
at a given time, or the ground TrajectoryEnvelope it is leaving in case
the robot is traveling between the end point of one ground envelope and
the starting point of the next one.public TrajectoryEnvelope getSuperEnvelope()
TrajectoryEnvelope.TrajectoryEnvelope.public PoseSteering getPoseSteering(long time)
PoseSteering along the Trajectory where the robot will be
at a given time. Returns null if the robot will not be in this
TrajectoryEnvelope at the given time.time - The time at which to return the PoseSteering.PoseSteering along the Trajectory where the robot will be
at a given time.public double[] getCTs()
TrajectoryEnvelopes of this TrajectoryEnvelope.TrajectoryEnvelopes of this TrajectoryEnvelope.public void setRobotID(int robotID)
TrajectoryEnvelope.robotID - The robot ID of this TrajectoryEnvelope.public int getRobotID()
TrajectoryEnvelope.TrajectoryEnvelope.public void setSuperEnvelope(TrajectoryEnvelope superEnvelope)
TrajectoryEnvelope.superEnvelope - The super-envelope of this TrajectoryEnvelope.public boolean hasSuperEnvelope()
TrajectoryEnvelope has a super-envelope.true iff this TrajectoryEnvelope has a super-envelope.public void setRefinable(boolean refinable)
TrajectoryEnvelope can be refined into sub-envelopes.refinable - Whether this TrajectoryEnvelope can be refined into sub-envelopes.public boolean getRefinable()
TrajectoryEnvelope can be refined into sub-envelopes.true iff this TrajectoryEnvelope can be refined into sub-envelopes.public int compareTo(Variable o)
compareTo in interface java.lang.Comparable<Variable>protected Constraint[] createInternalConstraints(Variable[] variables)
MultiVariableConstraints of this
MultiVariable.createInternalConstraints in class MultiVariablevariables - The internal variables among which the Constraints should be defined.Constraints of this
MultiVariable.public com.vividsolutions.jts.geom.Geometry makeFootprint(PoseSteering ps)
Geometry representing the footprint of the robot in a given PoseSteering.ps - The pose and steering used to create the footprint.Geometry representing the footprint of the robot in a given PoseSteering.public com.vividsolutions.jts.geom.Geometry makeInnerFootprint(PoseSteering ps)
Geometry representing the inner footprint of the robot in a given PoseSteering.ps - The pose and steering used to create the inner footprint.Geometry representing the inner footprint of the robot in a given PoseSteering.public static com.vividsolutions.jts.geom.Geometry getFootprint(com.vividsolutions.jts.geom.Polygon fp,
double x,
double y,
double theta)
Geometry representing the footprint of a robot in a given pose.fp - A polygon representing the footprint of the robot centered in (0,0)
and appropriately oriented (can be obtained from a TrajectoryEnvelope instance
via method getFootprint()).x - The x coordinate of the pose used to create the footprint.y - The y coordinate of the pose used to create the footprint.theta - The orientation of the pose used to create the footprint.Geometry representing the footprint of the robot in a given pose.public com.vividsolutions.jts.geom.Geometry makeFootprint(double x,
double y,
double theta)
Geometry representing the footprint of the robot in a given pose.x - The x coordinate of the pose used to create the footprint.y - The y coordinate of the pose used to create the footprint.theta - The orientation of the pose used to create the footprint.Geometry representing the footprint of the robot in a given pose.public com.vividsolutions.jts.geom.Geometry makeInnerFootprint(double x,
double y,
double theta)
Geometry representing the inner footprint of the robot in a given pose.x - The x coordinate of the pose used to create the inner footprint.y - The y coordinate of the pose used to create the inner footprint.theta - The orientation of the pose used to create the inner footprint.Geometry representing the footprint of the inner robot in a given pose.public static com.vividsolutions.jts.geom.Polygon createFootprintPolygon(com.vividsolutions.jts.geom.Coordinate... coords)
public void setTrajectory(Trajectory traj)
Trajectory of this TrajectoryEnvelope.traj - The Trajectory of this TrajectoryEnvelope.public void updateDuration()
TrajectoryEnvelope, derived from the minimum transition times
between path poses (deltaTs).public int getSequenceNumberStart()
TrajectoryEnvelope (0 if this envelope has
no super envelopes).TrajectoryEnvelope (0 if this envelope has
no super envelopes).public int getSequenceNumberEnd()
TrajectoryEnvelope (length of trajectory -1 if this envelope has
no super envelopes).TrajectoryEnvelope (length of trajectory -1 if this envelope has
no super envelopes).public Trajectory getTrajectory()
Trajectory of this TrajectoryEnvelope.Trajectory of this TrajectoryEnvelope.public int getPathLength()
Trajectory underlying this TrajectoryEnvelope.Trajectory underlying this TrajectoryEnvelope.public void setDomain(Domain d)
Variablepublic java.lang.String toString()
VariableString representation of this Variable.public AllenInterval getTemporalVariable()
TrajectoryEnvelope.getTemporalVariable in interface ActivityAllenInterval representing the temporal part of this TrajectoryEnvelope.public GeometricShapeVariable getReferencePathVariable()
TrajectoryEnvelope (reference path or point). Returns a
GeometricShapeVariable whose domain is either a LineStringDomain or a PointDomain.GeometricShapeVariable representing the spatial part of this TrajectoryEnvelope.public GeometricShapeVariable getEnvelopeVariable()
TrajectoryEnvelope (spatial envelope).GeometricShapeVariable representing the spatial part of this TrajectoryEnvelope.public GeometricShapeVariable getInternalEnvelopeVariable()
TrajectoryEnvelope (internal spatial envelope).GeometricShapeVariable representing the internal spatial part of this TrajectoryEnvelope.public SymbolicVariableActivity getSymbolicVariableActivity()
TrajectoryEnvelope.TrajectoryEnvelope.public java.lang.String[] getSymbols()
getSymbols in interface ActivityActivity's symbolic variable.public Variable getVariable()
getVariable in interface Activitypublic int getSequenceNumber(com.vividsolutions.jts.geom.Coordinate coord)
coord - The coordinate to which the closest sequence number should be found.