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/).
This is a script that helps you to batch process your code to solve for solution to different scenarios. It is composed of a configuration file (.yaml) and the codes below. Before you run this code, you should make sure the configuration file is set correctly. Here are the explanation for each of the parameters in the configuration file:
* input_path: the input directory of CommonRoad scenarios that you indend to solve.
* output_path: the output directory of the solution files.
* overwrite: the falg to determine whether to overwrite existing solution files.
* timeout: timeout time for your motion planner, unit in seconds
* trajectory_planner_path: input directory where the module containing the function to execute your motion planner is located
* trajectory_planner_module_name: name of the module taht contains the function to execute your motion planner
* trajectory_planner_function_name: name of the function that executes your motion planner
* default: the parameters specified under this will be applied to all scenarios. if you wish to specify a different paramter for specific scenarios, simply copy the section and replace 'default' with the id of your scenario.
* vehicle_model: model of the vehicle, its value could be PM, KS, ST and MB.
* vehicle_type type of the vehicle, its value could be FORD_ESCORT, BMW_320i and VW_VANAGON.
* cost_function: identifier of cost function. Please refer to [Cost Functions](https://gitlab.lrz.de/tum-cps/commonroad-cost-functions/blob/master/costFunctions_commonRoad.pdf) for more information.
This is a script that helps you to batch process your code to solve for solution to different scenarios. It is composed of a configuration file (.yaml) and the codes below. Before you run this code, you should make sure the configuration file is set correctly. Here are the explanation for each of the parameters in the configuration file:
* input_path: the input directory of CommonRoad scenarios that you indend to solve.
* output_path: the output directory of the solution files.
* overwrite: the falg to determine whether to overwrite existing solution files.
* timeout: timeout time for your motion planner, unit in seconds
* trajectory_planner_path: input directory where the module containing the function to execute your motion planner is located
* trajectory_planner_module_name: name of the module taht contains the function to execute your motion planner
* trajectory_planner_function_name: name of the function that executes your motion planner
* default: the parameters specified under this will be applied to all scenarios. if you wish to specify a different paramter for specific scenarios, simply copy the section and replace 'default' with the id of your scenario.
* vehicle_model: model of the vehicle, its value could be PM, KS, ST and MB.
* vehicle_type type of the vehicle, its value could be FORD_ESCORT, BMW_320i and VW_VANAGON.
* cost_function: identifier of cost function. Please refer to [Cost Functions](https://gitlab.lrz.de/tum-cps/commonroad-cost-functions/blob/master/costFunctions_commonRoad.pdf) for more information.
## Graph Search-Based Motion Planners with Motion Primitives
This tutorial shows how [CommonRoad Search](https://gitlab.lrz.de/tum-cps/commonroad-search), or **Graph Search-Based Motion Planner with Motion Primitives**, is used to search for trajectories that connect an **initial state** and a **goal region**.
%% Cell type:markdown id: tags:
## 0. Preparation
* Before you proceed, make sure you have read through the tutorial for [CommonRoad-io](https://commonroad.in.tum.de/static/docs/commonroad-io/index.html). Its tutorial can be found [here](https://commonroad.in.tum.de/tutorials/).
* Make sure you have installed all necessary modules for CommonRoad Search according to the installation manual.
* A documentation for the API of CommonRoad Search can be found [here](https://commonroad.in.tum.de/static/docs/commonroad-search/index.html).
* The API of CommonRoad-io can be found [here](https://commonroad.in.tum.de/static/docs/commonroad-io/api/index.html)
%% Cell type:markdown id: tags:
## 1. Load Python Environment
We first import necessary modules for motion planning, as well as some extensions for our convenience.
%% Cell type:code id: tags:
``` python
# enabling autoreload will reload modules automatically before entering the execution of code,
# so you could edit the code for your motion planner and execute it right away without reloading again
%load_extautoreload
%autoreload2
# always show execution time for each cell
%load_extautotime
# use notebook to get interactive plots
%matplotlibnotebook
```
%% Cell type:code id: tags:
``` python
# append main directory
importsys
sys.path.append("../../GSMP/motion_automata")
# load necessary modules and functions
fromautomata.HelperFunctionsimport*
```
%% Cell type:markdown id: tags:
Secondly, we specify the motion planner that we want to use:
%% Cell type:code id: tags:
``` python
# Uncomment the following to try out exemplary motion planners
# from automata.MotionPlanner_Astar import MotionPlanner
# Uncomment the following to load your own motion planner
# from automata.MotionPlanner import MotionPlanner
```
%% Cell type:markdown id: tags:
## 2. Load Scenarios
We call automata.HelperFunctions.load_scenario() to load scenarios and planning problems. Scenarios beginning with letter C stand for cooeprative driving scenarios and possess multiple planning problems. In this case you should provide solutions to all planning problems.
In this step, we would like to configure the planning problem for the motion planner. Each **planning problem** has an individual **initial state** and a **goal region**.
%% Cell type:code id: tags:
``` python
# retrieve planning problem with given index (for cooperative scenario:0, 1, 2, ..., otherwise: 0)
The final step is writing your solution to the planning problem in the scenario into an XML file which is uploadable to our [Benchmark](https://commonroad.in.tum.de/submissions/create).
You may also refer to [Solution Writer](https://commonroad.in.tum.de/static/docs/commonroad-io/api/common.html#module-commonroad.common.solution_writer), [Cost Function](https://gitlab.lrz.de/tum-cps/commonroad-cost-functions/blob/master/costFunctions_commonRoad.pdf) and [Vehicle Model](https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/blob/master/vehicleModels_commonRoad.pdf) for additional information.
Note: In this tutorial we use Kinematic Single-Track Model.
## Graph Search-Based Motion Planners with Motion Primitives
This tutorial shows how [CommonRoad Search](https://gitlab.lrz.de/tum-cps/commonroad-search), or **Graph Search-Based Motion Planner with Motion Primitives**, is used to search for trajectories that connect an **initial state** and a **goal region**.
%% Cell type:markdown id: tags:
## 0. Preparation
* Before you proceed, make sure you have read through the tutorial for [CommonRoad-io](https://commonroad.in.tum.de/static/docs/commonroad-io/index.html). Its tutorial can be found [here](https://commonroad.in.tum.de/tutorials/).
* Make sure you have installed all necessary modules for CommonRoad Search according to the installation manual.
* A documentation for the API of CommonRoad Search can be found [here](https://commonroad.in.tum.de/static/docs/commonroad-search/index.html).
* The API of CommonRoad-io can be found [here](https://commonroad.in.tum.de/static/docs/commonroad-io/api/index.html)
%% Cell type:markdown id: tags:
## 1. Load Python Environment
We first import necessary modules for motion planning, as well as some extensions for our convenience.
%% Cell type:code id: tags:
``` python
# enabling autoreload will reload modules automatically before entering the execution of code,
# so you could edit the code for your motion planner and execute it right away without reloading again
%load_extautoreload
%autoreload2
# always show execution time for each cell
%load_extautotime
# use notebook to get interactive plots
%matplotlibnotebook
```
%% Cell type:code id: tags:
``` python
# append main directory
importsys
sys.path.append("../../GSMP/motion_automata")
# load necessary modules and functions
fromautomata.HelperFunctionsimport*
```
%% Cell type:markdown id: tags:
Secondly, we specify the motion planner that we want to use:
%% Cell type:code id: tags:
``` python
# Uncomment the following to try out exemplary motion planners
# from automata.MotionPlanner_Astar import MotionPlanner
# Uncomment the following to load your own motion planner
# from automata.MotionPlanner import MotionPlanner
```
%% Cell type:markdown id: tags:
## 2. Load Scenarios
We call automata.HelperFunctions.load_scenario() to load scenarios and planning problems. Scenarios beginning with letter C stand for cooeprative driving scenarios and possess multiple planning problems. In this case you should provide solutions to all planning problems.
In this step, we would like to configure the planning problem for the motion planner. Each **planning problem** has an individual **initial state** and a **goal region**.
%% Cell type:code id: tags:
``` python
# retrieve planning problem with given index (for cooperative scenario:0, 1, 2, ..., otherwise: 0)
The final step is writing your solution to the planning problem in the scenario into an XML file which is uploadable to our [Benchmark](https://commonroad.in.tum.de/submissions/create).
You may also refer to [Solution Writer](https://commonroad.in.tum.de/static/docs/commonroad-io/api/common.html#module-commonroad.common.solution_writer), [Cost Function](https://gitlab.lrz.de/tum-cps/commonroad-cost-functions/blob/master/costFunctions_commonRoad.pdf) and [Vehicle Model](https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/blob/master/vehicleModels_commonRoad.pdf) for additional information.
Note: In this tutorial we use Kinematic Single-Track Model.