24.09., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 81dad22a authored by Edmond Irani Liu's avatar Edmond Irani Liu

update description, add goal-less scenarios, add planner, change CF

parent d6f615c5
......@@ -16,6 +16,7 @@ from typing import *
import warnings
import copy
# example A* planner
class MotionPlanner:
def __init__(self, scenario, planningProblem, automata):
......
......@@ -15,6 +15,7 @@ import heapq
import copy
from typing import *
# example Greedy Best First Search planner
class MotionPlanner:
def __init__(self, scenario, planningProblem, automata):
......
......@@ -15,6 +15,8 @@ import heapq
import copy
from typing import *
# example Greedy Best First Search planner with a heuristic function
# that only considers the time_step of the goal region
class MotionPlanner:
def __init__(self, scenario, planningProblem, automata):
......@@ -483,7 +485,7 @@ class MotionPlanner:
:param path: The path for which you want to calculate the cost
:param curPos: Last state of your current path. Every state has the following variables: position, velocity, orientation, time_step
"""
# a heuristic that considers time and goal lane (if any)
# a heuristic that only considers time of goal
if hasattr(self.planningProblem.goal.state_list[0], 'time_step'):
time_step_goal = (self.planningProblem.goal.state_list[0].time_step.start + \
self.planningProblem.goal.state_list[0].time_step.end) / 2
......
......@@ -15,6 +15,7 @@ commonroad-search/
├batch_processing/
├motion_primitives_generator/
└tutorials/
├pdfs/
├scenarios/
├exercise/
└tutorial/
......@@ -36,7 +37,7 @@ docker run -it -p 9000:8888 --mount src="$(pwd)",target=/commonroad-search,type=
     and open the Jupyter Notebook by visiting `localhost:9000` in your web browser.
After you have set up your environment, please further proceed with `notebooks/tutorials/0_Guide_for_Exercise.pdf`.
After you have set up your environment, please further proceed with `pdfs/0_Guide_for_Exercise.pdf`.
## Installation guide
......@@ -81,12 +82,12 @@ As documented in CommonRoad-io [Documentation](https://commonroad.in.tum.de/stat
### 2. CommonRoad-Collision-Checker
Go to folder `GSMP/tools/commonroad-collision-checker/` and follow the instruction in README.rst. (You may navigate to it from this page by for a better rendering of the .rst file)
Go to folder `GSMP/tools/commonroad-collision-checker/` and follow the instruction in README.rst. (You may navigate to it from this page for a better rendering of the .rst file)
A tutorial of CommonRoad Collision Checker can be found [here](https://commonroad.in.tum.de/tutorials/).
### 3. CommonRoad-Road-Boundary
Go to folder `GSMP/tools/commonroad-road-boundary/` and follow the instruction in README.md. (You may navigate to it from this page by for a better rendering of the .md file) In case you face an error, refer to troubleshooting section.
Go to folder `GSMP/tools/commonroad-road-boundary/` and follow the instruction in README.md. (You may navigate to it from this page for a better rendering of the .md file) In case you face an error, refer to troubleshooting section.
## Tutorials
......@@ -95,7 +96,7 @@ Navigate your terminal to `commonroad-search/` folder, and start Jupyter Noteboo
$ jupyter notebook
```
In the prompt up page, navigate to `notebooks/tutorials/` and follow the tutorials `tutorial_commonroad-io.ipynb` and `tutorial_commonroad-search.ipynb`. Remember to refer to `tutorials/0_Guide_for_Exercise.pdf` for additional explanation. The executed Jupyter notebooks for tutorials can also be found [here](https://commonroad.in.tum.de/tutorials/).
In the prompt up page, navigate to `notebooks/tutorials/` and follow the tutorials `tutorial_commonroad-io.ipynb` and `tutorial_commonroad-search.ipynb`. Remember to refer to `pdfs/0_Guide_for_Exercise.pdf` for additional explanation. The executed Jupyter notebooks for tutorials can also be found [here](https://commonroad.in.tum.de/tutorials/).
## Implement your own search algorithm
......
......@@ -131,7 +131,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Start Processing"
"### Start Processing"
]
},
{
......@@ -153,6 +153,7 @@
" \n",
" if not filename.endswith('.xml'):\n",
" continue\n",
" \n",
" fullname = os.path.join(settings['input_path'], filename)\n",
"\n",
" print(\"Started processing scenario {}\".format(filename))\n",
......
......@@ -131,7 +131,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Start Processing"
"### Start Processing"
]
},
{
......@@ -153,6 +153,7 @@
" \n",
" if not filename.endswith('.xml'):\n",
" continue\n",
" \n",
" fullname = os.path.join(settings['input_path'], filename)\n",
"\n",
" print(\"Started processing scenario {}\".format(filename))\n",
......
......@@ -25,4 +25,4 @@ default:
# vehicle type, e.g, BMW 320i
vehicle_type: BMW_320i
# cost function
cost_function: JB1
cost_function: SM1
......@@ -59,11 +59,14 @@ def execute_search_batch(scenario, planning_problem_set, veh_type_id=2,
motion_planner = MotionPlanner(scenario, planning_problem, automata)
print("Start search..")
time_start = time.process_time()
result = motion_planner.search_alg(initial_motion_primitive.Successors, max_tree_depth)
time_end = time.process_time()
print("Solving this scenario took {} seconds".format(round(time_end - time_start, 2)))
dict_result = {}
# result is in form of (final path, used_primitives)
if result is not None:
result_path = result[0]
list_state = list()
......
......@@ -333,20 +333,13 @@
" step_size=0.1, # time step of scenario, typically 0.1\n",
" vehicle_type=veh_type, # vehicle type, change if needed\n",
" vehicle_model=VehicleModel.KS, # vehicle model, change if needed\n",
" cost_function=CostFunction.JB1) # cost funtion, change if needed\n",
" cost_function=CostFunction.SM1) # cost funtion, ** do not use JB1 **\n",
"\n",
"# add trajectory solution\n",
"csw.add_solution_trajectory(trajectory=trajectory, planning_problem_id=planning_problem.planning_problem_id)\n",
"\n",
"csw.write_to_file(overwrite=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......
......@@ -333,20 +333,13 @@
" step_size=0.1, # time step of scenario, typically 0.1\n",
" vehicle_type=veh_type, # vehicle type, change if needed\n",
" vehicle_model=VehicleModel.KS, # vehicle model, change if needed\n",
" cost_function=CostFunction.JB1) # cost funtion, change if needed\n",
" cost_function=CostFunction.SM1) # cost funtion, ** do not use JB1 **\n",
"\n",
"# add trajectory solution\n",
"csw.add_solution_trajectory(trajectory=trajectory, planning_problem_id=planning_problem.planning_problem_id)\n",
"\n",
"csw.write_to_file(overwrite=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment