simulation.utils.road.sections.intersection module

Intersection.

Summary

Classes:

Intersection

Road section representing an intersection.

Functions:

arange_with_end

Reference

_get_stop_line(line1: simulation.utils.geometry.line.Line, line2: simulation.utils.geometry.line.Line, kind)simulation.utils.road.sections.surface_marking.SurfaceMarkingRect[source]

Return a line perpendicular to both provided (assumed parallel) lines.

The returned line will be at the first point where both lines are parallel to each other plus 2cm offset.

arange_with_end(start: float, end: float, step: float)[source]
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]