Source Code Documentation¶
Module Dataset¶
-
class
openautomatumdronedata.dataset.droneDataset(dataSetFolderPath)[source]¶ Bases:
objectRepresents a full automatum data dataset and decodes the information.
Information’s related to objects and their behavior over time a represented in the dynamic world. Information’s realted to lane geometry a represented in the static world.
- Parameters:
dataSetFolderPath – Path to a folder containing a valid automatum.data dataset.
- Variables:
dynWorld – Dynamic World of the dataset
statWorld – Static World of the dataset
-
calculate_on_demand_values_for_all_objects()[source]¶ Based on the combination of dynamic and static world additional values for dynamic objects could be calculated. Since these values are not part of the dataset, they can be determined on demand by calling this function.
Notice: The calculation is quiet expensive, so that it could take a view seconds.
Per dynamic object the following values are determined:
lane_id: Vector with the xodr lane id of the object at every timestamp
object_relation_dict_list: dict with the UUID of the relevant objects
Module dynamicWorld¶
-
class
openautomatumdronedata.dynamicWorld.bicyclesObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.carObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a car object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.carWithTrailerObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.cargoBikeObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.dynamicObject(movement_dynamic, delta_t)[source]¶ Bases:
objectBase Class for all dynamic objects
Per Object the following information are available as scalar:
- Variables:
type – Type of the object as string
length – Length of the object [m]
width – Width of the object [m]
UUID – Unique UUID of the object
delta_t – Time difference between two data points (equal at all objects and with the
`dynamicObject`)
Per object the following information are available as vector over time:
- Variables:
x_vec – X-Position of the assumed center of gravity of the object in the local coordinate system
y_vec – Y-Position of the assumed center of gravity of the object in the local coordinate system
vx_vec – Velocity in X-direction of the local coordinate system
vy_vec – Velocity in Y-direction of the local coordinate system
ax_vec – Acceleration of the object in X-direction in the vehicle coordinate system
ay_vec – Acceleration of the object in Y-direction in the vehicle coordinate system
jerk_x_vec – Jerk of the object in X-direction in the vehicle coordinate system. Only if available in your dataset, if not the value is None
jerk_y_vec – Jerk of the object in Y-direction in the vehicle coordinate system. Only if available in your dataset, if not the value is None
time – Vector of the timestamp in the dataset recording for the mention values.
psi_vec – Vector of orientation of objects.
curvature_vec – Driving Curvature of the object. Only if available in your dataset, if not the value is None
lane_id_vec – Id of the lane of the object in the corresponding xodr
road_id_vec – Id of the road of the object in the corresponding xodr
road_type_list – List of strings that describes the road type at every time step of the object. Only if available in your dataset, if not the value is None
object_relation_dict_list – Gives the UUID of all surrounding objects as a dict in format
`{"front_ego": <uuid>, "behind_ego": <uuid>, "front_left": <uuid>, "behind_left": <uuid>, "front_right": <uuid>, "behind_right": <uuid>}`If an object relation does not exist, e.g. since there is no object, than the value will be`None.lane_change_flag_vec – Vector of bool values, whereby True means that a lane change occurred. In newer Datasets a vector of Integers. Whereby, -1 means lane change to the left, +1 means lane change to the right and 0 means no lane change.
distance_left_lane_marking – Vector which gives the distance to the left lane marking
distance_right_lane_marking – Vector which gives the distance to the right lane marking
tth_dict_vec – Gives the Time-To-Collision to all surrounding objects as a dict in format
`{"front_ego": <ttc>, "behind_ego": <ttc>, "front_left": <ttc>, "behind_left": <ttc>, "front_right": <ttc>, "behind_right": <ttc>}`If the value can not be calculated, e.g. the relevant object is to fast, than the value will be set to`-1`. If no object exists, the value will be set to`None`ttc_dict_vec – Gives the Time-To-Headway to all surrounding objects as a dict in format
`{"front_ego": <tth>, "behind_ego": <tth>, "front_left": <tth>, "behind_left": <tth>, "front_right": <tth>, "behind_right": <tth>}`If the value can not be calculated, e.g. the relevant object is to fast, than the value will be set to`-1`. If no object exists, the value will be set to`None`lat_dist_dict_vec – Gives the lateral distance the surrounding objects as a dict in format
`{"front_ego": <latDist>, "behind_ego": <latDist>, "front_left": <latDist>, "behind_left": <latDist>, "front_right": <latDist>, "behind_right": <latDist>}`. If no object exists, the value will be set to`None`. Only if available in your dataset, if not the value is Nonelong_dist_dict_vec – Gives the long distance the surrounding objects as a dict in format
`{"front_ego": <longDist>, "behind_ego": <longDist>, "front_left": <longDist>, "behind_left": <longDist>, "front_right": <longDist>, "behind_right": <longDist>}`. If no object exists, the value will be set to`None`. Only if available in your dataset, if not the value is None
-
static
dynamic_object_factory(obj_data_dict, delta_t)[source]¶ Object factory to decode the objects that are specified in the json right into the corresponding objects.
-
get_lat_and_long(time, other)[source]¶ Returns the lateral and longitudinal distance from the current object to the given object.
- Parameters:
time – Time of evaluation
other – Other dynamic object.
- Returns:
Longitudinal Distance
- Returns:
Lateral Distance
-
get_object_position_for_defined_time(time)[source]¶ Returns object position for a given time stamp. Returns None if object relation are not calculated or object not in that time
- Parameters:
time – Evaluted Time
- Returns:
y position (None if object does not exist on the given time step)
- Returns:
y position (None if object does not exist on the given time step)
-
get_object_relation_for_defined_time(time)[source]¶ Returns object relation for a given time stamp. Returns None if object relation are not calculated or object not in that time.
- Parameters:
time – Evaluted Time
- Returns:
Dict of objects relations in the format
`{"front_ego": <uuid>, "behind_ego": <uuid>, "front_left": <uuid>, "behind_left": <uuid>, "front_right": <uuid>, "behind_right": <uuid>}`If an object relation does not exist, e.g. since there is no object, than the value will be`None.
-
is_visible_at(time)[source]¶ Checks if the object is visible at the given time :return: Returns true if the object is visiable.
-
class
openautomatumdronedata.dynamicWorld.dynamicWorld(path2JSON)[source]¶ Bases:
objectRepresents all dynamic objects in a dataset
- Parameters:
path2JSON – Path to automatum data json file
- Variables:
UUID – Unique UUID of the dataset
frame_count – Number of images/frames
fps – Frame Rate
delta_t – Time between two frames (1/fps) [s]
utm_referene_point – Reference point in the world coordinate system in UTM-Format. This reference point is the center of the coordinate system for the given position. The points is given as a tuple of (x [m], y [m], letter, number)-
dynamicObjects – List of dynamic object. Its recommended to use the included functions to access the dynamic objects.
maxTime – Maximum time of the dataset [s]
DrivenDistanceInMeter – Accumulated driven distance in meter
MedianDrivenDistanceInMeter – Median driven distance
-
get_dynObj_by_UUID(UUID)[source]¶ Returns the dynamic object with the given UUID string. If no object is found, None is returned.
-
class
openautomatumdronedata.dynamicWorld.electricScooterObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.motorcycleObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.pedestriansObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.truckObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a track object. Inheritances from dynamicObject which currently provides the main functionality.
-
class
openautomatumdronedata.dynamicWorld.vanObject(movement_dynamic, delta_t)[source]¶ Bases:
openautomatumdronedata.dynamicWorld.dynamicObjectClass for representing a van object. Inheritances from dynamicObject which currently provides the main functionality.
Module staticWorld¶
-
class
openautomatumdronedata.staticWorld.xodrGeometry(xmlGeometry)[source]¶ Bases:
objectMain class for all further geometry objects.
Based on xodr specification the following forms are supported by the corresponding child classes:
Straight Line by
xodrGeometryLineArc by
xodrGeometryCurvatureSpiral (not implemented)
Cubic polynom (not implemented)
Parametric cubic curve (not implemented)
- Parameters:
xmlGeometry – xmlTree of a geometry object
- Variables:
s – Start distance of the Geometry
x – Coordinate system x-position
y – Coordinate system y-position
hdg – Coordinate system heading
length – Relevant length of the geometry object
-
class
openautomatumdronedata.staticWorld.xodrGeometryCurvature(xmlGeometry)[source]¶ Bases:
openautomatumdronedata.staticWorld.xodrGeometryGeometry Class for a XODR Curvature
Overwrites the base class
xodrGeometry- Parameters:
xmlGeometry – xmlTree of a geometry object
- Variables:
curvature – Curvature of the reference line
-
class
openautomatumdronedata.staticWorld.xodrGeometryLine(xmlGeometry)[source]¶ Bases:
openautomatumdronedata.staticWorld.xodrGeometryGeometry Class for a XODR Line
Notice: No further variables than xodrGeometry
-
get_lane_marking_dicts()[source]¶ This functions returns all lane markings corresponding to this static world object.
Therefore, a list of line samplings, e.g. for plotting is created.
The format of the return type is: [{x_vec: […], y_vec: […], type: “borken”, color: “white”, width: 0.12}, {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, . . . {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, ]
Types:
solid: Solid lane marking
dashed: Dashed lane marking
center_line: Center line fo the corresponding road element
-
-
class
openautomatumdronedata.staticWorld.xodrGeometryPoly3(xmlGeometry)[source]¶ Bases:
openautomatumdronedata.staticWorld.xodrGeometryGeometry Class for a XODR Poly 3rd Order
Overwrites the base class
xodrGeometry
-
class
openautomatumdronedata.staticWorld.xodrLane(xmlLane)[source]¶ Bases:
objectRepresents a XODR lane
- Parameters:
xmlLane – xmlTree of a lane
- Variables:
id – ID of the Lane
type – Type of the lane, e.g. drivable or shoulder
width – Dict with all primate’s of a third order polynom to define the width of the lane
roadmark – Dict of further information of road marks (Not completely set in automatum data)
material – Dict of further information of road material (Not set in automatum data)
speed – Dict of further information of speed limits (Not set in automatum data)
-
get_lane_marking_dicts()[source]¶ This functions returns all lane markings corresponding to this static world object.
Therefore, a list of line samplings, e.g. for plotting is created.
The format of the return type is: [{x_vec: […], y_vec: […], type: “borken”, color: “white”, width: 0.12}, {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, . . . {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, ]
Types:
solid: Solid lane marking
dashed: Dashed lane marking
center_line: Center line fo the corresponding road element
-
class
openautomatumdronedata.staticWorld.xodrLaneOffset(lane_offset_XML)[source]¶ Bases:
objectDefines a Lane offset for a road
-
class
openautomatumdronedata.staticWorld.xodrLaneSection(xmlLaneSection, first_lane_section=True, last_lane_section=True)[source]¶ Bases:
objectDefines a XODR laneSection thats holds a number of lanes.
- Parameters:
xmlLaneSection – xmlTree of a lane section
- Variables:
s – Length of this lane section element along the reference line
lane – List of lane elements which belong to this lane section
first_lane_section – True if this lane section is the first one in the road
last_lane_section – True if this lane section is the last one in the road
-
check_if_s_value_is_relevant_and_add(s, off_value, x_ref_line, y_ref_line, geo_element, suc_lane_section)[source]¶ Adds a new value for sampling the lane to the s_vec
-
get_lane_id(d, l, lane_offset=0)[source]¶ Returns the lane_id for a given point, defined by the distance l along the reference line and the orthogonal distance from the reference line.
- Parameters:
d – Orthogonal distance from reference line (signed according definition in xodr)
l – Distance along the reference line
lane_offset – A general Offset of this lane section compared to the center line
- Returns:
Id of the lane (0 if out of range)
-
get_lane_marking_dicts()[source]¶ This functions returns all lane markings corresponding to this static world object.
Therefore, a list of line samplings, e.g. for plotting is created.
The format of the return type is: [{x_vec: […], y_vec: […], type: “borken”, color: “white”, width: 0.12}, {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, . . . {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, ]
Types:
solid: Solid lane marking
dashed: Dashed lane marking
center_line: Center line fo the corresponding road element
-
class
openautomatumdronedata.staticWorld.xodrMiddleLine(parent)[source]¶ Bases:
objectThis Class represents the middle lane between both sides of the road.
- Variables:
x_vec – Vector of x position
y_vec – Vector of y position
offset – Lateral offset between the original reference line and the Middle line.
-
class
openautomatumdronedata.staticWorld.xodrRoad(parent, roadXML, sampleWidth=1.0)[source]¶ Bases:
objectThis class represents a road.
- Parameters:
roadXML – XML-Tree of a road element
sampleWidth – Sample width that is used to calculate a plotable representation of the xodr.
- Variables:
name – Name of th road
length – Length of the road
id – ID of Road (Currently unused, since automatum-data currently constit of one road)
junction – Information about Junctions (Currently unused, since automatum-data currently constit of one road)
geometry – Representation of reference line
lanesections – Object that represents all lanes
-
get_lane_marking_dicts(with_centerline=True)[source]¶ This functions returns all lane markings corresponding to this static world object.
Therefore, a list of line samplings, e.g. for plotting is created.
The format of the return type is: [{x_vec: […], y_vec: […], type: “borken”, color: “white”, width: 0.12}, {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, . . . {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, ]
Types:
solid: Solid lane marking
dashed: Dashed lane marking
center_line: Center line fo the corresponding road element
-
class
openautomatumdronedata.staticWorld.xodrStaticWorld(path2XODR, sampleWidth=1.0)[source]¶ Bases:
objectRepresenting the static world of dataset
Notice: This implementation is only a very basic xodr-reader. Its just handling the basic functionality needed for the current state of automatum-data datasets.
- Parameters:
path2XODR – Path to a xodr file.
- Variables:
roads – A List of roads contained in the xodr. Roads are represtend by
xodrRoad.
-
get_lane_marking_dicts(with_centerline=False)[source]¶ This functions returns all lane markings of the static world.
Therefore, a list of line samplings, e.g. for plotting is created.
The format of the return type is: [{x_vec: […], y_vec: […], type: “borken”, color: “white”, width: 0.12}, {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, . . . {x_vec: […], y_vec: […], type: “solid”, color: “white”, width: 0.12}, ]
Types:
solid: Solid lane marking
dashed: Dashed lane marking
center_line: Center line fo the corresponding road element
with_centerline: controles if the center line is included in the list of lines, or if only real road markings are returned