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:
- class Edge(*, proto=None, id=None, open=None, points=None, user_data=None)¶
Class representing a particular Edge on a UMD map
- Parameters:
- as_polyline()¶
Returns a 3D Polyline representation of the edge
- Return type:
- 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:
- 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:
proto (Optional[UMD_pb2.LaneSegment]) –
id (int) –
type (LaneSegment.LaneType) –
direction (LaneSegment.Direction) –
road (int) –
left_edge (int) –
right_edge (int) –
reference_line (int) –
predecessors (List[int]) –
successors (List[int]) –
left_neighbor (int) –
right_neighbor (int) –
compass_angle (float) –
turn_angle (float) –
turn_type (LaneSegment.TurnType) –
user_data (str) –
- class Direction(value)¶
All possible directions of a lane
- class LaneType(value)¶
All possible lane types
- class TurnType(value)¶
All possible turn types
- 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
- get_area(area_id)¶
Function to return an Area object based on 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 formethod (
str
) – The method by which Area objects are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”
- Return type:
- 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:
- Return type:
- 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
- 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
- get_junction(junction_id)¶
Function to return a Junction object based on the provided junction_id
- 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:
- 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 radiusradius (
float
) – The distance (in meters) around the provided pose within which LaneSegment objects are searched formethod (
str
) – The method by which lane segments are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”
- Return type:
- 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 formethod (
str
) – The method by which LaneSegment objects are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”
- Return type:
- 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:
- Return type:
- 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 deterministicarea_type (
AreaType
) – The desired type of Area on which the returned location should be located. Will be ignored if area_id parameters is usednum_points (
int
) – The number of locations within a given Area object which should be returnedarea_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:
- 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:
- 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:
- Return type:
- 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 deterministicdistance_to_junction (
float
) – The desired distance between the returned lane location and the junction to which the lane location is connectedprobability_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 signsprobability_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:
- 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 deterministicroad_type (
RoadType
) – The desired type of RoadSegmentlane_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 functionmax_retries (
int
) – The maximum number of times the method will attempt to look for a valid lane object
- Return type:
- 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 deterministiclane_type (
LaneType
) – The desired type of LaneSegment on which the returned location should be locatedmin_path_length (
Optional
[float
]) – The minimum distance (in meters) of available road beyond the location returned by this functionrelative_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 tosample_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 chosenmax_retries (
int
) – The maximum number of times the method will attempt to look for a valid lane object
- Return type:
- 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 deterministiclane_type (
LaneType
) – The desired type of LaneSegmentmin_path_length (
Optional
[float
]) – The minimum distance (in meters) of available road beyond the LaneSegment object returned by this functionmax_retries (
int
) – The maximum number of times the method will attempt to look for a valid lane object
- Return type:
- 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 deterministicroad_type (
RoadType
) – The desired type of RoadSegmentmin_path_length (
Optional
[float
]) – The minimum distance (in meters) of available road beyond the RoadSegment object returned by this functionmax_retries (
int
) – The maximum number of times the method will attempt to look for a valid road segment object
- Return type:
- 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 deterministicrelative_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 tosample_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:
- 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:
- 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 formethod (
str
) – The method by which RoadSegment objects are checked to be within the provided bounds. Can be “inside”, “center” or “overlap”
- Return type:
- 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:
orientation (
Optional
[Quaternion
]) –orientation
bounding_box (
Optional
[AABB
]) –bounding_box
traffic_sign_data (
Optional
[TrafficSignData
]) –traffic_sign_data
traffic_light_data (
Optional
[TrafficLightData
]) –traffic_light_data
exclusion_radius (
Optional
[float
]) –exclusion_radius
proto (Optional[UMD_pb2.Object]) –
- class Phase(*, proto=None, id=None, phase_timing=None, controlled_lanes=None)¶
The phase of a
TrafficLightBulb
.- Parameters:
phase_timing (
Optional
[List
[SignalOnset
]]) –phase_timing
controlled_lanes (
Optional
[List
[int
]]) –controlled_lanes
proto (Optional[UMD_pb2.Phase]) –
- 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 thisTrafficLightBulb
.
- 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:
dash_length (
Optional
[float
]) –dash_length
dash_separation (
Optional
[float
]) –dash_separation
is_stopline (
Optional
[bool
]) –is_stopline
proto (Optional[UMD_pb2.RoadMarking]) –
- id¶
The integer ID of the
RoadMarking
.
- edge_id¶
The integer ID of the
Edge
that defines the line on which theRoadMarking
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 theRoadMarking
is dashed.
- dash_separation¶
The length of the separation between dashes in meters on the
RoadMarking
if theRoadMarking
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:
proto (Optional[UMD_pb2.RoadSegment]) –
id (int) –
name (str) –
predecessors (List[int]) –
successors (List[int]) –
lane_segments (List[int]) –
reference_line (int) –
type (RoadSegment.RoadType) –
ground_type (RoadSegment.GroundType) –
speed_limit (SpeedLimit) –
junction_id (int) –
user_data (str) –
- class GroundType(value)¶
All possible ground types that an
RoadSegment
can exist on
- class RoadType(value)¶
All possible road types
- 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:
signal_state (
Optional
[SignalState
]) –signal_state
logical_state (
Optional
[LogicalState
]) –logical_state
proto (Optional[UMD_pb2.SignalOnset]) –
- 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.
- 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.
- 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
- 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 (
Optional
[int
]) –signaled_intersection_id
asset_name (
Optional
[str
]) –asset_name
proto (Optional[UMD_pb2.TrafficLightData]) –
- 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:
road_segments (
Optional
[Dict
[int
,RoadSegment
]]) –road_segments
lane_segments (
Optional
[Dict
[int
,LaneSegment
]]) –lane_segments
road_markings (
Optional
[Dict
[int
,RoadMarking
]]) –road_markings
signaled_intersections (
Optional
[Dict
[int
,SignaledIntersection
]]) –signaled_intersections
signed_intersections (
Optional
[Dict
[int
,SignedIntersection
]]) –signed_intersections
proto (Optional[UMD_pb2.UniversalMap]) –
- info¶
Information about the UMD map.
- road_segments¶
All
RoadSegment
objects in the UMD map.
- lane_segments¶
All
LaneSegment
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.
- 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: