paralleldomain.data_lab.config.map

class AABB(*, proto=None, min=None, max=None)

Axis aligned bounding box

Parameters:
min

Point that defines the minimum corner of the axis aligned bounding box

max

Point that defines the maximum corner of the axis aligned bounding box

class Area(*, proto=None, id=None, type=None, edges=None, height=None, floors=None, user_data=None)

Class representing a particular Area on a UMD map

Parameters:
  • proto (Optional[UMD_pb2.Area]) –

  • id (int) –

  • type (Area.AreaType) –

  • edges (List[int]) –

  • height (float) –

  • floors (int) –

  • user_data (str) –

class AreaType(value)

All possible types that an Area can be

property area_id: int

The integer ID of the Area object

class Edge(*, proto=None, id=None, open=None, points=None, user_data=None)

Class representing a particular Edge on a UMD map

Parameters:
  • proto (Optional[UMD_pb2.Edge]) –

  • id (int) –

  • open (bool) –

  • points (List[Point_ENU]) –

  • user_data (str) –

as_polyline()

Returns a 3D Polyline representation of the edge

Return type:

Polyline3DBaseGeometry

class Info(*, proto=None, name=None, origin=None, audit=None)

Message to store map level information and metadata.

Parameters:
name

The name of the map

origin

The latitude, longitude and altitude of the UMD map.

audit
class Junction(*, proto=None, id=None, lane_segments=None, road_segments=None, signaled_intersection=None, user_data=None, corners=None, crosswalk_lanes=None, signed_intersection=None)

Class representing a particular Junction on a UMD map

Parameters:
  • proto (Optional[UMD_pb2.Junction]) –

  • id (int) –

  • lane_segments (List[int]) –

  • road_segments (List[int]) –

  • signaled_intersection (int) –

  • user_data (str) –

  • corners (List[int]) –

  • crosswalk_lanes (List[int]) –

  • signed_intersection (int) –

property junction_id: int

The integer ID of the Junction object

class LaneSegment(*, proto=None, id=None, type=None, direction=None, road=None, left_edge=None, right_edge=None, reference_line=None, predecessors=None, successors=None, left_neighbor=None, right_neighbor=None, compass_angle=None, turn_angle=None, turn_type=None, user_data=None)

Class representing a particular Lane Segment on a UMD map

Parameters:
class Direction(value)

All possible directions of a lane

class LaneType(value)

All possible lane types

class TurnType(value)

All possible turn types

property lane_segment_id: int

The integer ID of the LaneSegment object

class MapQuery(map)

Class containing lookup tools and helper functions for interacting with and querying UMD maps

Parameters:

map (UniversalMap) – The UMD map to be interacted with and queried through the MapQuery object

edges

Dictionary containing the edge_id and Edge object of the line edges which make up the UMD map

map

THe UMD map that is being interacted with through the MapQuery object

check_lane_is_longer_than(lane_id, path_length)

Checks that a given lane is longer than a given length

Parameters:
  • lane_id (int) – The ID of the lane segment which we are checking the length of

  • path_length (float) – The length against which the length of the lane segment should be compared

Return type:

bool

Returns:

True when the lane is longer than path_length, False otherwise

get_area(area_id)

Function to return an Area object based on the provided area_id

Parameters:

area_id (int) – The id of the Area object to be retrieved

Return type:

Area

Returns:

The Area object which corresponds to the provided area_id

get_areas_within_bounds(bounds, method='inside')

Function to get a list of Area objects which are located within a provided boundary

Parameters:
  • bounds (BoundingBox2DBaseGeometry[float]) – A rectangular polygon which outlines the area in which Area objects are searched for

  • method (str) – The method by which Area objects are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”

Return type:

List[Area]

Returns:

A list of Area objects which exist within the specified bounds

get_connected_lane_points(lane_id, path_length)
Returns all the points of the lane segments which are connected to a given lane segment within a certain

path_length. This function will throw an error if the lane segment, and it’s connected lane segments are shorter than the specified path_length

Parameters:
  • lane_id (int) – The ID of the lane segment we wish to get the points of

  • path_length (float) – The minimum length of the line of points we wish to return

Return type:

ndarray

Returns:

nx3 numpy array of points which make up the reference line of the lane beginning with the inputted lane

segment

get_edge(edge_id)

Function to return an Edge object based on the provided edge_id

Parameters:

edge_id (int) – The id of the Edge object to be retrieved

Return type:

Edge

Returns:

The Edge object which corresponds to the provided edge_id

get_edge_of_road_from_lane(lane_id, side)

Function which returns either the left or right Edge object of the road on which the lane we specify exists

Parameters:
  • lane_id (int) – The ID of the lane which exists on the road we wish to find the edge of

  • side (Side) – Choose to return either the left or right edge

Return type:

Edge

Returns:

An Edge object of the edge of the road corresponding to the inputted parameters

get_junction(junction_id)

Function to return a Junction object based on the provided junction_id

Parameters:

junction_id (int) – The id of the Junction object to be retrieved

Return type:

Optional[Junction]

Returns:

The Junction object which corresponds to the provided junction_id, if such a Junction exists. If

the map contains no junctions with the provided junction_id, None is returned.

get_lane_segment(lane_segment_id)

Function to return a LaneSegment object based on the provided lane_segment_id

Parameters:

lane_segment_id (int) – The id of the LaneSegment object to be retrieved

Return type:

Optional[LaneSegment]

Returns:

The LaneSegment object which corresponds to the provided lane_segment_id, if such a LaneSegment exists. If

the map contains no lanes with the provided lane_segment_id, None is returned.

get_lane_segments_near(pose, radius=10, method='overlap')
Function to get a list of LaneSegment objects which are located within a specified radius of a particular

location on the map

Parameters:
  • pose (Transformation) – The location on the map around which we return LaneSegment objects which are within the specified radius

  • radius (float) – The distance (in meters) around the provided pose within which LaneSegment objects are searched for

  • method (str) – The method by which lane segments are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”

Return type:

List[LaneSegment]

Returns:

A list of LaneSegment objects which exist within the specified radius around the specified location in the

pose parameter

get_lane_segments_within_bounds(bounds, method='inside')

Function to get a list of LaneSegment objects which are located within a provided boundary

Parameters:
  • bounds (BoundingBox2DBaseGeometry[float]) – A rectangular polygon which outlines the area in which LaneSegment objects are searched for

  • method (str) – The method by which LaneSegment objects are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”

Return type:

List[LaneSegment]

Returns:

A list of LaneSegment objects which exist within the specified bounds

get_line_point_by_distance_from_start(line, distance_from_start)
Given a line of points, returns the point that is the first to be more than the specified distance from the

start of the line. If the distance specified is longer than the line, the last point on the line will be returned

Parameters:
  • line (ndarray) – nx3 numpy array containing the 3d points which make up the line

  • distance_from_start (float) – The distance from the start of the line, after which we want to return the first point

Return type:

ndarray

Returns:

nx3 numpy array corresponding to the first point on the line which is greater than the specified

distance_from_start from the start of the line

get_random_area_location(area_type, random_seed, num_points=1, area_id=None)

Function to get a random location on the map which is located on a particular selected AreaType

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • area_type (AreaType) – The desired type of Area on which the returned location should be located. Will be ignored if area_id parameters is used

  • num_points (int) – The number of locations within a given Area object which should be returned

  • area_id (Optional[int]) – The id of the Area object on which a random location should be chosen. Optional, will override the area_type parameter if used

Return type:

Optional[Transformation]

Returns:

Transformation object containing the pose of the randomly selected area location, if such a valid location

exists. Returns None if no valid location can be found.

get_random_area_object(area_type, random_seed)

Function to get a random Area object

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • area_type (AreaType) – The desired type of Area

Return type:

Optional[Area]

Returns:

Area object which is compliant with the specified parameters passed in, if such a valid area

exists. Returns None if no valid area can be found.

get_random_junction_object(intersection_type, random_seed)

Function to find a random junction object on the map

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • intersection_type (str) – The desired type of junction (signed vs signaled)

Return type:

Optional[Junction]

Returns:

Junction object which is compliant with the specified parameters passed in, if such a valid junction

exists. Returns None if no valid junction can be found.

Raises:

ValueError – If an invalid intersection_type is specified

get_random_junction_relative_lane_location(random_seed, distance_to_junction=10.0, probability_of_signaled_junction=0.5, probability_of_arriving_junction=1.0)

Returns a location on a drivable lane in a position relative to a junction

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • distance_to_junction (float) – The desired distance between the returned lane location and the junction to which the lane location is connected

  • probability_of_signaled_junction (float) – The probability that the returned location is connected to a junction which is controlled by traffic lights as opposed to stop signs

  • probability_of_arriving_junction (float) – The probability that the return location is on a lane which is driving into an intersection (as opposed to driving away from an intersection)

