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.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:
- 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 trajectoryconf (
DefaultConfig
) – config of the simulationscenario_wrapper (
ScenarioWrapper
) – scenario wrapper used by the Simulatorscenario_path (
str
) – path to the interactive scenario foldernum_of_steps (
Optional
[int
]) – number of steps to simulateplanning_problem_set (
Optional
[PlanningProblemSet
]) – planning problem set of the scenariosolution (
Optional
[Solution
]) – solution to the planning problemuse_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 folderoutput_folder_path (
Optional
[str
]) – path to the output foldercreate_video (
bool
) – indicates whether to create a mp4 of the simulated scenariouse_sumo_manager (
bool
) – indicates whether to use the SUMO Managercreate_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 folderoutput_folder_path (
Optional
[str
]) – path to the output foldersolution (
Optional
[Solution
]) – solution to the planning problemcreate_video (
bool
) – indicates whether to create a mp4 of the simulated scenariouse_sumo_manager (
bool
) – indicates whether to use the SUMO Managercreate_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 folderoutput_folder_path (
Optional
[str
]) – path to the output foldercreate_video (
bool
) – indicates whether to create a mp4 of the simulated scenariouse_sumo_manager (
bool
) – indicates whether to use the SUMO Managernum_of_steps – max. number of simulated time steps
- Return type:
Tuple
[Scenario
,PlanningProblemSet
]- Returns:
Tuple of the simulated scenario and the planning problem set