simulation.utils.road.sections.intersection module¶
Intersection.
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.
-
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.RoadSectionRoad 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¶
-
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¶
-
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
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]¶