Return type:

Optional[Transformation]

Returns:

Transformation object containing the pose of the location selected by the method, if such a valid location

exists. Returns None if no valid location can be found.

get_random_lane_object_from_road_type(road_type, random_seed, lane_type=None, min_path_length=None, max_retries=1000)

Function to get a random LaneSegment object from a specified RoadType

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • road_type (RoadType) – The desired type of RoadSegment

  • lane_type (Optional[LaneType]) – The desired type of LaneSegment to apply within the specified RoadSegment. If None, any lane type will be considered valid.

  • min_path_length (Optional[float]) – The minimum distance (in meters) of available road beyond the lane object returned by this function

  • max_retries (int) – The maximum number of times the method will attempt to look for a valid lane object

Return type:

Optional[LaneSegment]

Returns:

LaneSegment object which is compliant with the specified parameters passed in, if such a valid lane segment

exists. Returns None if no valid lane segments can be found.

get_random_lane_type_location(lane_type, random_seed, min_path_length=None, relative_location_variance=0.0, direction_variance_in_degrees=0.0, sample_rate=100, max_retries=1000)

Function to get a random location on the map which corresponds to a particular selected LaneType

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • lane_type (LaneType) – The desired type of LaneSegment on which the returned location should be located

  • min_path_length (Optional[float]) – The minimum distance (in meters) of available road beyond the location returned by this function

  • relative_location_variance (float) – Parameter that governs the maximum lateral variation (relative to the direction of the road lane) in the positioning of the returned location. A value of 1.0 will allow for positions to be returned across the entire width of the lane. A value of 0.0 will only return locations in the center of the lane.

  • direction_variance_in_degrees (float) – The maximum variation in the returned pose’s rotation, relative to the direction of the lane which the returned location corresponds to

  • sample_rate (int) – The number of valid points in the lateral direction of the lane (taking into account the specified relative_location_variance) from which the returned location is chosen

  • max_retries (int) – The maximum number of times the method will attempt to look for a valid lane object

Return type:

Optional[Transformation]

Returns:

Transformation object containing the pose of the randomly selected lane location, if such a valid location

exists. Returns None if no valid location can be found.

get_random_lane_type_object(lane_type, random_seed, min_path_length=None, max_retries=1000)

Function to get a random LaneSegment object

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • lane_type (LaneType) – The desired type of LaneSegment

  • min_path_length (Optional[float]) – The minimum distance (in meters) of available road beyond the LaneSegment object returned by this function

  • max_retries (int) – The maximum number of times the method will attempt to look for a valid lane object

Return type:

Optional[LaneSegment]

Returns:

LaneSegment object which is compliant with the specified parameters passed in, if such a valid lane segment

exists. Returns None if no valid lane segments can be found.

get_random_road_type_object(road_type, random_seed, min_path_length=None, max_retries=1000)

Function to get a random RoadSegment object

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • road_type (RoadType) – The desired type of RoadSegment

  • min_path_length (Optional[float]) – The minimum distance (in meters) of available road beyond the RoadSegment object returned by this function

  • max_retries (int) – The maximum number of times the method will attempt to look for a valid road segment object

Return type:

Optional[RoadSegment]

Returns:

RoadSegment object which is compliant with the specified parameters passed in, if such a valid road segment

exists. Returns None if no valid road segments can be found.

get_random_street_location(random_seed, relative_location_variance=0.0, direction_variance_in_degrees=0.0, sample_rate=100)

Function to retrieve a random street location on the map

Parameters:
  • random_seed (int) – Integer used to seed all random functions. Allows for function return to be deterministic

  • relative_location_variance (float) – Parameter that governs the maximum lateral variation (relative to the direction of the road lane) in the positioning of the returned location. A value of 1.0 will allow for positions to be returned across the entire width of the lane. A value of 0.0 will only return locations in the center of the lane.

  • direction_variance_in_degrees (float) – The maximum variation in the returned pose’s rotation, relative to the direction of the lane which the returned location corresponds to

  • sample_rate (int) – The number of valid points in the lateral direction of the lane (taking into account the specified relative_location_variance) from which the returned location is chosen

Return type:

Transformation

Returns:

