/self-driving-carla

Using Lane Detection for Self Driving in CARLA

Primary LanguagePython

Self-driving Carla

🤖 CS106.L22.KHCL - Trí tuệ nhân tạo 🤖

Trần Minh Tiến - 18521492

Nguyễn Hữu Doanh - 18520606

Nguyễn Xuân Đỉnh - 18520603


Introduction:

Carla self-driving based on lane detection. We use model DeeplabV3+MobileNetV2 in either pytorch model or openvino model

*This code is test on Window10, with 4GB GPU Nvidia GTX-1050 and Ubuntu 22.04, with 4GB GPU Nvidia GTX-1060!!!

System requirements:

  • x64 system
  • 165 GB disk space
  • at least 6 GB GPU (8 GB is recommended)
  • Two TCP port (2000 and 2001)
  • Python version 3.7
  • Carla version 0.9.10

GPU Pytorch Enable:

Window setup

C:\> SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin;%PATH%
C:\> SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\extras\CUPTI\lib64;%PATH%
C:\> SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include;%PATH%
C:\> SET PATH=C:\tools\cuda\bin;%PATH%

Carla Window setup:

  1. <path-to-python-3.7>\Lib\site-packages
  2. Create file: "carla.pth"
  3. Inside carla.pth write this:
<path-to-carla>\PythonAPI\carla\dist\carla-0.9.10-py3.7-win-amd64.egg

Carla Ubuntu Setub:

$ export PYTHONPATH=$PYTHONPATH:<path-to-working-directory/Carla/PythonAPI/carla/dist/carla-0.9.13-py3.7-linux-x86_64.egg
# If the newest OpenCV get error when running code, you should run this
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6

Usage:

  1. Enter the CARLA simulator folder and run:
$ ./CarlaUE4.exe
  1. Enter the root of this repo and run:

If you use one version python:

$ python carla_sim.py

With specify argument:

$ python carla_sim.py --fps=30 --mapid=4 --model openvino

Result:

Link youtube: https://www.youtube.com/watch?v=5EexRdqtiHM&list=PLc0OzM-aFT-SIF2rkJ2lLJwLAC5tLIsLm&index=1

Demo with high resolution

demo_normal

Demo with rainning:

demo_rain

Demo with night:

demo_night

List of map: [3,4,5] is completed

map_img

References:

[1] https://github.com/thomasfermi/Algorithms-for-Automated-Driving