micmarty / carla-real-traffic-scenarios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CARLA real traffic scenarios

I80 demo

TL;DR

  • Custom CARLA maps that mimic real-world roads and human driver behaviors from NGSim dataset (I80 and US101)
  • We've trained and benchmarked policies on real-world lane change maneuvers from NGSim dataset
  • We provide the source code for running NGSim-based scenarios in CARLA. Scenario interface is similar to openai gym interface

Prerequisites

  1. Download and extract CARLA (0.9.6 download link). Then, add PythonAPI wheel to your PYTHONPATH:
    export CARLA_ROOT=/path/to/your/carla/release-folder
    export PYTHONPATH=$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.6-py3.6-linux-x86_64.egg:$PYTHONPATH
  2. You also need to install our asset packages with two new CARLA maps
    • Download our archive: Google Drive download link
    • Move the archive to: $CARLA_ROOT/Import
    • Ingest into CARLA release: cd Import && ./ImportAssets.sh

Quickstart

Terminal I
./CarlaUE4.sh -benchmark -fps=10
Terminal II
# (wait until server loads)
python example/example_roundabout_scenario_usage.py
Terminal III
# (wait until scenario script connects successfully, map rendering may tak a while)
python example/manual_driving.py --res 900x500

Code tested with CARLA 0.9.6.

Real-traffic scenarios

  1. Download dataset: Google Drive download link
  2. Unpack: tar xf xy-trajectories.tgz
  3. Adjust data_dir in source code with your path to xy-trajectories
  • python example/example_scenario_usage.py - shows how to run scenario in training loop
  • python example/example_replay_ngsim_in_carla.py - shows how to replay NGSim dataset in CARLA. It was used to generated GIF in this README file

Credits

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

About

License:Other


Languages

Language:Python 100.0%Language:Makefile 0.0%