CommonRoad-Search

CommonRoad-Search offers a selection of exemplary (un)informed search algorithms with motion primitives to solve motion planning problems. Here we also demonstrate how the motion primitives are generated, and how to use our batch processor to search for solutions with parallel execution.

general_picture

A minimal example for using the package:

from commonroad.common.file_reader import CommonRoadFileReader
from maneuver_automaton.maneuver_automaton import ManeuverAutomaton
from motion_planner.motion_planner import MotionPlanner

scenario = '../../scenarios/tutorial/ZAM_Tutorial_Urban-3_2.xml'
motionprimitives = 'V_9.0_9.0_Vstep_0_SA_-0.2_0.2_SAstep_0.4_T_0.5_Model_BMW320i.xml'

# load scenario and planning problem set, retrieve the first planning problem
scenario, planning_problem_set = CommonRoadFileReader(scenario).open()
planning_problem = list(planning_problem_set.planning_problem_dict.values())[0]

# create maneuver automaton
automaton = ManeuverAutomaton.generate_automaton(motionprimitives)

# create and execute planner
planner = MotionPlanner.AStarSearch(scenario=scenario,
									planning_problem=planning_problem,
									automaton=automaton)
path_solution, _, _ = planner.execute_search()
for primitive in path_solution:
	for state in primitive:
		print(state)