Intersections

Base Intersections

class gym_urbandriving.state.PositionState(data, car_model='kinematic')[source]

Abstract class representing the objects in a scene

collides_any(agentnum, type_of_agent='background_cars')[source]

Returns if the agentnum object in the scene is colliding with any other object

Parameters:agentnum (int) – The index of the object to query
Returns:True if this object is colliding
Return type:bool
create_agents()[source]

Creates agents for objects in the scene

get_collisions()[source]

Get list of all collisions in this state

Returns:
  • list – List of tuples, where each tuple contains a pair of coliding object indices. Dynamic_collisions contains collisions between cars and other cars.
  • list – The corresponding list for collisions between dynamic objects and static objects
min_dist_to_coll(agentnum, type_of_agent='background_cars')[source]

Returns the minimum distance between the object with id agentnum and a collideable object.

Parameters:agentnum (int) – The index of the object to query
Returns:Distance to nearest collideable object
Return type:float
randomize()[source]

Randomly generates car and pedestrian positions