Code for a multiple cooperative-mpc for multiple vehicles (esp. ambulance)
Video: https://www.youtube.com/watch?v=iwibkEfj8CI
The main code being developed is:
- src/
- python_experiments/
- jupyter_notebooks/ -- these are the scripts for obtaining the results
The main script for running iterative best response is: python_experiments/iterative_best_response.py
The main classes are located in src/ with brief description bellow:
- src/vehicle.py : Vehicle() contains dynamics, dimensions, vehicle-specific costs
- src/traffic_world.py: TrafficWorld() contains road and lane dimensions
- src/multiagent_mpc.py : MultiMPC: Optimization class which uses CASADI to create an optimization for a single vehicle planning with other vehicles on road
- src/car_plotting.py: scripts for plotting and animating vehicle trajectories
Dependents:
- Scipy
- Numpy
- Matplotlib
- Casadi 3.51
Installation: conda install -c conda-forge/label/cf202003 casadi conda install matplotlib conda install scipy
If you use the code, please cite the paper: N. Buckman, W. Schwarting, S. Karaman and D. Rus, "Semi-Cooperative Control for Autonomous Emergency Vehicles," 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2021, pp. 7052-7059, doi: 10.1109/IROS51168.2021.9636849.
The main settings that can be changed:
- MPC Time Horizon (T), % of ctrl pts executed, time discretization (dt)
- Iterative Best Response: # rounds of IBR, allowed amount of slack
- Vehicle Preferences: SVO wrt ambulance, collision costs,
Notes on installing on Supercloud:
- curl -sL "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" > "Miniconda3.sh"
- bash Miniconda3.sh
- source ~/.bashrc
- git clone https://github.com/noambuckman/mpc-multiple-vehicles.git
- conda env create -f env.yml
- conda activate mpc
- python iterative response
- mv results to /afs/csail.mit.edu/u/n/nbuckman/mpc_results_afs/