Transformation object containing the pose of the random location selected by the method

get_road_segment(road_segment_id)

Function to return a RoadSegment object based on the provided road_segment_id

Parameters:

road_segment_id (int) – The id of the RoadSegment object to be retrieved

Return type:

Optional[RoadSegment]

Returns:

The RoadSegment object which corresponds to the provided road_segment_id, if such a RoadSegment exists. If

the map contains no road segments with the provided road_segment_id, None is returned.

get_road_segments_within_bounds(bounds, method='inside')

Function to get a list of RoadSegment objects which are located within a provided boundary

Parameters:
  • bounds (BoundingBox2DBaseGeometry[float]) – A rectangular polygon which outlines the area in which RoadSegment objects are searched for

  • method (str) – The method by which RoadSegment objects are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”

Return type:

List[LaneSegment]

Returns:

A list of RoadSegment objects which exist within the specified bounds

property map_graph: Graph

The Graph object of the map

class NodePrefix

Class which contains the prefixes used to denote particular map elements in the UMD map

class Object(*, proto=None, id=None, orientation=None, origin=None, bounding_box=None, traffic_sign_data=None, traffic_light_data=None, prop_data=None, exclusion_radius=None, user_data=None)

An object that exists in the UMD map.

Parameters:
id

The integer ID of the Object

orientation

The orientation of the Object

origin

The point on which the Object is placed.

bounding_box

The bounding box that encapsulates the Object.

traffic_sign_data

Data about the traffic sign if the Object is a traffic sign.

traffic_light_data

Data about the traffic light if the Object is a traffic light.

prop_data

Data about the prop if the Object is a prop.

exclusion_radius

The radius around the Object in which other Object should not be placed. Default: -1.0

user_data

Optional information about the Object

class Phase(*, proto=None, id=None, phase_timing=None, controlled_lanes=None)

The phase of a TrafficLightBulb.

Parameters:
id

The integer ID of the phase.

phase_timing

The signal state that is about to activate.

controlled_lanes

The integer IDs of the LaneSegment objects that are controlled by this TrafficLightBulb.

class Point_ECEF(*, proto=None, x=None, y=None, z=None)

Point defined in Earth-Centered, Earth-Fixed coordinate system.

Parameters:
x
y
z
class Point_ENU(*, proto=None, x=None, y=None, z=None)

3D Point in East, North Up coordinate system

Parameters:
x
y
z
class Point_LLA(*, proto=None, lat=None, lon=None, alt=None)

Point defined by a latitude, longitude and altitude

Parameters:
lat
lon
alt
class PropData(*, proto=None, type=None, asset_name=None)

Information about props that exist in the UMD map.

Parameters:
type

The type of the prop

asset_name

The name of the asset represented by the prop.

class PropType(value)

All possible types that a prop can be

class Quaternion(*, proto=None, w=None, x=None, y=None, z=None)

Message to store the coefficients of a quaternion

Parameters:
w
x
y
z
class RoadMarking(*, proto=None, id=None, edge_id=None, width=None, type=None, color=None, dash_length=None, dash_separation=None, is_stopline=None)

Markings that exist on the road to separate :obj:`LaneSegment`s

Parameters:
id

The integer ID of the RoadMarking.

edge_id

The integer ID of the Edge that defines the line on which the RoadMarking exists.

width

The width of the RoadMarking in meters.

type

The type of the RoadMarking.

color

The color of the RoadMarking.

dash_length

The length in meters of the dashes on the RoadMarking if the RoadMarking is dashed.

dash_separation

The length of the separation between dashes in meters on the RoadMarking if the RoadMarking is dashed.

is_stopline

Boolean flag to denote whether or not the RoadMarking is a stop line.

class Color(value)

All possible colors that a RoadMarking can be.

class Type(value)

All possible types of RoadMarking.

class RoadSegment(*, proto=None, id=None, name=None, predecessors=None, successors=None, lane_segments=None, reference_line=None, type=None, ground_type=None, speed_limit=None, junction_id=None, user_data=None)

Class representing a particular Road Segment on a UMD map

Parameters:
class GroundType(value)

All possible ground types that an RoadSegment can exist on

class RoadType(value)

All possible road types

property road_segment_id: int

The integer ID of the RoadSegment object

class Side(value)

Enum class for LEFT and RIGHT side. Used by geometry functions

class SignalOnset(*, proto=None, onset=None, signal_state=None, logical_state=None)

