This project introduces a framework for long-term short-term decision-making and planning for self-driving cars on the Frenet frame. We have utilized the Frenet frame for both the driving route definition and the trajectory generation. We have also provided a forward and inverse transformation from Cartesian to Frenet coordinates.
- Simulation works as server-client. CARLA launches as server and uses 2000:2002 ports as default. Client can connect to server from port 2000, default, and interract with environment.
git clone https://github.com/MajidMoghadam2006/frenet-trajectory-planning-framework.git
cd frenet-trajectory-planning-framework/
pip3 install -r requirements.txt
(requires Python 3.7 or newer)
- Download the pre-compiled CARLA simulator from CARLA releases page
- Now you can run this version using ./CarlaUE4.sh command
- Create a virtual Python environemnt, e.g. using
conda create -n carla99
, and activate the environment, i.e.conda activate carla99
- If easy_install is not installed already, run this:
sudo apt-get install python-setuptools
- Navigate to PythonAPI/carla/dist
- Install carla as a python package into your virtual environment (get help):
easy_install --user --no-deps carla-X.X.X-py3.7-linux-x86_64.egg
Now you may import carla in your python script.
- Simulation parameters are configured at /tools/cfgs/config.yaml
- We need to start two different terminals.
cd CARLA_0.9.9.2/
DISPLAY= ./CarlaUE4.sh -opengl
CARLA documentation
-
cd frenet-trajectory-planning-framework/
-
python3 run.py --cfg_file=tools/cfgs/config.yaml --env=CarlaGymEnv-v1 --play_mode=1
-
Execution parameters are configured in program arguments:
---cfg_file
: specifies the config file
---env
: Gym environment ID
-
--play_mode
: Display mode: 0:off, 1:2D, 2:3D, default=0 ---carla_host
: IP of the host server (default: 127.0.0.1) ---carla_port
: TCP port to listen to (default: 2000) ---tm_port
: Traffic Manager TCP port to listen to (default: 8000) ---carla_res
: Window resolution (default: 1280x720) -
Carla requires a powerful GPU to produce high fps. In order to increase performance you can run following as an alternative:
-
DISPLAY= ./CarlaUE4.sh -carla-server -fps=20 -world-port=2000 -windowed -ResX=1280 -ResY=720 -carla-no-hud -quality-level=Low
- Env and simulation Config File: tools/cfgs/config.yaml
- Gym Environment: carla_gym/envs/ # Gym environment interface for CARLA, To manipulate observation, action, reward etc. (suitable for RL training)
- Modules: tools/modules.py # Pretty much wraps everything
title={An Autonomous Driving Framework for Long-term Decision-making and Short-term Trajectory Planning on Frenet Space},
author={Moghadam, Majid and Elkaim, Gabriel Hugh},
journal={arXiv preprint arXiv:2011.13099},
year={2020}
}