simulation.utils.road.sections.road_section module¶
The RoadSection is parent to all other RoadSection classes.
Reference¶
-
class
MarkedLine(*args, **kwargs)[source]¶ Bases:
simulation.utils.geometry.line.LineLine with a defined line marking style.
-
classmethod
from_line(line: simulation.utils.geometry.line.Line, style, prev_length=0)[source]¶
-
classmethod
-
class
_RoadSection(id: int = 0, transform: 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:
object-
SOLID_LINE_MARKING= 'solid'¶ Continuous white line.
-
DASHED_LINE_MARKING= 'dashed'¶ Dashed white line.
-
MISSING_LINE_MARKING= 'missing'¶ No line at all.
-
id: int = 0¶ Road section id (consecutive integers by default).
-
transform: simulation.utils.geometry.transform.Transform = None¶ Transform to origin of the road section.
-
is_start: bool = False¶ Road section is beginning of the road.
-
left_line_marking: str = 'solid'¶ Marking type of the left line.
-
middle_line_marking: str = 'dashed'¶ Marking type of the middle line.
-
right_line_marking: str = 'solid'¶ Marking type of the right line.
-
obstacles: List[simulation.utils.road.sections.obstacle.StaticObstacle]¶ Obstacles in the road section.
-
traffic_signs: List[simulation.utils.road.sections.traffic_sign.TrafficSign]¶ Traffic signs in the road section.
-
surface_markings: List[simulation.utils.road.sections.surface_marking.SurfaceMarking]¶ Surface markings in the road section.
-
-
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._RoadSectionBase class of all road sections.
-
TYPE= None¶ Type of the road section.
-
prev_length: float = 0¶ Length of Road up to this section.
-
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.
-