Skip to content

Controls Course Project: Implementing PID (Stanley Control for Lateral Control) and Model Predictive Controller in Carla Simulator. The backbon code interfacing with the Carla was used from the Coursera: Introduction to Self-Driving Cars Course.

Notifications You must be signed in to change notification settings

sapan-ostic/Carla-Controllers

Repository files navigation

Carla-Controllers

Controls Course Project: Implementing PID (Stanley Control for Lateral Control) and Model Predictive Controller in Carla Simulator. The backbon code interfacing with the Carla was used from the Coursera: Introduction to Self-Driving Cars Course.

Coursera Evaluator scores:

Model Predictive Controller PID Controller
100% Waypoints tracked 87.25% waypoints tracked

Installation

  1. Install Carla: Download here

  2. Download Course1FinalProject.zip into CarlaSimulator folder Download here.

  3. Install casadi: pip install casadi

  4. Install Ipopt:

wget http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.4.tgz
tar xvzf Ipopt-3.12.4.tgz

cd Ipopt-3.12.4/ThirdParty/Blas
./get.Blas
cd ../Lapack
./get.Lapack
cd ../Mumps
./get.Mumps
cd ../Metis
./get.Metis
cd ../../                        #Go back to the IPOPT base dir
  1. Download HSL: Get Lisensce from here

  2. Unpack HSL in Ipopt

cd ~/Ipopt-3.12.4/ThirdParty/HSL
tar xvzf coinhsl-2014.01.10.tar.gz
mv coinhsl-2014.01.10 coinhsl
  1. Compile HSL
cd coinhsl-2014.01.10
./configure LIBS="-llapack" --with-blas="-L/usr/lib -lblas" CXXFLAGS="-g -O2 -fopenmp" FCFLAGS="-g -O2 -fopenmp" CFLAGS="-g -O2 -fopenmp"
make -j 4
make install
ln -s /usr/local/lib/libcoinhsl.so /usr/local/lib/libhsl.so
echo  'export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc 
  1. Compile Ipopt:
cd ~/Ipopt-3.12.4/
mkdir build
cd build
../configure
make -j 4                        #Compile using 4 cores (if you have them)
make install

Run Instructions

cd CarlaSimulator
./CarlaUE4.sh /Game/Maps/RaceTrack -windowed -carla-server -benchmark -fps=30

In new terminal run,

cd CarlaSimulator/PythonClient/Course1FinalProject
python3 module_7.py -c MPC

Run python3 module_7.py -h for more options.

About

Controls Course Project: Implementing PID (Stanley Control for Lateral Control) and Model Predictive Controller in Carla Simulator. The backbon code interfacing with the Carla was used from the Coursera: Introduction to Self-Driving Cars Course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages