Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

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

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

minor update

parent 25832298
......@@ -2,12 +2,12 @@
This is a programming exercise for the lecture **Foundations of Artificial Intelligence** (WS20) delivered at the Department of Informatics, TUM. The task in this exercise is to implement a heuristic function and/or a search algorithm with motion
primitives to solve [CommonRoad](https://commonroad.in.tum.de/) scenarios. The following search algorithms have been implemented as examples:
1. Breadth First Search
2. Depth First Search
3. Depth-limited Search
4. Uniform Cost Search (aka Dijkstra's algorithm)
5. Greedy Best First Search
6. A* Search
- Breadth First Search
- Depth First Search
- Depth-limited Search
- Uniform Cost Search (aka Dijkstra's algorithm)
- Greedy Best First Search
- A* Search
The code is written in Python 3.7 and has been tested on Ubuntu 18.04. As the first step, clone this repository with:
......@@ -56,14 +56,14 @@ 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 the `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).
```sh
$ git clone https://gitlab.lrz.de/tum-cps/commonroad-drivability-checker.git
$ cd commonroad-drivability-checker
$ bash build.sh -e /path/to/your/anaconda3/envs/commonroad-py37 -v 3.X --cgal --serializer -i -j 4
$ 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).
......
......@@ -65,7 +65,7 @@ scenario_loader:
# DEFAULT: loads all scenarios from the specified scenario folder
# RANDOM: loads randomly selected scenarios from the specified scenario folder
# SPECIFIC: loads specified scenarios, see below
inputmode: DEFAULT
inputmode: RANDOM
# number of scenarios to be randomly selected. this only works for inputmode set to RANDOM
random_count: 3
......
import warnings
from typing import List
from copy import deepcopy
from typing import List
import numpy as np
from commonroad.common.solution import VehicleModel, VehicleType
from commonroad.scenario.trajectory import Trajectory, State
from commonroad.common.solution_writer import VehicleModel, VehicleType
class MotionPrimitive:
......
......@@ -14,8 +14,9 @@ from SMP.route_planner.route_planner.utils_route import chaikins_corner_cutting,
try:
import pycrccosy
except ModuleNotFoundError as exp:
warnings.warn(f"""You won't be able to use the Curvilinear Coordinate System for the Navigator,
the calculations won't be precise. {exp}""")
pass
# warnings.warn(f"""You won't be able to use the Curvilinear Coordinate System for the Navigator,
# the calculations won't be precise. {exp}""")
class RouteType(Enum):
......
......@@ -25,8 +25,9 @@ from SMP.route_planner.route_planner.route import RouteType, RouteCandidateHolde
try:
import pycrccosy
except ModuleNotFoundError as exp:
warnings.warn(f"""You won't be able to use the Curvilinear Coordinate System for the Navigator,
the calculations won't be precise. {exp}""")
pass
# warnings.warn(f"""You won't be able to use the Curvilinear Coordinate System for the Navigator,
# the calculations won't be precise. {exp}""")
class RoutePlanner:
......
......@@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
......
......@@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
......@@ -65,9 +65,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA2AAAAA+CAYAAABN/ni+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz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+ZNX45cUCNkTELwBXA7PVRNkcFzhG7QNuiYjJiLiKbj7+s+z4GurXgMczc+7cgPVRL62qAyhLsVrS7cA3gXHgnsw8UnFYTXMD8PvAoXPLogJ/BNwaEW+hOzXhGPCH1YTXOFcAe7t9MS3g3sz8RkTsB74aER8E/gf47QpjbJSIuJTuSq2ra+Bz1kd5IuI+4J3AqyNiDvgT4LP0romv010BcQb4Cd0VKzVEffLxKWASeLA4fk1n5oeAdwCfiYhlYAX4UGYOumCEBtAnH+/sdYzKzCMR8VXgUbpTRT/sCojD1SsfmflFXnoeMVgftdKYZeglSZIkqWpNmoIoSZIkSZWyAZMkSZKkktiASZIkSVJJbMAkSZIkqSQ2YJIkSZJUEhswSZIkSSqJDZgkSZIklcQGTJIkSZJK8n8NNM2jlq6+ewAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 1080x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# load scenario\n",
"path_scenario = os.path.join(path_notebook, \"../../scenarios/tutorial/\")\n",
......
......@@ -241,7 +241,7 @@
"metadata": {},
"source": [
"### 3.4 Visualizing planned trajectory\n",
"Given that we have constructed a feasible trajectory, we now visualize our planned trajectory."
"Given that we have constructed a feasible trajectory, we now visualize our solution (ego vehicle shown with green rectangle):"
]
},
{
......@@ -276,8 +276,8 @@
"metadata": {},
"outputs": [],
"source": [
"from commonroad.common.solution import Solution, PlanningProblemSolution\n",
"from commonroad.common.solution_writer import VehicleModel, VehicleType, CostFunction\n",
"from commonroad.common.solution import Solution, PlanningProblemSolution, \\\n",
" VehicleModel, VehicleType, CostFunction\n",
"\n",
"# create PlanningProblemSolution object\n",
"kwarg = {'planning_problem_id': planning_problem.planning_problem_id,\n",
......
......@@ -15,7 +15,7 @@ import xml.etree.ElementTree as et
from xml.dom import minidom
from commonroad.scenario.trajectory import State, Trajectory
from commonroad.common.solution_writer import VehicleType
from commonroad.common.solution import VehicleType
from commonroad_dc.feasibility.vehicle_dynamics import VehicleDynamics
import commonroad_dc.feasibility.feasibility_checker as feasibility_checker
......
......@@ -132,7 +132,7 @@
"# route = candidate_holder.retrieve_best_route_by_orientation()\n",
"\n",
"# print out coordinates of the vertices of the reference path\n",
"print(\"\\nCoordiantes [x, y]:\")\n",
"print(\"\\nCoordinates [x, y]:\")\n",
"print(route.reference_path)"
]
},
......
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