Source Code Documentation

Module Dataset

class openautomatumdronedata.dataset.droneDataset(dataSetFolderPath)[source]

Bases: object

Represents 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

get_lane_assignment(x, y)[source]

Returns the lane ID vector of the given point

Parameters:
  • x – x value of the point

  • y – y value of the point

Returns:

Lane assignment as ID of xodr lane (0 means not in road)

Module dynamicWorld

class openautomatumdronedata.dynamicWorld.bicyclesObject(movement_dynamic, delta_t)[source]

Bases: openautomatumdronedata.dynamicWorld.dynamicObject

Class 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.dynamicObject

Class 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.dynamicObject

Class 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.dynamicObject

Class for representing a trailer object. Inheritances from dynamicObject which currently provides the main functionality.

class openautomatumdronedata.dynamicWorld.dynamicObject(movement_dynamic, delta_t)[source]

Bases: object

Base 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 None

  • long_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_first_time()[source]
Returns:

Returns the time the object occurs the first time

get_last_time()[source]
Returns:

Returns the time the object occurs the last time

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.

next_index_of_specific_time(time)[source]

Returns the index that is next to the given time. If the object is not visible in that time step. The function returns None.

Returns:

Next index to a given time.

rotate_and_translate_position(dx, dy, dps, time)[source]

Returns the position after rotation with dpsi and translation with dx and dy.

class openautomatumdronedata.dynamicWorld.dynamicWorld(path2JSON)[source]

Bases: object

Represents 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.

get_length_of_dataset_in_seconds()[source]

Returns the complete length of the dataset in seconds.

get_list_of_dynamic_objects()[source]

Returns the list of dynamic objects.

get_list_of_dynamic_objects_for_specific_time(time)[source]

Returns the list of dynamic objects that are visitable at the given time.

index_in_range(idx)[source]

Returns true if the given index is within the time of the current recording. False if not.

class openautomatumdronedata.dynamicWorld.electricScooterObject(movement_dynamic, delta_t)[source]

Bases: openautomatumdronedata.dynamicWorld.dynamicObject

Class 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.dynamicObject

Class 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.dynamicObject

Class 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.dynamicObject

Class 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.dynamicObject

Class for representing a van object. Inheritances from dynamicObject which currently provides the main functionality.

Module staticWorld

class openautomatumdronedata.staticWorld.xodrGeometry(xmlGeometry)[source]

Bases: object

Main class for all further geometry objects.

Based on xodr specification the following forms are supported by the corresponding child classes:

  • Straight Line by xodrGeometryLine

  • Arc by xodrGeometryCurvature

  • Spiral (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

static create_geo_obj(xmlGeometry)[source]

Object factory thats create the correct child class

sample_me(sampleWidth)[source]

Sample of geometry object have to be overwritten by the child class

class openautomatumdronedata.staticWorld.xodrGeometryCurvature(xmlGeometry)[source]

Bases: openautomatumdronedata.staticWorld.xodrGeometry

Geometry Class for a XODR Curvature

Overwrites the base class xodrGeometry

Parameters:

xmlGeometry – xmlTree of a geometry object

Variables:

curvature – Curvature of the reference line

get_lane_marking_dicts()[source]

Returns the lane marking plotting vector for the center line

sample_me(sampleWidth)[source]

Samples this geometry object

class openautomatumdronedata.staticWorld.xodrGeometryLine(xmlGeometry)[source]

Bases: openautomatumdronedata.staticWorld.xodrGeometry

Geometry 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

sample_me(sampleWidth)[source]

Samples this geometry object

class openautomatumdronedata.staticWorld.xodrGeometryPoly3(xmlGeometry)[source]

Bases: openautomatumdronedata.staticWorld.xodrGeometry

Geometry Class for a XODR Poly 3rd Order

Overwrites the base class xodrGeometry

get_lane_marking_dicts()[source]

Returns the lane marking plotting vector for the center line

sample_me(sampleWidth)[source]

Samples this geometry object

class openautomatumdronedata.staticWorld.xodrLane(xmlLane)[source]

Bases: object

Represents 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

get_lane_width(s, consider_sign=True)[source]

Returns the lane_width of the lane on a defined position of s

Parameters:
  • s – Distance along the lane, started by current lane section

  • consider_sign – If True the sign is considered (negative if lane id is negative)

Returns:

Lateral offset of lane

sample_me(s_vec, off_vec, x_vec, y_vec, geo_vec, s_offset, innerLane=None)[source]

Samples this geometry object

class openautomatumdronedata.staticWorld.xodrLaneOffset(lane_offset_XML)[source]

Bases: object

Defines a Lane offset for a road

get_offset(s)[source]

Returns the offset for a given distance

is_offset_relevant(s)[source]

Returns ture if the given distance s is behind the start value of the lane offset

class openautomatumdronedata.staticWorld.xodrLaneSection(xmlLaneSection, first_lane_section=True, last_lane_section=True)[source]

Bases: object

Defines 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(lane_id)[source]

Returns the lane object for the given lane_id.

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

sample_me(geo)[source]

Samples this geometry object

class openautomatumdronedata.staticWorld.xodrLaneWidth(xmlLaneWidth)[source]

Bases: object

get_lane_width(s)[source]
class openautomatumdronedata.staticWorld.xodrMiddleLine(parent)[source]

Bases: object

This 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.

add_discrete_reference_line_point(s, x, y, off, geo)[source]
get_lane_marking_dicts()[source]

Returns the lane marking plotting vector for the center line

sample_me()[source]
class openautomatumdronedata.staticWorld.xodrRoad(parent, roadXML, sampleWidth=1.0)[source]

Bases: object

This 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

get_lane_offset(s)[source]

Return the lane offset

sample_me(sampleWidth)[source]

Calculates the sampled value (point vector) of this static world element.

class openautomatumdronedata.staticWorld.xodrStaticWorld(path2XODR, sampleWidth=1.0)[source]

Bases: object

Representing 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

get_road(road_id)[source]

Returns the road by a given ID

Parameters:

road_id (_type_) – _description_

Returns:

_description_

Return type:

_type_