simulation.utils.road.sections.straight_road module¶
The StraightRoad can be used to create straight sections of a road.
As any other road sections, line markings can be variied and obstacles created on the road.
Reference¶
-
class
_StraightRoad(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>, length: float = 1)[source]¶ Bases:
simulation.utils.road.sections.road_section.RoadSection-
TYPE= 0¶
-
length: float = 1¶ Length of the section.
-
-
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._StraightRoadStraight 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)