Module Prediction¶
The CommonRoad XMLspecification provides three possibilities to describe the movement of dynamic obstacles over time: known behavior, unknown behavior bounded by sets, and unknown behavior described by probability distributions. Known behaviour and unknown behavior bounded by sets are described by the class TrajectoryPrediction
and SetBasedPrediction
. Unknown behavior described by probability distributions is not supported in version 2019.1 and will be added in a future release.
Prediction
class¶

class
commonroad.prediction.prediction.
Prediction
(initial_time_step, occupancy_set)[source]¶ Base class for a prediction module.

initial_time_step
¶ Initial time step of the prediction.
Return type: int

TrajectoryPrediction
class¶

class
commonroad.prediction.prediction.
TrajectoryPrediction
(trajectory, shape)[source]¶ Class to represent the predicted movement of an obstacle using a trajectory. A trajectory is modeled as a state sequence over time. The occupancy of an obstacle along a trajectory is uniquely defined given its shape.

initial_time_step
¶ Initial time step of the prediction.
Return type: int

occupancy_at_time_step
(time_step)¶ Occupancy at a specific time step.
Parameters: time_step ( int
) – discrete time stepReturn type: Union
[None
,Occupancy
]Returns: occupancy at time_step if time_step is within the time interval of the prediction; otherwise, None

trajectory
¶ Predicted trajectory of the object.
Return type: Trajectory

translate_rotate
(translation, angle)[source]¶ Translates and rotates all states of the trajectory and recomputes the translated and rotated occupancy set.
Parameters:  translation (
ndarray
) – translation vector [x_off, y_off] in x and ydirection  angle (
float
) – rotation angle in radian (counterclockwise)
 translation (

SetBasedPrediction
class¶

class
commonroad.prediction.prediction.
SetBasedPrediction
(initial_time_step, occupancy_set)[source]¶ Class to represent the future behavior of obstacles by bounded occupancy sets.

initial_time_step
¶ Initial time step of the prediction.
Return type: int

Occupancy
class¶

class
commonroad.prediction.prediction.
Occupancy
(time_step, shape)[source]¶ Class describing an occupied area in the position domain. The occupied area can be defined for a certain time step or a time interval.