Git Product home page Git Product logo

nnmpc's Introduction

NNMPC

Intention-based NNMPC controller for CARLA simulator. NNMPC is a mathematical control framework based on Model Predictive Control (MPC) encompassing a state-of-the-art Recurrent Neural network (RNN) architecture. (SCRIPTS TO BE PUBLISHED)

demo

S. Bae, A. Nakhaei, C. Choi, D. Saxena, K. Fujimura, and S. Moura, Cooperation-Aware Lane Change Maneuver in Dense Traffic based on Model Predictive Control with Recurrent Neural Network, preprint.

@article{bae2019cooperation,
  title={Cooperation-Aware Lane Change Maneuver in Dense Traffic based on Model Predictive Control with Recurrent Neural Network},
  author={Bae, Sangjae and Saxena, Dhruv and Nakhaei, Alireza and Choi, Chiho and Fujimura, Kikuo and Moura, Scott},
  journal={arXiv preprint arXiv:1909.05665},
  year={2019}
}

Prerequisites

Setup

Create a virtual environment

conda create -n carla-env python=2.7
conda activate carla-env

Install carla-lane-change-setup

git clone https://github.com/honda-research-institute/carla-lane-change-setup.git
cd carla-lane-change-setup
pip install -r requirements.txt
./setup_workspace.sh
cd catkin_ws
catkin_make

Install dependencies of SGAN

pip install -r requirements.txt   # Install dependencies

Install rospy [ubuntu]

sudo apt-get update -y
sudo apt-get install -y python-rospy

Project structure

  • nnmpc_source: contains NNMPC files
    • nnmpc.py: MPC with SGAN
    • lane.py: Lane class
    • vehicle.py: Vehicle class
    • lane_keep_opt_planner.py: MPC-based smooth trajectory planner
    • path_optimizer.py: solve MPC for smooth trajectory
    • extended_kalman_filter.py: extended Kalman Filter
    • utils.py: helper functions
    • frenet_utils.py: helper functions for frenet coordinates
  • sgan_source: contains source code of SGAN and trained model
    • predictor.py: contains the Predictor class, which loads trained SGAN model
  • config.py: hyper parameters. Descriptions are found here
  • init_ros_node.py: run NNMPC as a ROS node

Run NNMPC with Carla + scenario runner

Step 1: Start Carla Simulator (carla documentation: http://carla.readthedocs.io/en/latest/).

source ~/.bashrc
conda activate carla-env
source ~/carla-lane-change-setup/catkin_ws/devel/setup.bash
sudo nvidia-docker run -p 2000-2001:2000-2001 -it --rm carlasim/carla:0.9.6 ./CarlaUE4.sh

Step 2: Launch ROS Bridge. In a new terminal

source ~/.bashrc
conda activate carla-env
source ~/carla-lane-change-setup/catkin_ws/devel/setup.bash
roslaunch demo_entrance carla_ros_bridge_with_ego_vehicle.launch

More information about the Carla ros bridge can be found on the Official Repo.

Step 3: Launch NNMPC. In a new terminal

source ~/.bashrc
conda activate carla-env
source ~/carla-lane-change-setup/catkin_ws/devel/setup.bash
python ~/NNMPC_CARLA/init_ros_node.py

Step 4: Start lane change scenario under scenario_runner to test your lane change algorithm.

use the following parameters: --dense: true or false (dense traffic vs spars traffice) --cooperative: true or false (more cooperative drivers vs less cooperative drivers) --repetitions: n

git clone [email protected]:honda-research-institute/scenario_runner.git
cd scenario_runner
source ~/.bashrc
conda activate carla-env
source ~/carla-lane-change-setup/catkin_ws/devel/setup.bash
python ~/scenario_runner/scenario_runner.py --scenario IntentionAwareLaneChange_3 --cooperative false --dense true --repetition 30 --waitForEgo

The above commands are tested with Carla version 0.9.6 with Python 2.7 kernel on Ubuntu 16.04.

Author

Developed by Sangjae Bae as part of his internship at Honda Research Institute, USA.

Acknowledgements

  • Supervisor: Alireza Nakhaei, David Isele
  • Collaborator: Peng Xu, Alexandre Miranda Anon, Kikuo Fujimura

nnmpc's People

Contributors

bsj1216 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.