This project is developed to simulate and implement advanced driver-assistance systems (ADAS) using Webots and ROS 2. Currently, our primary focus is on Adaptive Cruise Control (ACC) aiming to enhance vehicle safety and autonomy.
-
Adaptive Cruise Control (ACC): Maintains a safe distance from the vehicle ahead by adjusting the vehicle's speed.
-
Integration with Webots: Utilizes the Webots open-source 3D simulator for accurate vehicle dynamics and environment simulation.
-
ROS 2 Compatibility: Leverages the Robot Operating System (ROS) 2 framework for modularity and scalability.
ADAS
├── Grad_ws # Ros2 workspace
├── WBs # Webots environment
├── LICENSE
├── README.md
└── requirements.txt # Contains required python dependencies
Important
The installation steps below have been tested only on Ubuntu 22.04 and Windows 11 with WSL2.
They may also work on Windows 10, provided your OS Build is 19041 or higher to support WSL2.
If you're using a different OS or environment, you may need to adapt the steps accordingly.
For Ubuntu 22.04
- There's no steps in this section, you can continue to the next step.
For Windows 10/11
-
Install Webots R2025a for windows from here
-
Run this command in PowerShell as Administrator:
wsl --install -d Ubuntu-22.04
-
After completing the WSL2 installation and finishing the user setup. Follow the next steps from your WSL2 terminal session.
- Webots: Install version R2025a using apt from this guide.
[!NOTE]
For Windows 10/11 users: You may notice that Webots is installed both on Windows and within WSL.
This is intentional - both installations are required for proper functionality. - ROS 2: Follow the ROS 2 Humble installation guide.
- webots_ros2: Used to provides an interface between ROS 2 and Webots. Install from here.
- Python3.10: Use your preferred installation method, or follow this tutorial.
-
Clone the Repository:
git clone git@github.com:MoradSayed/Advanced-Driver-Assistance-Systems.git cd Advanced-Driver-Assistance-Systems/ -
Install required python packages:
pip3.10 install -r requirements.txt
-
Add Environment Variable Exports to Your Shell Configuration
Run the following command to add the necessary environment variable exports to your shell configuration file (e.g.,
~/.bashrc,~/.zshrc, etc.), depending on your operating system:For Ubuntu 22.04
cat << EOF >> ~/.bashrc # ADAS repo related environment variables export WEBOTS_HOME=/usr/local/webots export PYTHONPATH=\$PYTHONPATH:\$WEBOTS_HOME/lib/controller/python export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$WEBOTS_HOME/lib/controller export WEBOTS_PROTOCOL=ipc export GP_WS_DIR=$(pwd) EOF
After running the above command, apply the changes by running:
source ~/.bashrc
For Windows 10/11 (Using WSL2)
cat << EOF >> ~/.bashrc # ADAS repo related environment variables export WEBOTS_HOME=/usr/local/webots export PYTHONPATH=\$PYTHONPATH:\$WEBOTS_HOME/lib/controller/python export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$WEBOTS_HOME/lib/controller export WINDOWS_IP=$(ip route | grep default | awk '{print $3}') export WEBOTS_PROTOCOL=tcp export GP_WS_DIR=$(pwd) EOF
Apply the changes by running:
source ~/.bashrc
-
Follow Webots World Instructions.
-
Follow ROS2 WorkSpace Instructions.
This project is licensed under the BSD 3-Clause License.