Skip to content

zbzhu99/NGSIM_Imitation

Repository files navigation

Generative Adversarial Imitation Learning on NGSIM I-80 Dataset

Maintainability Code style MIT

This repository contains three components: an improved version of ILSwiss, which is an RL training suite containing the implementation of Generative Adversarial Imitation Learning (GAIL), and two environments. The two environments both are driving simulators that use NGSIM I-80 dataset as background traffic. One of them is PPUU, the other is implemented as an imitation learning scenario based on SMARTS platform.

How to setup:

  1. Clone this repository

  2. Install python requirements with

pip install -r requirements.txt

Setup SMARTS

  1. Download the SMARTS platform as a submodule with

    git submodule init
    git submodule update
  2. Install SMARTS simulation platform in the ./SMARTS folder following its instructions

    cd ./SMARTS
    bash ./utils/setup/install_deps.sh
    echo "export SUMO_HOME=/usr/share/sumo" >> ~/.bashrc
    pip install -e .[camera-obs]
  3. Download the NGSIM dataset from: https://drive.google.com/file/d/1SILBfK2Z1LiTJ9cc4qGErq547Ax5nX8M/view?usp=share_link, and place it under smarts-imitation/

  4. Install the ngsim wrapper for smarts with

    pip install -e ./smarts-imitation
    # You may encounter the ModuleNotFoundError when running this command,
    # which is okay. Please just wait until it terminates.
    scl scenario build --clean ./smarts-imitation/ngsim
  5. Generate structured expert demonstrations with

    cd ILSwiss
    python run_experiment.py -e exp_specs/gen_expert/smarts.yaml
  6. Run GAIL with

    python run_experiment.py -e exp_specs/gail/gail_smarts.yaml

Setup PPUU

  1. Make sure you have downloaded the NGSIM dataset and placed it under smarts-imitation. Create a link to the dataset under PPUU folder:

    mkdir pytorch-PPUU/traffic-data
    ln -s $(pwd)/smarts-imitation/xy-trajectories pytorch-PPUU/traffic-data/

    Process the traffic data to dump the "state, action, cost" triple:

    cd pytorch-PPUU
    for t in 0 1 2; do python generate_trajectories.py -map i80 -time_slot $t; done
  2. Generate structured expert demonstrations with

    python run_experiment.py -e exp_specs/gen_expert/ppuu.yaml
  3. Run GAIL with

python run_experiment.py -e exp_specs/gail/gail_pppu.yaml

About

Generative adversarial imitation learning on NGSIM I-80 Dataset.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages