Skip to content

Latest commit

 

History

History
104 lines (83 loc) · 4.11 KB

README.md

File metadata and controls

104 lines (83 loc) · 4.11 KB

CARLA real traffic scenarios

readme-main

NGSIM freeway openDD roundabout
readme-ngsim readme-opendd

Features

  1. Handmade maps for CARLA that mimic real-world roads
  2. Code that transfers real-world traffic from datasets into CARLA
  3. Scenario API similar to OpenAI Gym

We've also trained and benchmarked policies on lane change maneuvers and roundabout navigation tasks.

More details, our article and videos of trained policies are published on our website.

Prerequisites

git clone https://github.com/deepsense-ai/carla-real-traffic-scenarios.git && cd carla-real-traffic-scenarios
pip install -r requirements.txt

If working on remote servers with no desktop, use gdown to download from Google Drive links, e.g.

pip install gdown
gdown --id 1FCHL7YJk12AwfxuMPmwXPJj71n3mwSxE

1. CARLA

Download and extract CARLA (0.9.9.4 download link). Then, add PythonAPI wheel to your PYTHONPATH:

cd ~/Downloads
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/CARLA_0.9.9.4.tar.gz

export CARLA_ROOT=/home/$USER/Downloads/CARLA_0.9.9.4
mkdir -p $CARLA_ROOT;
tar zxvf CARLA_0.9.9.4.tar.gz --directory $CARLA_ROOT

export PYTHONPATH=$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.9-py3.7-linux-x86_64.egg:$PYTHONPATH

2. Maps

Download and import our CARLA package with new maps: 7 roundabout, 2 freeways: Google Drive download link

mv ~/Downloads/carla-package-NGSIM-openDD.tar.gz $CARLA_ROOT/Import/
$CARLA_ROOT/ImportAssets.sh

3. Datasets

Download and extract: NGSIM, opendDD

sudo apt install p7zip-full

# no space after -o
7z x ~/Downloads/openDD.7z -oopenDD

mkdir NGSIM && tar zxvf ~/Downloads/NGSIM.tgz --strip-components 1 --directory NGSIM

Quickstart

Terminal I
cd $CARLA_ROOT
./CarlaUE4.sh -benchmark -fps=10
Terminal II

Wait until server boots up. Feel free to play with the code.

# Directory which contains "rdb1to7.sqlite" and "image_georeferenced/"
export OPENDD_DIR=~/Downloads/openDD

# Directory which contains "i80/" and "us101/"
export NGSIM_DIR=~/Downloads/NGSIM
python examples/runnable_template.py --dataset opendd --num-episodes 5

Feedback

We encourage you send us any kind of feedback on what should be improved, what's not working etc.

Credits

Code for interfacing with NGSIM dataset was based on https://github.com/Atcold/pytorch-PPUU

Authors (cannot be disclosed yet):