The state of a Traffic Light

Parameters:
onset

The time in seconds until the signal_state activates.

signal_state

The type of signal state.

logical_state

The logical state of the traffic signal.

class LogicalState(value)

All possible logical states of the signal.

class SignalState(value)

All possible states of the signal.

class SignaledIntersection(*, proto=None, id=None, junction=None, phase_timings=None, cycle_time=None)

An intersection that is controlled by a signal.

Parameters:
id

The integer ID of the intersection.

junction

The Junction that is controlled by the signaled intersection.

phase_timings

The timings of phases in the intersection.

cycle_time

The cycle time of the phase_timings.

class SignedIntersection(*, proto=None, id=None, junction=None, stop_sign_lane_ids=None, yield_sign_lane_ids=None)

An intersection that is controlled by a sign.

Parameters:
id

The integer ID of the intersection.

junction

The Junction that is controlled by the signaled intersection.

stop_sign_lane_ids

The integer IDs of LaneSegment objects that are controlled by a stop sign.

yield_sign_lane_ids

The integer IDs of LaneSegment objects that are controlled by a yield sign.

class SpeedLimit(*, proto=None, speed=None, units=None)

Defines the speed limit of a RoadSegment

Parameters:
speed

The speed limit in units defined by SpeedUnits

units

The units that the speed is in

class SpeedUnits(value)

All possible types for units of the speed limit

class TrafficLightBulb(*, proto=None, shape=None, color=None, phase_id=None, is_flashing=None)

Information about the bulbs that exist in traffic lights.

Parameters:
shape

The shape of the traffic light bulb

color

The color of the traffic light bulb

phase_id

The integer ID of the phase of the traffic light signal (e.g. red vs green etc).

is_flashing

Boolean flag to show whether or not the traffic light bulb is flashing

class Color(value)

All possible colors that a traffic light bulb can have.

class Shape(value)

All possible shapes of traffic light bulbs.

class TrafficLightData(*, proto=None, signaled_intersection_id=None, bulbs=None, asset_name=None)

Information about traffic lights that exist in the UMD map.

Parameters:
signaled_intersection_id

The integer ID of the junction to which the Traffic Light belongs.

bulbs

A list of bulbs that exist on the traffic light.

asset_name

An optional reference to the asset name of this traffic light box.

class TrafficSignData(*, proto=None, type=None, sign_code=None, face_value=None, face_text=None, asset_name=None)

Information about traffic signs in a UMD map.

Parameters:
type

The type of the sign

sign_code

The code that represents the content of the sign.

face_value

The “value” that is shown on the rendered sign (e.g. in a speed limit sign).

face_text

The “text” that is shown on the rendered sign (e.g. in a direction sign).

asset_name

The name of the sign asset.

class SignType(value)

All possible types of signs that can exist

class UniversalMap(*, proto=None, info=None, road_segments=None, lane_segments=None, areas=None, objects=None, edges=None, junctions=None, road_markings=None, signaled_intersections=None, signed_intersections=None, zone_grid=None)

Wrapper message for a UMD map and all its constituent parts.

Parameters:
info

Information about the UMD map.

road_segments

All RoadSegment objects in the UMD map.

lane_segments

All LaneSegment objects in the UMD map.

areas

All Area objects in the UMD map.

objects

All Object objects in the UMD map.

edges

All Edge objects in the UMD map.

junctions

All Junction objects in the UMD map.

road_markings

All RoadMarking objects in the UMD map.

signaled_intersections

All SignaledIntersection objects in the UMD map.

signed_intersections

All SignedIntersection objects in the UMD map.

zone_grid

The ZoneGrid objects of the UMD Map.

class ZoneGrid(*, proto=None, bound_NE=None, bound_SW=None, lat_samples=None, lon_samples=None, points=None)

A grid that exists across the entire UMD map. Used to map what exists in each part of the grid on the map

Parameters:
bound_NE

Point that represents the upper right corner of the ZoneGrid

bound_SW

Point that represents the lower left corner of the ZoneGrid

lat_samples

The number of examples that exist in the latitudinal direction of the ZoneGrid

lon_samples

The number of examples that exist in the longitudinal direction of the ZoneGrid

points

List of all the points in the ZoneGrid, the value of which is the ZoneType at each point.

class ZoneType(value)

All possible zone types that can exist in each cell of the ZoneGrid