simulation.utils.road.sections.parking_area module

ParkingArea, ParkingLot, ParkingSpot and StartLine.

Summary

Classes:

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.

ParkingSpot

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

Reference

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

Bases: object

FREE = 0

Possible value of kind.

OCCUPIED = 1

Possible value of kind.

BLOCKED = 2

Possible value of kind.

width: float = 0.35

Width of parking spot.

_depth: float = 0

Depth of parking spot.

_side: str = None

Side of the road.

kind: str = 0

Classification of the parking spot.

obstacle: simulation.utils.road.sections.obstacle.ParkingObstacle = None

Obstacle within the spot.

transform: simulation.utils.geometry.transform.Transform = None

Transform to origin of parking spot.

The origin is invariant of the side of the road (left, right). It is always in the left corner close to the road, with the x-direction pointing away from the road.

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 _ParkingLot(start: float = 0, spots: List[simulation.utils.road.sections.parking_area.ParkingSpot] = <factory>, _side: str = 'right', opening_angle: float = 1.0471975511965976, depth: float = None, transform: simulation.utils.geometry.transform.Transform = None)[source]

Bases: object

RIGHT_SIDE = 'right'

Possible value of side. Parking lot is on the left side of the road.

LEFT_SIDE = 'left'

Possible value of side. Parking lot is on the right side of the road.

DEFAULT_LEFT_DEPTH = 0.5

Default value for the depth of parking spots on the left side.

DEFAULT_RIGHT_DEPTH = 0.3

Default value for the depth of parking spots on the right side.

start: float = 0

Start of the parking lot along the middle line relative to the parking area.

spots: List[simulation.utils.road.sections.parking_area.ParkingSpot]

Parking spots within this parking lot.

_side: str = 'right'

Side of the road.

opening_angle: float = 1.0471975511965976

Opening angle of parking lot.

depth: float = None

Depth of parking spots within this lot.

If no other value is provided, the default depth of parking lots is 0.5m on the left side and 0.3m on the right side.

transform: simulation.utils.geometry.transform.Transform = None

Transform to origin of the parking lot.

The origin is invariant of the side of the road (left, right). It is always in the left most corner of the left most parking spot close to the road, with the x-direction pointing away from the road.

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 _ParkingArea(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, 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.straight_road.StraightRoad

TYPE = 5
start_line: bool = False

If the parking area has a start line.

start_line_length: float = 0.06

Length of the start line (if one is added.

left_lots: List[simulation.utils.road.sections.parking_area.ParkingLot]

Parking lots on the left side.

right_lots: List[simulation.utils.road.sections.parking_area.ParkingLot]

Parking lots on the right side.

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]