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)
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}
}
- Python 2.7 anaconda
- Carla 0.9.6
- ROS Kinetic
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
nnmpc_source
: contains NNMPC filesnnmpc.py
: MPC with SGANlane.py
: Lane classvehicle.py
: Vehicle classlane_keep_opt_planner.py
: MPC-based smooth trajectory plannerpath_optimizer.py
: solve MPC for smooth trajectoryextended_kalman_filter.py
: extended Kalman Filterutils.py
: helper functionsfrenet_utils.py
: helper functions for frenet coordinates
sgan_source
: contains source code of SGAN and trained modelpredictor.py
: contains the Predictor class, which loads trained SGAN model
config.py
: hyper parameters. Descriptions are found hereinit_ros_node.py
: run NNMPC as a ROS node
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.
Developed by Sangjae Bae as part of his internship at Honda Research Institute, USA.
- Supervisor: Alireza Nakhaei, David Isele
- Collaborator: Peng Xu, Alexandre Miranda Anon, Kikuo Fujimura