Trackers¶
coordination_oru.abstract_trajectory_envelope_tracker
¶
AbstractTrajectoryEnvelopeTracker: base class for per-robot trackers.
Ported from Java's AbstractTrajectoryEnvelopeTracker. The Java monitor
thread additionally manages ground-envelope (sub-envelope) dispatch and STP
deadlines for chained real-robot missions; this port targets flat,
single-envelope missions (as the rest of this codebase does), so that
bookkeeping is dropped — the causally-relevant behaviour (wait for tracking
to be enabled, fire lifecycle callbacks, detect path completion, fire
onTrackingFinished) is preserved. Java's Thread becomes an
asyncio.Task; synchronized sections that never straddle an await
don't need a lock (asyncio is cooperative), so only genuinely shared,
cross-task mutable state (communicatedCPs et al. on the coordinator)
uses asyncio.Lock.
RobotReport
¶
robotID = robotID
instance-attribute
¶
pose = pose
instance-attribute
¶
pathIndex = pathIndex
instance-attribute
¶
velocity = velocity
instance-attribute
¶
distanceTraveled = distanceTraveled
instance-attribute
¶
criticalPoint = criticalPoint
instance-attribute
¶
getRobotID()
¶
getPose()
¶
getPathIndex()
¶
getVelocity()
¶
getDistanceTraveled()
¶
getCriticalPoint()
¶
TrackingCallback
¶
AbstractTrajectoryEnvelopeCoordinator
¶
Bases: ABC
CONTROL_PERIOD = CONTROL_PERIOD
instance-attribute
¶
TEMPORAL_RESOLUTION = TEMPORAL_RESOLUTION
instance-attribute
¶
DEFAULT_ROBOT_TRACKING_PERIOD = DEFAULT_ROBOT_TRACKING_PERIOD
instance-attribute
¶
overlay = False
instance-attribute
¶
quiet = False
instance-attribute
¶
totalMsgsSent = 0
instance-attribute
¶
totalMsgsReTx = 0
instance-attribute
¶
criticalSectionCounter = 0
instance-attribute
¶
solver = None
instance-attribute
¶
missionsPool = []
instance-attribute
¶
envelopesToTrack = []
instance-attribute
¶
currentParkingEnvelopes = []
instance-attribute
¶
allCriticalSections = set()
instance-attribute
¶
CSToDepsOrder = {}
instance-attribute
¶
depsToCS = {}
instance-attribute
¶
escapingCSToWaitingRobotIDandCP = {}
instance-attribute
¶
stoppingPoints = {}
instance-attribute
¶
stoppingTimes = {}
instance-attribute
¶
stoppingPointTimers = {}
instance-attribute
¶
trackers = {}
instance-attribute
¶
currentDependencies = {}
instance-attribute
¶
communicatedCPs = {}
instance-attribute
¶
externalCPCounters = {}
instance-attribute
¶
comparators = []
instance-attribute
¶
forwardModels = {}
instance-attribute
¶
footprints = {}
instance-attribute
¶
maxFootprintDimensions = {}
instance-attribute
¶
robotTrackingPeriodInMillis = {}
instance-attribute
¶
robotMaxVelocity = {}
instance-attribute
¶
robotMaxAcceleration = {}
instance-attribute
¶
muted = set()
instance-attribute
¶
yieldIfParking = True
instance-attribute
¶
checkEscapePoses = True
instance-attribute
¶
trackingCallbacks = {}
instance-attribute
¶
inferenceCallback = None
instance-attribute
¶
motionPlanners = {}
instance-attribute
¶
packetLossProbability = network_configuration.PROBABILITY_OF_PACKET_LOSS
instance-attribute
¶
MAX_TX_DELAY = network_configuration.getMaximumTxDelay()
instance-attribute
¶
maxFaultsProbability = network_configuration.PROBABILITY_OF_PACKET_LOSS
instance-attribute
¶
numberOfReplicas = 1
instance-attribute
¶
isDriving = {}
instance-attribute
¶
getMaxFootprintDimension(robotID)
¶
getFootprint(robotID)
¶
getFootprintPolygon(robotID)
¶
setFootprint(robotID, *coordinates)
¶
computeMaxFootprintDimension(coords)
¶
setForwardModel(robotID, fm)
¶
getForwardModel(robotID)
¶
setRobotTrackingPeriodInMillis(robotID, trackingPeriodInMillis)
¶
getRobotTrackingPeriodInMillis(robotID)
¶
setRobotMaxVelocity(robotID, maxVelocity)
¶
setRobotMaxAcceleration(robotID, maxAcceleration)
¶
getRobotMaxVelocity(robotID)
¶
getRobotMaxAcceleration(robotID)
¶
setNetworkParameters(packetLossProbability, max_tx_delay, maxFaultsProbability)
¶
setInferenceCallback(cb)
¶
getControlPeriod()
¶
getTemporalResolution()
¶
setYieldIfParking(value)
¶
setCheckEscapePoses(value)
¶
toggleMute(robotID)
¶
mute(robotID)
¶
unMute(robotID)
¶
getMuted()
¶
getCurrentTimeInMillis()
abstractmethod
¶
setupSolver(max_envelopes=64)
¶
startInference()
async
¶
stopInference()
async
¶
isStartedInference()
¶
onNewMissionDispatched(robotID)
¶
onCriticalSectionUpdate()
¶
getDrivingEnvelopes()
¶
isParked(robotID)
¶
isDrivingRobot(robotID)
¶
getIdleRobots()
¶
getAllRobotIDs()
¶
getRobotReport(robotID)
¶
getCurrentDependencies()
¶
getCurrentSuperEnvelope(robotID)
¶
getCurrentTrajectoryEnvelope(robotID)
¶
addTrackingCallback(robotID, cb)
¶
setVisualization(viz)
¶
addComparator(c)
¶
setMotionPlanner(robotID, mp)
¶
getMotionPlanner(robotID)
¶
inParkingPose(robotID)
¶
setCriticalPoint(robotID, criticalPoint, retransmitt)
¶
placeRobot(robotID, currentPose=None, parking=None, location=None)
¶
isFree(robotID)
¶
atStoppingPoint(robotID)
¶
spawnWaitingThread(robotID, index, duration)
¶
getObstaclesInCriticalPoints(robotIDs)
¶
getObstaclesFromWaitingRobots(robotID)
¶
makeObstacles(robotID, *obstaclePoses)
¶
doReplanning(mp, fromPose, toPose, obstaclesToConsider=())
¶
updateDependencies()
abstractmethod
¶
canExitCriticalSection(drivingCurrentIndex, waitingCurrentIndex, drivingTE, waitingTE, lastIndexOfCSDriving)
¶
getCriticalPoint(yieldingRobotID, cs, leadingRobotCurrentPathIndex)
¶
isAhead(cs, rr1, rr2)
¶
computeCriticalSections()
¶
filterCriticalSections()
¶
getCriticalSections(te1, minStart1, te2, minStart2, checkEscapePoses, maxDimensionOfSmallestRobot)
staticmethod
¶
cleanUpRobotCS(robotID, lastWaitingPoint)
¶
startTrackingAddedMissions()
¶
addMissions(*missions)
¶
getNewTracker(te, cb)
abstractmethod
¶
TrajectoryEnvelope
dataclass
¶
A robot's planned trajectory expressed as an STP-aware swept envelope.
envelope_id is assigned by the
:class:~coordination_oru.metacsp.spatial.trajectory_envelope_solver.TrajectoryEnvelopeSolver
that creates it; start_node / end_node are the STP variable indices
for this envelope's start and end times.
envelope_id
instance-attribute
¶
robot_id
instance-attribute
¶
path
instance-attribute
¶
start_node
instance-attribute
¶
end_node
instance-attribute
¶
spatial_envelope
instance-attribute
¶
footprint
instance-attribute
¶
component = 'Driving'
class-attribute
instance-attribute
¶
nominal_duration = 0.0
class-attribute
instance-attribute
¶
completed = False
class-attribute
instance-attribute
¶
metadata = field(default_factory=dict)
class-attribute
instance-attribute
¶
length
property
¶
pose_at(index)
¶
waypoint_footprint(index)
¶
getID()
¶
getRobotID()
¶
getPathLength()
¶
getSpatialEnvelope()
¶
getFootprint()
¶
getTrajectory()
¶
makeFootprint(ps)
¶
getComponent()
¶
getSequenceNumberStart()
¶
getSequenceNumberEnd()
¶
getSequenceNumber(x, y)
¶
Index of the path point closest to (x, y).
Mirrors Java's getSequenceNumber(Coordinate) used to locate
stopping points along the path.
AbstractTrajectoryEnvelopeTracker
¶
Bases: ABC
te = te
instance-attribute
¶
traj = te.getTrajectory()
instance-attribute
¶
temporalResolution = temporalResolution
instance-attribute
¶
externalCPCounter = -1
instance-attribute
¶
reportCounter = -1
instance-attribute
¶
criticalPoint = -1
instance-attribute
¶
trackingPeriodInMillis = trackingPeriodInMillis
instance-attribute
¶
cb = cb
instance-attribute
¶
tec = tec
instance-attribute
¶
startingTimeInMillis = tec.getCurrentTimeInMillis()
instance-attribute
¶
getTrackingPeriod()
¶
getStartingTimeInMillis()
¶
resetStartingTimeInMillis()
¶
onTrajectoryEnvelopeUpdate()
abstractmethod
¶
updateTrajectoryEnvelope(te)
¶
setCanStartTracking()
¶
canStartTracking()
¶
waitUntilCanStartTracking()
async
¶
setCriticalPoint(criticalPoint)
abstractmethod
¶
setCriticalPointWithCounter(criticalPointToSet, externalCPCounter)
¶
setReportCounter(reportCounter)
¶
getReportCounter()
¶
getCriticalPoint()
¶
getTrackingPeriodInMillis()
¶
getLastRobotReport()
¶
getRobotReport()
abstractmethod
¶
onPositionUpdate()
¶
getCurrentTimeInMillis()
abstractmethod
¶
startTracking()
abstractmethod
¶
trackingStarted()
¶
getTrajectoryEnvelope()
¶
finishTracking()
¶
cancel()
¶
coordination_oru.trajectory_envelope_tracker_dummy
¶
TrajectoryEnvelopeTrackerDummy: represents a robot parked in a pose.
AbstractTrajectoryEnvelopeTracker
¶
Bases: ABC
te = te
instance-attribute
¶
traj = te.getTrajectory()
instance-attribute
¶
temporalResolution = temporalResolution
instance-attribute
¶
externalCPCounter = -1
instance-attribute
¶
reportCounter = -1
instance-attribute
¶
criticalPoint = -1
instance-attribute
¶
trackingPeriodInMillis = trackingPeriodInMillis
instance-attribute
¶
cb = cb
instance-attribute
¶
tec = tec
instance-attribute
¶
startingTimeInMillis = tec.getCurrentTimeInMillis()
instance-attribute
¶
getTrackingPeriod()
¶
getStartingTimeInMillis()
¶
resetStartingTimeInMillis()
¶
onTrajectoryEnvelopeUpdate()
abstractmethod
¶
updateTrajectoryEnvelope(te)
¶
setCanStartTracking()
¶
canStartTracking()
¶
waitUntilCanStartTracking()
async
¶
setCriticalPoint(criticalPoint)
abstractmethod
¶
setCriticalPointWithCounter(criticalPointToSet, externalCPCounter)
¶
setReportCounter(reportCounter)
¶
getReportCounter()
¶
getCriticalPoint()
¶
getTrackingPeriodInMillis()
¶
getLastRobotReport()
¶
getRobotReport()
abstractmethod
¶
onPositionUpdate()
¶
getCurrentTimeInMillis()
abstractmethod
¶
startTracking()
abstractmethod
¶
trackingStarted()
¶
getTrajectoryEnvelope()
¶
finishTracking()
¶
cancel()
¶
RobotReport
¶
robotID = robotID
instance-attribute
¶
pose = pose
instance-attribute
¶
pathIndex = pathIndex
instance-attribute
¶
velocity = velocity
instance-attribute
¶
distanceTraveled = distanceTraveled
instance-attribute
¶
criticalPoint = criticalPoint
instance-attribute
¶
getRobotID()
¶
getPose()
¶
getPathIndex()
¶
getVelocity()
¶
getDistanceTraveled()
¶
getCriticalPoint()
¶
TrackingCallback
¶
AbstractTrajectoryEnvelopeCoordinator
¶
Bases: ABC
CONTROL_PERIOD = CONTROL_PERIOD
instance-attribute
¶
TEMPORAL_RESOLUTION = TEMPORAL_RESOLUTION
instance-attribute
¶
DEFAULT_ROBOT_TRACKING_PERIOD = DEFAULT_ROBOT_TRACKING_PERIOD
instance-attribute
¶
overlay = False
instance-attribute
¶
quiet = False
instance-attribute
¶
totalMsgsSent = 0
instance-attribute
¶
totalMsgsReTx = 0
instance-attribute
¶
criticalSectionCounter = 0
instance-attribute
¶
solver = None
instance-attribute
¶
missionsPool = []
instance-attribute
¶
envelopesToTrack = []
instance-attribute
¶
currentParkingEnvelopes = []
instance-attribute
¶
allCriticalSections = set()
instance-attribute
¶
CSToDepsOrder = {}
instance-attribute
¶
depsToCS = {}
instance-attribute
¶
escapingCSToWaitingRobotIDandCP = {}
instance-attribute
¶
stoppingPoints = {}
instance-attribute
¶
stoppingTimes = {}
instance-attribute
¶
stoppingPointTimers = {}
instance-attribute
¶
trackers = {}
instance-attribute
¶
currentDependencies = {}
instance-attribute
¶
communicatedCPs = {}
instance-attribute
¶
externalCPCounters = {}
instance-attribute
¶
comparators = []
instance-attribute
¶
forwardModels = {}
instance-attribute
¶
footprints = {}
instance-attribute
¶
maxFootprintDimensions = {}
instance-attribute
¶
robotTrackingPeriodInMillis = {}
instance-attribute
¶
robotMaxVelocity = {}
instance-attribute
¶
robotMaxAcceleration = {}
instance-attribute
¶
muted = set()
instance-attribute
¶
yieldIfParking = True
instance-attribute
¶
checkEscapePoses = True
instance-attribute
¶
trackingCallbacks = {}
instance-attribute
¶
inferenceCallback = None
instance-attribute
¶
motionPlanners = {}
instance-attribute
¶
packetLossProbability = network_configuration.PROBABILITY_OF_PACKET_LOSS
instance-attribute
¶
MAX_TX_DELAY = network_configuration.getMaximumTxDelay()
instance-attribute
¶
maxFaultsProbability = network_configuration.PROBABILITY_OF_PACKET_LOSS
instance-attribute
¶
numberOfReplicas = 1
instance-attribute
¶
isDriving = {}
instance-attribute
¶
getMaxFootprintDimension(robotID)
¶
getFootprint(robotID)
¶
getFootprintPolygon(robotID)
¶
setFootprint(robotID, *coordinates)
¶
computeMaxFootprintDimension(coords)
¶
setForwardModel(robotID, fm)
¶
getForwardModel(robotID)
¶
setRobotTrackingPeriodInMillis(robotID, trackingPeriodInMillis)
¶
getRobotTrackingPeriodInMillis(robotID)
¶
setRobotMaxVelocity(robotID, maxVelocity)
¶
setRobotMaxAcceleration(robotID, maxAcceleration)
¶
getRobotMaxVelocity(robotID)
¶
getRobotMaxAcceleration(robotID)
¶
setNetworkParameters(packetLossProbability, max_tx_delay, maxFaultsProbability)
¶
setInferenceCallback(cb)
¶
getControlPeriod()
¶
getTemporalResolution()
¶
setYieldIfParking(value)
¶
setCheckEscapePoses(value)
¶
toggleMute(robotID)
¶
mute(robotID)
¶
unMute(robotID)
¶
getMuted()
¶
getCurrentTimeInMillis()
abstractmethod
¶
setupSolver(max_envelopes=64)
¶
startInference()
async
¶
stopInference()
async
¶
isStartedInference()
¶
onNewMissionDispatched(robotID)
¶
onCriticalSectionUpdate()
¶
getDrivingEnvelopes()
¶
isParked(robotID)
¶
isDrivingRobot(robotID)
¶
getIdleRobots()
¶
getAllRobotIDs()
¶
getRobotReport(robotID)
¶
getCurrentDependencies()
¶
getCurrentSuperEnvelope(robotID)
¶
getCurrentTrajectoryEnvelope(robotID)
¶
addTrackingCallback(robotID, cb)
¶
setVisualization(viz)
¶
addComparator(c)
¶
setMotionPlanner(robotID, mp)
¶
getMotionPlanner(robotID)
¶
inParkingPose(robotID)
¶
setCriticalPoint(robotID, criticalPoint, retransmitt)
¶
placeRobot(robotID, currentPose=None, parking=None, location=None)
¶
isFree(robotID)
¶
atStoppingPoint(robotID)
¶
spawnWaitingThread(robotID, index, duration)
¶
getObstaclesInCriticalPoints(robotIDs)
¶
getObstaclesFromWaitingRobots(robotID)
¶
makeObstacles(robotID, *obstaclePoses)
¶
doReplanning(mp, fromPose, toPose, obstaclesToConsider=())
¶
updateDependencies()
abstractmethod
¶
canExitCriticalSection(drivingCurrentIndex, waitingCurrentIndex, drivingTE, waitingTE, lastIndexOfCSDriving)
¶
getCriticalPoint(yieldingRobotID, cs, leadingRobotCurrentPathIndex)
¶
isAhead(cs, rr1, rr2)
¶
computeCriticalSections()
¶
filterCriticalSections()
¶
getCriticalSections(te1, minStart1, te2, minStart2, checkEscapePoses, maxDimensionOfSmallestRobot)
staticmethod
¶
cleanUpRobotCS(robotID, lastWaitingPoint)
¶
startTrackingAddedMissions()
¶
addMissions(*missions)
¶
getNewTracker(te, cb)
abstractmethod
¶
TrajectoryEnvelope
dataclass
¶
A robot's planned trajectory expressed as an STP-aware swept envelope.
envelope_id is assigned by the
:class:~coordination_oru.metacsp.spatial.trajectory_envelope_solver.TrajectoryEnvelopeSolver
that creates it; start_node / end_node are the STP variable indices
for this envelope's start and end times.
envelope_id
instance-attribute
¶
robot_id
instance-attribute
¶
path
instance-attribute
¶
start_node
instance-attribute
¶
end_node
instance-attribute
¶
spatial_envelope
instance-attribute
¶
footprint
instance-attribute
¶
component = 'Driving'
class-attribute
instance-attribute
¶
nominal_duration = 0.0
class-attribute
instance-attribute
¶
completed = False
class-attribute
instance-attribute
¶
metadata = field(default_factory=dict)
class-attribute
instance-attribute
¶
length
property
¶
pose_at(index)
¶
waypoint_footprint(index)
¶
getID()
¶
getRobotID()
¶
getPathLength()
¶
getSpatialEnvelope()
¶
getFootprint()
¶
getTrajectory()
¶
makeFootprint(ps)
¶
getComponent()
¶
getSequenceNumberStart()
¶
getSequenceNumberEnd()
¶
getSequenceNumber(x, y)
¶
Index of the path point closest to (x, y).
Mirrors Java's getSequenceNumber(Coordinate) used to locate
stopping points along the path.
coordination_oru.tracking_callback
¶
TrackingCallback: per-tracker lifecycle hooks.
Mirrors Java's abstract TrackingCallback class. Subclass and override
the hooks you need; all are no-ops by default. myTE is rebound by the
tracker whenever its trajectory envelope changes (updateTrajectoryEnvelope).
TrajectoryEnvelope
dataclass
¶
A robot's planned trajectory expressed as an STP-aware swept envelope.
envelope_id is assigned by the
:class:~coordination_oru.metacsp.spatial.trajectory_envelope_solver.TrajectoryEnvelopeSolver
that creates it; start_node / end_node are the STP variable indices
for this envelope's start and end times.
envelope_id
instance-attribute
¶
robot_id
instance-attribute
¶
path
instance-attribute
¶
start_node
instance-attribute
¶
end_node
instance-attribute
¶
spatial_envelope
instance-attribute
¶
footprint
instance-attribute
¶
component = 'Driving'
class-attribute
instance-attribute
¶
nominal_duration = 0.0
class-attribute
instance-attribute
¶
completed = False
class-attribute
instance-attribute
¶
metadata = field(default_factory=dict)
class-attribute
instance-attribute
¶
length
property
¶
pose_at(index)
¶
waypoint_footprint(index)
¶
getID()
¶
getRobotID()
¶
getPathLength()
¶
getSpatialEnvelope()
¶
getFootprint()
¶
getTrajectory()
¶
makeFootprint(ps)
¶
getComponent()
¶
getSequenceNumberStart()
¶
getSequenceNumberEnd()
¶
getSequenceNumber(x, y)
¶
Index of the path point closest to (x, y).
Mirrors Java's getSequenceNumber(Coordinate) used to locate
stopping points along the path.