simulation.utils.road.sections package

Definition of the road.sections module.

Collect classes and functions which should be included in the road.sections module.

If these imports are rearranged cyclic imports may occur. To prevent this: isort:skip_file

Submodules:

Summary

__all__ Classes:

BlockedArea

Road section representing a blocked area.

CubicBezier

Cubic bezier curve, defined by three control points.

Intersection

Road section representing an intersection.

LeftCircularArc

Part of a circle with a positive curvature.

ParkingArea

Part of the road with parking lots and a start line.

ParkingLot

Outline of a parking lot (right/left side) and all parking spots contained within.

ParkingObstacle

ParkingObstacle(transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = False, center: simulation.utils.geometry.point.Point = Point(0.2, -0.2, 0.0), width: float = 0.15, depth: float = 0.15, angle: float = 0, height: float = 0.2)

ParkingSpot

Parking spot with a type and optionally an obstacle placed on top.

QuadBezier

Quadratic bezier curve, defined by two control points.

RightCircularArc

Part of a circle with a negative curvature.

RoadSection

Base class of all road sections.

StaticObstacle

StaticObstacle(transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, center: simulation.utils.geometry.point.Point = Point(0.4, -0.2, 0.0), width: float = 0.2, depth: float = 0.2, angle: float = 0, height: float = 0.2)

StraightRoad

Straight section of the road.

SurfaceMarkingPoly

SurfaceMarkingPoly(kind: Tuple[int, str] = None, transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, frame: simulation.utils.geometry.polygon.Polygon = Polygon([Point(0.3, -0.4, 0.0), Point(0.5, -0.4, 0.0), Point(0.5, 0.0, 0.0), Point(0.3, 0.0, 0.0), Point(0.3, -0.4, 0.0)]))

SurfaceMarkingRect

SurfaceMarkingRect(kind: Tuple[int, str] = None, transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, center: simulation.utils.geometry.point.Point = Point(0.4, -0.2, 0.0), width: float = 0.2, depth: float = 0.2, angle: float = 0)

TrafficIsland

Road section representing an traffic island.

TrafficSign

TrafficSign(transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, center: simulation.utils.geometry.point.Point = Point(0.4, -0.2, 0.0), width: float = 0.2, depth: float = 0.2, angle: float = 0, kind: simulation.utils.road.sections.traffic_sign.SignTuple = None)

ZebraCrossing

Road section representing a zebra crossing.

Reference

class QuadBezier(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, p1: Optional[Union[simulation.utils.geometry.point.Point, Sequence[float]]] = None, p2: Optional[Union[simulation.utils.geometry.point.Point, Sequence[float]]] = None)[source]

Bases: simulation.utils.road.sections.bezier_curve.BezierCurve

Quadratic bezier curve, defined by two control points.

Parameters
  • p1 (Union[Point, Sequence[float]]) – Control point 1. Y-Value has to be zero in order to match the gradient of the last section at the start.

  • p2 (Union[Point, Sequence[float]]) – Control point 2.

TYPE = 3
property middle_line

Middle line of the road section.

Type

Line

class CubicBezier(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, p1: Optional[Union[simulation.utils.geometry.point.Point, Sequence[float]]] = None, p2: Optional[Union[simulation.utils.geometry.point.Point, Sequence[float]]] = None, p3: Optional[Union[simulation.utils.geometry.point.Point, Sequence[float]]] = None)[source]

Bases: simulation.utils.road.sections.bezier_curve.BezierCurve

Cubic bezier curve, defined by three control points.

Parameters
  • p1 (Union[Point, Sequence[float]]) – Control point 1.

  • p2 (Union[Point, Sequence[float]]) – Control point 2.

  • p3 (Union[Point, Sequence[float]]) – Control point 3.

TYPE = 4
p3: Union[simulation.utils.geometry.point.Point, Sequence[float]] = None

Control point 3.

property middle_line

Middle line of the road section.

Type

Line

class LeftCircularArc(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, radius: Optional[float] = None, angle: Optional[float] = None)[source]

