simulation.src.simulation_groundtruth.src.groundtruth.test package

Submodules

simulation.src.simulation_groundtruth.src.groundtruth.test.mock_node module

Functions:

create_straight_section(id[, obstacle])

Mock straight section to be used for testing.

create_parking_section(id[, left, right, …])

Mock parking section to be used for testing.

create_intersection(id[, rule, lane_width])

Mock intersection to be used for testing.

Classes:

GroundtruthMockNode([name, log_level])

Subclass of GroundtruthNode which loads mock road sections for testing.

create_straight_section(id: int, obstacle: bool = False)[source]

Mock straight section to be used for testing.

Parameters
  • id – ID of the section.

  • obstacle – Indicate whether there should be an obstacle on the right lane.

  • lane_width – width of right and left lane.

create_parking_section(id: int, left: bool = True, right: bool = True, lane_width=0.4)[source]

Mock parking section to be used for testing.

Parameters
  • id – ID of the section.

  • left – Indicate whether a parking lot on the left side should be created.

  • right – Indicate whether a parking lot on the right side should be created.

  • lane_width – width of right and left lane.

create_intersection(id: int, rule: int = 0, lane_width: float = 0.4)[source]

Mock intersection to be used for testing.

Parameters
  • id – ID of the section.

  • rule – Priority rule of intersection.

  • lane_width – width of right and left lane.

class GroundtruthMockNode(name='groundtruth_node', log_level=2)[source]

Bases: simulation.src.simulation_groundtruth.src.groundtruth.node.GroundtruthNode

Subclass of GroundtruthNode which loads mock road sections for testing.

The parameter road can be used to specify which road should be created. All options are explained in the parameter file.

Methods:

_load_road()

Load road sections from current road.

_load_road()[source]

Load road sections from current road.

simulation.src.simulation_groundtruth.src.groundtruth.test.road_section_mocks module

Functions creating Mock objects that behave like road sections.

Functions:

_generic_mock(**kwargs)

Create a mock object with the provided keyword arguments as attributes.

mock_generic_section(*, id, type_, …[, …])

Mock a road section.

_mock_spots(spots)

_mock_lots(lots)

mock_parking_section(*, id, type_, …[, …])

Mock a parking section.

mock_intersection(*, id, type_, left_line, …)

Mock an intersection.

_generic_mock(**kwargs)[source]

Create a mock object with the provided keyword arguments as attributes.

mock_generic_section(*, id: int, type_: int, left_line: simulation.utils.geometry.line.Line, middle_line: simulation.utils.geometry.line.Line, right_line: simulation.utils.geometry.line.Line, obstacles: Optional[List[simulation.utils.geometry.polygon.Polygon]] = None)unittest.mock.Mock[source]

Mock a road section.

Parameters
  • id

  • type

  • left_line

  • middle_line

  • right_line

  • obstacles

_mock_spots(spots: List[Tuple[int, simulation.utils.geometry.polygon.Polygon]])List[unittest.mock.Mock][source]
_mock_lots(lots: List[Tuple[simulation.utils.geometry.line.Line, List[Tuple[int, simulation.utils.geometry.polygon.Polygon]]]])List[unittest.mock.Mock][source]
mock_parking_section(*, id: int, type_: int, left_line: simulation.utils.geometry.line.Line, middle_line: simulation.utils.geometry.line.Line, right_line: simulation.utils.geometry.line.Line, obstacles: Optional[List[simulation.utils.geometry.polygon.Polygon]] = None, left_lots: Optional[List[Tuple[simulation.utils.geometry.line.Line, List[Tuple[int, simulation.utils.geometry.polygon.Polygon]]]]] = None, right_lots: Optional[List[Tuple[simulation.utils.geometry.line.Line, List[Tuple[int, simulation.utils.geometry.polygon.Polygon]]]]] = None, start_line: Optional[simulation.utils.geometry.polygon.Polygon] = None)unittest.mock.Mock[source]

Mock a parking section.

Parameters
  • id

  • type

  • left_line

  • middle_line

  • right_line

  • obstacles

  • left_lots – parking lots on the left side; each with a border line and a list of spots.

  • right_lots – parking lots on the right side; each with a border line and a list of spots.

  • start_line – frame of the start line.

mock_intersection(*, id: int, type_: int, left_line: simulation.utils.geometry.line.Line, middle_line: simulation.utils.geometry.line.Line, right_line: simulation.utils.geometry.line.Line, obstacles: Optional[List[simulation.utils.geometry.polygon.Polygon]] = None, turn: int = 0, rule: int = 0, south: Optional[simulation.utils.road.sections.line_tuple.LineTuple] = None, west: Optional[simulation.utils.road.sections.line_tuple.LineTuple] = None, east: Optional[simulation.utils.road.sections.line_tuple.LineTuple] = None, north: Optional[simulation.utils.road.sections.line_tuple.LineTuple] = None)unittest.mock.Mock[source]

Mock an intersection.

Parameters
  • id

  • type

  • left_line

  • middle_line

  • right_line

  • obstacles

  • turn

  • rule

  • south

  • west

  • east

  • north

Module contents