Commit 10b67a2c authored by Edmond Irani Liu's avatar Edmond Irani Liu 🏂
Browse files

update READMEs
parent dd0c2385
......@@ -18,13 +18,13 @@ $ git clone https://gitlab.lrz.de/tum-cps/commonroad-search.git
You can either run the code locally, in a virtual machine, or in a docker container.
1. Ubuntu, MacOS, Windows: a [VirtualBox](https://www.virtualbox.org/) image is available in which all the necessary packages have been installed. The virtual machine image can be downloaded via [this](https://syncandshare.lrz.de/getlink/fi451Sy2CYcJMBT7hZbov5qg/LUbuntu18.04_VirturalBox_2020AI%5B13.11%5D.zip) link. The downloading and the default login passwords are both `commonroad`.
2. Ubuntu, MacOS, Windows: a docker file and a docker image is available if you wish to run the code with docker container. Refer to `docker/README.md` for instructions. Minimum system requirements can be found [here](https://docs.docker.com/desktop/).
3. Ubuntu 18.04: If you wish to install the code locally, proceed with the installation guide below.
1. **Ubuntu, MacOS, Windows**: a [VirtualBox](https://www.virtualbox.org/) image is available in which all the necessary packages have been installed. The virtual machine image can be downloaded via [this](https://syncandshare.lrz.de/getlink/fi451Sy2CYcJMBT7hZbov5qg/LUbuntu18.04_VirturalBox_2020AI%5B13.11%5D.zip) link. The downloading and the default login passwords are both `commonroad`.
2. **Ubuntu, MacOS, Windows**: a docker file and a docker image is available if you wish to run the code in a docker container. Refer to `docker/README.md` for further instructions. Minimum system requirements are listed [here](https://docs.docker.com/desktop/).
3. **Ubuntu 18.04**: If you wish to install the code locally, proceed with the installation guide below.
## Installation Guide
`skip this section if you intend to run the code in the virtual machine or in the docker container.`
**skip this section if you intend to run the code in the virtual machine or in the docker container.**
We recommend using [Anaconda](https://www.anaconda.com/) to manage your environment so that even if you mess something up, you can always have a safe and clean restart. A guide for managing python environments with Anaconda can be found [here](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
......@@ -33,7 +33,7 @@ After installing Anaconda, create a new environment with:
$ conda create -n commonroad-py37 python=3.7
```
Here the name of the environment is called **commonroad-py37**. You may also change this name as you wish. In such case, don't forget to change it in the following commands as well. `Always activate` this environment before you do anything related:
Here the name of the environment is called **commonroad-py37**. You may also change this name as you wish. In such case, don't forget to change it in the following commands as well. **Always activate** this environment before you do anything related:
```sh
$ conda activate commonroad-py37
......@@ -56,7 +56,7 @@ Then, install the dependencies with:
$ pip install -r requirements.txt
```
This will install related dependencies specified in the `requirements.txt`.
This will install related dependencies specified in `requirements.txt`.
Next, we move on to the installation of [CommonRoad Drivability Checker](https://commonroad.in.tum.de/drivability_checker). This package provides functionalities such as collision checks, kinematic feasibility checks, road boundary checks, etc. Full installation commands are given below, other installation options can be found [here](https://commonroad.in.tum.de/docs/commonroad-drivability-checker/sphinx/installation.html).
......@@ -66,24 +66,20 @@ $ cd commonroad-drivability-checker
$ sudo bash build.sh -e /path/to/your/anaconda3/envs/commonroad-py37 -v 3.X --cgal --serializer -i -j 4
```
`Note`: you need to substitute `/path/to/your/anaconda3/envs/commonroad-py37` with the path to your Anaconda environment, and `X` with your python version (e. g. setting X to 7 for 3.7).
**Note**: you need to substitute `/path/to/your/anaconda3/envs/commonroad-py37` with the path to your Anaconda environment, and `X` with your python version (e. g. setting X to 7 for 3.7).
## Getting Started
Full description of the exercise is provided in `exercise_guide.pdf`.
To proceed with the tutorials, open your terminal in `commonroad-search/` folder, and launch Jupyter Notebook kernel with:
To proceed with the tutorials, open a terminal in `commonroad-search/` folder, and launch Jupyter Notebook kernel with:
```shell
$ jupyter notebook
```
In the pop-up tab (or: open http://localhost:9000/ if ran with docker, otherwise http://localhost:8888/, in the explorer), navigate to `tutorials/` and follow the tutorials.
## Implementing your search algorithm
Implement your heuristic function and/or search algorithm in `SMP/motion_planner/search_algorithms/student.py`. The usage of [PyCharm](https://www.jetbrains.com/pycharm/) is highly recommended for writing and debugging python code (freely available to students).
In the pop-up tab (or: open http://localhost:9000/ if ran with docker, otherwise http://localhost:8888/, in the explorer), navigate to `tutorials/` and follow the tutorials one by one. After that, you may proceed with the exercise itself (see exercise guide for more detail).
## Useful Tools
If you are new here, it's worth to take a look at the following tools:
......
This diff is collapsed.
......@@ -7,13 +7,5 @@ The planner supports different backends to search for the shortest route in the
1. NETWORKX: uses built-in functions from the networkx package, tends to change lane later
2. NETWORKX_REVERSED: uses built-in functions from the networkx package, tends to change lane earlier
3. PRIORITY_QUEUE: uses A-star search to find routes, lane change maneuver depends on the heuristic cost
## Installation
To use this module, run the setup script in the root folder:
```bash
python setup.py install
```
Or simply install the dependencies listed in `requirements.txt` and add this repository to your python path.
## Tutorial
A tutorial can be found at `tutorial/tutorial_route_planner.ipynb`.
commonroad-io>=2019.2
networkx>=2.4
numpy>=1.17.4
shapely>=1.6.4.post2
matplotlib>=3.1.2
setuptools>=42.0.1
\ No newline at end of file
from setuptools import setup, find_packages
# read the README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
readme = f.read()
with open(path.join(this_directory, 'requirements.txt'), encoding='utf-8') as f:
required = f.read().splitlines()
setup(
name='commonroad-route-planner',
version='0.9.0',
description='Route planner for CommonRoad',
keywords='autonomous automated vehicles driving motion planning',
url='https://gitlab.lrz.de/cps/commonroad-route-planner',
author='Daniel Tar',
author_email='daniel.tar@tum.de',
license='GNU General Public License v3.0',
packages=find_packages(),
install_requires=required,
extras_require={},
long_description_content_type='text/markdown',
long_description=readme,
classifiers=[
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
],
data_files=[('.', ['LICENSE.txt'])],
include_package_data=True,
)
......@@ -28,12 +28,12 @@ For other platforms, visit https://docs.docker.com/get-docker/.
### Build docker image
In the folder where `commonroad_search_2020.dockerfile` is located:
```
sudo docker build -t "commonroad_search_2020" - < commonroad_search_2020.dockerfile
sudo docker build -t commonroad-search:2020_AI - < commonroad_search_2020.dockerfile
```
### Run the docker container
In the root folder of the CommonRoad Search repository:
```
sudo docker run -it -p 9000:8888 --mount src="$(pwd)",target=/commonroad/commonroad-search,type=bind commonroad_search_2020
sudo docker run -it -p 9000:8888 --mount src="$(pwd)",target=/commonroad/commonroad-search,type=bind commonroad-search:2020_AI
```
You can now access the Jupyter Notebook by opening `localhost:9000` in your browser.
\ No newline at end of file
import os
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
try:
mpl.use('Qt5Agg')
except ImportError:
mpl.use('TkAgg')
from commonroad.common.file_reader import CommonRoadFileReader
from commonroad.visualization.draw_dispatch_cr import draw_object
# add current directory to python path for local imports
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from maneuver_automaton.maneuver_automaton import ManeuverAutomaton
from motion_planner.motion_planner import MotionPlanner
from motion_planner.plot_config import StudentScriptPlotConfig
# configurations
# path_scenario = '../../scenarios/tutorial/ZAM_Tutorial_Urban-3_2.xml'
path_scenario = '../../scenarios/exercise/USA_Lanker-1_2_T-1.xml'
id_type_vehicle = 2
# file_motion_primitives = 'V_9.0_9.0_Vstep_0_SA_-0.2_0.2_SAstep_0.4_T_0.5_Model_BMW320i.xml'
# file_motion_primitives = 'V_0.0_20.0_Vstep_1.0_SA_-1.066_1.066_SAstep_0.27_T_0.5_Model_BMW320i.xml'
# file_motion_primitives = 'V_0.0_20.0_Vstep_2.0_SA_-1.066_1.066_SAstep_0.18_T_0.5_Model_BMW_320i.xml'
file_motion_primitives = 'V_0.0_20.0_Vstep_4.0_SA_-1.066_1.066_SAstep_0.18_T_0.5_Model_BMW_320i.xml'
config_plot = StudentScriptPlotConfig(DO_PLOT=False)
# load scenario and planning problem set
scenario, planning_problem_set = CommonRoadFileReader(path_scenario).open()
# retrieve the first planning problem
planning_problem = list(planning_problem_set.planning_problem_dict.values())[0]
# # plot scenario
# plt.figure(figsize=(8, 8))
# draw_object(scenario)
# draw_object(planning_problem_set)
# plt.gca().set_aspect('equal')
# plt.margins(0, 0)
# plt.show()
# # close the figure to continue!
# create maneuver automaton and planning problem
automaton = ManeuverAutomaton.generate_automaton(file_motion_primitives)
# comment out the planners which you don't want to execute
dict_motion_planners = {
# 0: (MotionPlanner.BreadthFirstSearch, "Breadth First Search"),
# 1: (MotionPlanner.DepthFirstSearch, "Depth First Search"),
# 2: (MotionPlanner.DepthLimitedSearch, "Depth Limited Search"),
# 3: (MotionPlanner.UniformCostSearch, "Uniform Cost Search"),
# 4: (MotionPlanner.GreedyBestFirstSearch, "Greedy Best First Search"),
5: (MotionPlanner.AStarSearch, "A* Search"),
# 6: (MotionPlanner.StudentMotionPlanner, "Student Planner"),
7: (MotionPlanner.StudentMotionPlannerExample, "Student Planner Example")
}
for (class_planner, name_planner) in dict_motion_planners.values():
planner = class_planner(scenario=scenario, planning_problem=planning_problem,
automaton=automaton, plot_config=config_plot)
# start search
print(name_planner + " started..")
solution = planner.execute_search()
# plot scenario
plt.figure(figsize=(8, 8))
# draw_object(scenario)
# draw_object(planning_problem_set)
for primitive in solution[0]:
list_x = [state.position[0] for state in primitive]
list_y = [state.position[1] for state in primitive]
plt.plot(list_x, list_y, 'r-')
plt.gca().set_aspect('equal')
plt.margins(0, 0)
plt.show()
# close the figure to continue!
print('Done')
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