sumocr.interactive_scenarios package

Submodules

sumocr.interactive_scenarios.simulations module

SUMO simulation specific helper methods

class sumocr.interactive_scenarios.simulations.SimulationOption(value)[source]

Bases: Enum

An enumeration.

MOTION_PLANNER = '_planner'
SOLUTION = '_solution'
WITHOUT_EGO = '_without_ego'
sumocr.interactive_scenarios.simulations.check_trajectories(solution, pps, config)[source]
sumocr.interactive_scenarios.simulations.create_video_for_simulation(scenario_with_planner, output_folder_path, planning_problem_set, ego_vehicles, suffix, follow_ego=True)[source]

Creates the mp4 animation for the simulation result.

sumocr.interactive_scenarios.simulations.load_sumo_configuration(interactive_scenario_path)[source]
Return type:

DefaultConfig

sumocr.interactive_scenarios.simulations.simulate_scenario(mode, conf, scenario_wrapper, scenario_path, num_of_steps=None, planning_problem_set=None, solution=None, use_sumo_manager=False)[source]

Simulates an interactive scenario with specified mode

Parameters:
  • mode (SimulationOption) – 0 = without ego, 1 = with plugged in planner, 2 = with solution trajectory

  • conf (DefaultConfig) – config of the simulation

  • scenario_wrapper (ScenarioWrapper) – scenario wrapper used by the Simulator

  • scenario_path (str) – path to the interactive scenario folder

  • num_of_steps (Optional[int]) – number of steps to simulate

  • planning_problem_set (Optional[PlanningProblemSet]) – planning problem set of the scenario

  • solution (Optional[Solution]) – solution to the planning problem

  • use_sumo_manager (bool) – indicates whether to use the SUMO Manager

Return type:

Tuple[Scenario, Dict[int, EgoVehicle]]

Returns:

simulated scenario and dictionary with items {planning_problem_id: EgoVehicle}

sumocr.interactive_scenarios.simulations.simulate_with_planner(interactive_scenario_path, output_folder_path=None, create_video=False, use_sumo_manager=False, create_ego_obstacle=False)[source]

Simulates an interactive scenario with a plugged in motion planner

Parameters:
  • interactive_scenario_path (str) – path to the interactive scenario folder

  • output_folder_path (Optional[str]) – path to the output folder

  • create_video (bool) – indicates whether to create a mp4 of the simulated scenario

  • use_sumo_manager (bool) – indicates whether to use the SUMO Manager

  • create_ego_obstacle (bool) – indicates whether to create obstacles from the planned trajectories as the ego vehicles

Return type:

Tuple[Scenario, PlanningProblemSet, Dict[int, EgoVehicle]]

Returns:

Tuple of the simulated scenario, planning problem set, and list of ego vehicles

sumocr.interactive_scenarios.simulations.simulate_with_solution(interactive_scenario_path, output_folder_path=None, solution=None, create_video=False, use_sumo_manager=False, create_ego_obstacle=False)[source]

Simulates an interactive scenario with a given solution

Parameters:
  • interactive_scenario_path (str) – path to the interactive scenario folder

  • output_folder_path (Optional[str]) – path to the output folder

  • solution (Optional[Solution]) – solution to the planning problem

  • create_video (bool) – indicates whether to create a mp4 of the simulated scenario

  • use_sumo_manager (bool) – indicates whether to use the SUMO Manager

  • create_ego_obstacle (bool) – indicates whether to create obstacles as the ego vehicles

Return type:

Tuple[Scenario, PlanningProblemSet, Dict[int, EgoVehicle]]

Returns:

Tuple of the simulated scenario and the planning problem set

sumocr.interactive_scenarios.simulations.simulate_without_ego(interactive_scenario_path, output_folder_path=None, create_video=False, use_sumo_manager=False, num_of_steps=None)[source]

Simulates an interactive scenario without ego vehicle

Parameters:
  • interactive_scenario_path (str) – path to the interactive scenario folder

  • output_folder_path (Optional[str]) – path to the output folder

  • create_video (bool) – indicates whether to create a mp4 of the simulated scenario

  • use_sumo_manager (bool) – indicates whether to use the SUMO Manager

  • num_of_steps – max. number of simulated time steps

Return type:

Tuple[Scenario, PlanningProblemSet]

Returns:

Tuple of the simulated scenario and the planning problem set

sumocr.interactive_scenarios.utility module

sumocr.interactive_scenarios.utility.save_solution(scenario, planning_problem_set, ego_vehicles, vehicle_type, vehicle_model, cost_function, output_path='./', overwrite=False)[source]

Saves the given trajectory as a solution to the planning problem

sumocr.interactive_scenarios.utility.visualize_scenario_with_trajectory(scenario, planning_problem_set, ego_vehicles=None, discrete_time_step=False, num_time_steps=None)[source]
Return type:

None

Module contents