Bases: simulation.utils.road.sections.circular_arc._CircularArc

Part of a circle with a positive curvature.

Parameters
  • radius (float) – Radius [m].

  • angle (float) – Part of the circle [radian].

TYPE = 1
class RightCircularArc(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, radius: Optional[float] = None, angle: Optional[float] = None)[source]

Bases: simulation.utils.road.sections.circular_arc._CircularArc

Part of a circle with a negative curvature.

Parameters
  • radius (float) – Radius [m].

  • angle (float) – Part of the circle [radian].

TYPE = 2
class Intersection(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, angle: float = 1.5707963267948966, closing: Optional[str] = None, turn: str = 0, rule: str = 0, size: float = 1.8)[source]

Bases: simulation.utils.road.sections.road_section.RoadSection

Road section representing an intersection.

Parameters
  • angle (float) – Angle [radian] between crossing roads.

  • closing (int) – Optionally close one direction to create a T-intersection.

  • turn (int) – Direction in which the road continues.

  • rule (int) – Priority-rule at intersection.

  • size (float) – Length of the crossing roads.

TYPE = 7
STRAIGHT = 0

Possible value for turn. Drive straight through the intersection.

LEFT = 1

Possible value for turn. Turn left at the intersection.

RIGHT = 2

Possible value for turn. Turn right at the intersection.

EQUAL = 0

Possible value for rule. Rechts vor links.

YIELD = 1

Possible value for rule. Car must yield.

STOP = 2

Possible value for rule. Car must stop.

PRIORITY_YIELD = 3

Possible value for rule. Car will have the right of way.

Intersecting road must yield.

PRIORITY_STOP = 4

Possible value for rule. Car will have the right of way.

Intersecting road must stop.

angle: float = 1.5707963267948966

Angle between intersecting roads [radian].

closing: str = None

Closed direction (T-intersection).

turn: str = 0

Direction in which road continues.

rule: str = 0

Priority rule at intersection.

size: float = 1.8

Size of intersection (from one side to the other).

property sin
property cos
property y
property x
property z
property u
property v
property w
property ll
property ls
property rl
property rs
cp_sign_south(sign_dist)[source]
cp_surface_south()[source]
cp_sign_west(sign_dist)[source]
cp_surface_west()[source]
cp_sign_north(sign_dist)[source]
cp_sign_east(sign_dist)[source]
cp_surface_east()[source]
get_points()[source]
property middle_line_south
property left_line_south
property right_line_south
property middle_line_east
property left_line_east
property right_line_east
property middle_line_north
property left_line_north
property right_line_north
property middle_line_west
property left_line_west
property right_line_west
property ls_circle
property ll_circle
property rs_circle
property rl_circle
property middle_line

Middle line of the intersection.

Type

Line

property lines

All road lines with their marking type.

Type

List[MarkedLine]

get_beginning() → Tuple[simulation.utils.geometry.pose.Pose, float][source]

Get the beginning of the section as a pose and the curvature.

Returns

A tuple consisting of the first point on the middle line together with the direction facing away from the road section as a pose and the curvature at the beginning of the middle line.

get_ending() → Tuple[simulation.utils.geometry.pose.Pose, float][source]

Get the ending of the section as a pose and the curvature.

Returns

A tuple consisting of the last point on the middle line together with the direction facing along the middle line as a pose and the curvature at the ending of the middle line.

get_bounding_box()simulation.utils.geometry.polygon.Polygon[source]

Get a polygon around the road section.

Bounding box is an approximate representation of all points within a given distance of this geometric object.

_get_intersection_traffic_signs() → List[simulation.utils.road.sections.traffic_sign.TrafficSign][source]
_get_intersection_surface_markings() → List[simulation.utils.road.sections.surface_marking.SurfaceMarkingRect][source]
class StaticObstacle(transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, center: simulation.utils.geometry.point.Point = Point(0.4, - 0.2, 0.0), width: float = 0.2, depth: float = 0.2, angle: float = 0, height: float = 0.2)[source]

Bases: simulation.utils.road.sections.road_element.RoadElementRect

id_ = 1
desc = 'StaticObstacle'
height: float = 0.2

Height of the obstacle.

class ParkingObstacle(transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = False, center: simulation.utils.geometry.point.Point = Point(0.2, - 0.2, 0.0), width: float = 0.15, depth: float = 0.15, angle: float = 0, height: float = 0.2)[source]

Bases: simulation.utils.road.sections.obstacle._ParkingObstacle

id_ = 2
desc = 'ParkingObstacle'
width: float = 0.15

Width of the obstacle.

depth: float = 0.15

Width of the obstacle.

normalize_x: bool = False
property center

Center of the element in global coordinates.

Type

Point

class TrafficSign(transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, center: simulation.utils.geometry.point.Point = Point(0.4, - 0.2, 0.0), width: float = 0.2, depth: float = 0.2, angle: float = 0, kind: simulation.utils.road.sections.traffic_sign.SignTuple = None)[source]

Bases: simulation.utils.road.sections.road_element.RoadElementRect

ZONE_10_START = SignTuple(mesh='speed_limit_zone_10_start_sign', id_=101, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_20_START = SignTuple(mesh='speed_limit_zone_20_start_sign', id_=102, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_30_START = SignTuple(mesh='speed_limit_zone_30_start_sign', id_=103, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_40_START = SignTuple(mesh='speed_limit_zone_40_start_sign', id_=104, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_50_START = SignTuple(mesh='speed_limit_zone_50_start_sign', id_=105, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_60_START = SignTuple(mesh='speed_limit_zone_60_start_sign', id_=106, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_70_START = SignTuple(mesh='speed_limit_zone_70_start_sign', id_=107, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_80_START = SignTuple(mesh='speed_limit_zone_80_start_sign', id_=108, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_90_START = SignTuple(mesh='speed_limit_zone_90_start_sign', id_=109, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_10_END = SignTuple(mesh='speed_limit_zone_10_end_sign', id_=110, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_20_END = SignTuple(mesh='speed_limit_zone_20_end_sign', id_=111, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_30_END = SignTuple(mesh='speed_limit_zone_30_end_sign', id_=112, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_40_END = SignTuple(mesh='speed_limit_zone_40_end_sign', id_=113, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_50_END = SignTuple(mesh='speed_limit_zone_50_end_sign', id_=114, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_60_END = SignTuple(mesh='speed_limit_zone_60_end_sign', id_=115, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_70_END = SignTuple(mesh='speed_limit_zone_70_end_sign', id_=116, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_80_END = SignTuple(mesh='speed_limit_zone_80_end_sign', id_=117, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ZONE_90_END = SignTuple(mesh='speed_limit_zone_90_end_sign', id_=118, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
RAMP_START = SignTuple(mesh='uphill_grade_sign', id_=119, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
RAMP_END = SignTuple(mesh='downhill_grade_sign', id_=120, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
PRIORITY = SignTuple(mesh='priority_sign', id_=121, collision_box_size=(0.015, 0.1, 0.275), collision_box_position=(0, 0, 0.1375))
YIELD = SignTuple(mesh='yield_sign', id_=122, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
STOP = SignTuple(mesh='stop_sign', id_=123, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
ONCOMING_TRAFFIC = SignTuple(mesh='oncoming_traffic_sign', id_=124, collision_box_size=(0.015, 0.1, 0.275), collision_box_position=(0, 0, 0.1375))
NO_OVERTAKING_START = SignTuple(mesh='no_overtaking_start_sign', id_=125, collision_box_size=(0.015, 0.1, 0.275), collision_box_position=(0, 0, 0.1375))
NO_OVERTAKING_END = SignTuple(mesh='no_overtaking_end_sign', id_=126, collision_box_size=(0.015, 0.1, 0.275), collision_box_position=(0, 0, 0.1375))
TURN_RIGHT = SignTuple(mesh='turn_right_sign', id_=127, collision_box_size=(0.015, 0.1, 0.275), collision_box_position=(0, 0, 0.1375))
TURN_LEFT = SignTuple(mesh='turn_left_sign', id_=128, collision_box_size=(0.015, 0.1, 0.275), collision_box_position=(0, 0, 0.1375))
PASS_RIGHT = SignTuple(mesh='pass_right_sign', id_=129, collision_box_size=(0.015, 0.1, 0.125), collision_box_position=(0, 0, 0.0625))
PASS_LEFT = SignTuple(mesh='pass_left_sign', id_=130, collision_box_size=(0.015, 0.1, 0.125), collision_box_position=(0, 0, 0.0625))
SHARP_TURN_RIGHT_SMALL = SignTuple(mesh='sharp_turn_right_small_sign', id_=131, collision_box_size=(0.015, 0.1, 0.125), collision_box_position=(0, 0, 0.0625))
SHARP_TURN_RIGHT = SignTuple(mesh='sharp_turn_right_sign', id_=132, collision_box_size=(0.015, 0.3, 0.125), collision_box_position=(0, 0, 0.0625))
SHARP_TURN_LEFT_SMALL = SignTuple(mesh='sharp_turn_left_small_sign', id_=133, collision_box_size=(0.015, 0.1, 0.125), collision_box_position=(0, 0, 0.0625))
SHARP_TURN_LEFT = SignTuple(mesh='sharp_turn_left_sign', id_=134, collision_box_size=(0.015, 0.3, 0.125), collision_box_position=(0, 0, 0.0625))
ZEBRA_CROSSING = SignTuple(mesh='zebra_crossing_sign', id_=135, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
PARKING = SignTuple(mesh='parking_sign', id_=136, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
EXPRESSWAY_START = SignTuple(mesh='expressway_start_sign', id_=137, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
EXPRESSWAY_END = SignTuple(mesh='expressway_end_sign', id_=138, collision_box_size=(0.015, 0.15, 0.3), collision_box_position=(0, 0, 0.15))
kind: simulation.utils.road.sections.traffic_sign.SignTuple = None
class SurfaceMarkingPoly(kind: Tuple[int, str] = None, transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, frame: simulation.utils.geometry.polygon.Polygon = Polygon([Point(0.3, - 0.4, 0.0), Point(0.5, - 0.4, 0.0), Point(0.5, 0.0, 0.0), Point(0.3, 0.0, 0.0), Point(0.3, - 0.4, 0.0)]))[source]

Bases: simulation.utils.road.sections.road_element.RoadElementPoly, simulation.utils.road.sections.surface_marking.SurfaceMarking

class SurfaceMarkingRect(kind: Tuple[int, str] = None, transform: simulation.utils.geometry.transform.Transform = None, normalize_x: bool = True, center: simulation.utils.geometry.point.Point = Point(0.4, - 0.2, 0.0), width: float = 0.2, depth: float = 0.2, angle: float = 0)[source]

Bases: simulation.utils.road.sections.road_element.RoadElementRect, simulation.utils.road.sections.surface_marking.SurfaceMarking

class ParkingArea(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, length: float = 1, start_line: bool = False, start_line_length: float = 0.06, left_lots: List[simulation.utils.road.sections.parking_area.ParkingLot] = <factory>, right_lots: List[simulation.utils.road.sections.parking_area.ParkingLot] = <factory>)[source]

Bases: simulation.utils.road.sections.parking_area._ParkingArea

Part of the road with parking lots and a start line.

Parameters
  • left_lots (List[ParkingLot]) – Parking lots on the left side.

  • right_lots (List[ParkingLot]) – Parking lots on the right side.

  • start_line (bool) – Indicate whether the parking area starts with a start line.

  • start_line_length (float) – Manually set the length of the start line.

property surface_markings

All surface markings within this section of the road.

Type

List[SurfaceMarking]

get_bounding_box()simulation.utils.geometry.polygon.Polygon[source]

Get a polygon around the road section.

Bounding box is an approximate representation of all points within a given distance of this geometric object.

property left_lots

Parking lots on the left side.

Type

List[ParkingLot]

property right_lots

Parking lots on the right side.

Type

List[ParkingLot]

property parking_obstacles

All obstacles on parking spots.

Type

List[ParkingObstacle]

property obstacles

All obstacles within this section of the road.

Type

List[StaticObstacle]

property lines

All borderlines with their marking type.

Type

List[MarkedLine]

property traffic_signs

All traffic signs within this section of the road.

Type

List[TrafficSign]

class ParkingLot(start: float = 0, spots: List[simulation.utils.road.sections.parking_area.ParkingSpot] = <factory>, _side: str = 'right', opening_angle: float = 1.0471975511965976, depth: Optional[float] = None, transform: Optional[simulation.utils.geometry.transform.Transform] = None)[source]

Bases: simulation.utils.road.sections.parking_area._ParkingLot

Outline of a parking lot (right/left side) and all parking spots contained within.

Parameters
  • start (float) – Beginning relative to the start of the section.

  • opening_angle (float) – Opening angle of the outside border of the parking lot.

  • depth (float) – Depth of the parking spots within the parking lot.

  • spots (List[ParkingSpot]) – Parking spots within the lot.

property length

Sum of the widths of all parking spots.

Type

float

property _side_sign
property border

Outside border of the parking lot.

Type

Line

property spots

All spots in the parking lot.

Type

List[ParkingSpot]

property obstacles

All obstacles on spots.

Type

List[ParkingObstacle]

property lines

All border lines with solid marking type.

Type

List[MarkedLine]

class ParkingSpot(width: float = 0.35, kind: str = 0, obstacle: Optional[simulation.utils.road.sections.obstacle.ParkingObstacle] = None, transform: Optional[simulation.utils.geometry.transform.Transform] = None)[source]

Bases: simulation.utils.road.sections.parking_area._ParkingSpot

Parking spot with a type and optionally an obstacle placed on top.

Parameters
  • width (float) – Width of the spot.

  • kind (int) – Type of the spot.

  • obstacle (ParkingObstacle) – Obstacle within the spot.

property frame

Frame of the parking spot in global coordinates.

Type

Polygon

property lines

Borderlines for spot if spot is on the left.

Marking type is always solid.

Type

List[MarkedLine]

property obstacle

Obstacle that is on the spot (if any).

Type

ParkingObstacle

class StraightRoad(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, length: float = 1)[source]

Bases: simulation.utils.road.sections.straight_road._StraightRoad

Straight section of the road.

Parameters

length (float) – Length [m] of the section.

Example

>>> from simulation.utils.road.sections import StraightRoad
>>> from simulation.utils.road.road import Road
>>> road = Road()
>>> road.append(StraightRoad(length=2))
>>> road
Road(_name=None, _seed=None, use_seed=True, sections=[StraightRoad(id=0, transform=Transform(translation=Vector(0.0, 0.0, 0.0),rotation=Quaternion(1.0, 0.0, 0.0, 0.0)), is_start=False, left_line_marking='solid', middle_line_marking='dashed', right_line_marking='solid', obstacles=[], traffic_signs=[], surface_markings=[], length=2)], length=2.0)
property middle_line

Middle line of the road section.

Type

Line

class ZebraCrossing(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, length: float = 0.45)[source]

Bases: simulation.utils.road.sections.straight_road.StraightRoad

Road section representing a zebra crossing.

Parameters

length (float) – length of the crossing and thus the section.

TYPE = 6
length: float = 0.45
property frame

Frame for the zebra crossing surface marking.

Type

Polygon

property traffic_signs

All traffic signs within this section of the road.

Type

List[TrafficSign]

class RoadSection(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>)[source]

Bases: simulation.utils.road.sections.road_section._RoadSection

Base class of all road sections.

TYPE = None

Type of the road section.

prev_length: float = 0

Length of Road up to this section.

property middle_line

Middle line of the road section.

Type

Line

property left_line

Left line of the road section.

Type

Line

property right_line

Right line of the road section.

Type

Line

property lines

All road lines with their marking type.

Type

List[MarkedLine]

property obstacles

All obstacles within this section of the road.

Type

List[StaticObstacle]

property traffic_signs

All traffic signs within this section of the road.

Type

List[TrafficSign]

property surface_markings

All surface markings within this section of the road.

Type

List[SurfaceMarking]

get_bounding_box()simulation.utils.geometry.polygon.Polygon[source]

Get a polygon around the road section.

Bounding box is an approximate representation of all points within a given distance of this geometric object.

get_beginning() → Tuple[simulation.utils.geometry.pose.Pose, float][source]

Get the beginning of the section as a pose and the curvature.

Returns

A tuple consisting of the first point on the middle line together with the direction facing away from the road section as a pose and the curvature at the beginning of the middle line.

get_ending() → Tuple[simulation.utils.geometry.pose.Pose, float][source]

Get the ending of the section as a pose and the curvature.

Returns

A tuple consisting of the last point on the middle line together with the direction facing along the middle line as a pose and the curvature at the ending of the middle line.

class BlockedArea(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, length: float = 1, width: float = 0.2, _opening_angle: float = 1.0471975511965976)[source]

Bases: simulation.utils.road.sections.straight_road.StraightRoad

Road section representing a blocked area.

Parameters

width (float) – width of the blocked area, starting from the right line.

TYPE = 8
width: float = 0.2
_opening_angle: float = 1.0471975511965976
property frame

Frame of the blocked area surface marking.

It has the shape of a symmetrical trapezoid.

Type

Polygon

property _poly
property traffic_signs

All traffic signs within this section of the road.

Type

List[TrafficSign]

class TrafficIsland(id: int = 0, transform: Optional[simulation.utils.geometry.transform.Transform] = None, is_start: bool = False, left_line_marking: str = 'solid', middle_line_marking: str = 'dashed', right_line_marking: str = 'solid', obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle] = <factory>, traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign] = <factory>, surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking] = <factory>, island_width: float = 0.3, zebra_length: float = 0.45, curve_area_length: float = 0.8, curvature: float = 0.4, zebra_marking_type: int = 1, _sign_distance: float = 0.3)[source]

Bases: simulation.utils.road.sections.road_section.RoadSection

Road section representing an traffic island.

Parameters
  • island_width (float) – width of the island in the middle

  • zebra_length (float) – length of zebra section on the island

  • curve_area_length (float) – length of curve area section

  • curvature (float) – amount of curvature ranging from 0 to 1

  • zebra_marking_type (int) – marking on the middle of the island

TYPE = 9
LINES = 0

Possible value for zebra_marking_type. Show lines on the island.

ZEBRA = 1

Possible value for zebra_marking_type. Show zebra crossing on the island.

island_width: float = 0.3

Width of island in the middle.

zebra_length: float = 0.45

Length of the zebra crossing area.

curve_area_length: float = 0.8

Length of the bezier curve area at start and end of island.

curvature: float = 0.4

Define where along the curve area the control points are located.

zebra_marking_type: int = 1

Type of zebra marking type. Can be LINES or ZEBRA.

_sign_distance: float = 0.3

Distance of the directions signs from the mid island part.

property length

Length of the entire section.

property middle_start
property middle_r_zebra_start
property middle_r_zebra_end
property middle_end
property right_zebra_start
property right_zebra_end
property left_zebra_start
property left_zebra_end
property middle_l_zebra_start
property middle_l_zebra_end
property bezier_points_mid_r_start
property bezier_points_mid_r_end
property bezier_points_mid_l_start
property bezier_points_mid_l_end
property middle_line_r

Middle line on the right side of the traffic island.

Type

Line

property middle_line_l

Middle line on the left side of the traffic island.

Type

Line

property middle_line

Middle line of the road section. Here it is the left middle line.

Type

Line

property right_line

Right line of the road section.

Type

Line

property left_line

Left line of the road section.

Type

Line

property lines

All road lines with their marking type.

Type

List[MarkedLine]

property traffic_signs

All traffic signs within this section of the road.

Type

List[TrafficSign]

property surface_markings

All surface markings within this section of the road.

Type

List[SurfaceMarking]