This guide explains how to install and configure the Hexapod Project on:
- PC (Laptop / Desktop)
- Raspberry Pi
- Arduino Mega
- Laptop: ASUS TUF Gaming F15 (NVIDIA RTX 3060) — Ubuntu 24.04 LTS
- Raspberry Pi: Raspberry Pi 4 (4 GB RAM) — Ubuntu 24.04 LTS
- Smartphone: Google Pixel 7 (used as camera and navigation sensors)
- Microcontroller: Arduino Mega
To use YOLO-based vision with good performance, a dedicated GPU is strongly recommended.
- If you have a GPU → real-time object detection is achievable.
- If you do not have a GPU → the package will still work, but with limited performance.
- Ubuntu 22.04: ROS2 Humble
- Ubuntu 24.04: ROS2 Rolling or ROS2 Jazzy (Recommended)
sudo apt install python3-colcon-common-extensionsecho "source /opt/ros/rolling/setup.bash" >> ~/.bashrc
echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrcOBS: Change rolling with your ROS2 distribution (humble, jazzy, etc.)
sudo apt-get install ros-rolling-gazebo-ros-pkgsOBS: Change rolling with your ROS2 distribution (humble, iron, etc.)
wget https://iriun.gitlab.io/iriunwebcam-2.9.deb
sudo apt install ./iriunwebcam-2.9.deb
sudo apt --fix-broken installnvidia-smiOBS: If you have a GPU, you should see something like this:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.79.02 Driver Version: 510.79.02 CUDA Version: 11.6 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
...
+-----------------------------------------------------------------------------+If you don't see you can try to intall drivers by ubuntu autodetect system
sudo apt update
sudo apt install ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
sudo rebootpython3 -m venv ~/.venvs/yolo
source ~/.venvs/yolo/bin/activateOBS: To use python environment always open an external terminal and activate the environment separatly of the terminal where you are going to run the main code.
pip install torch torchvision torchaudio
pip install ultralytics
pip install opencv-pythonsudo apt install python3-opencvmkdir -p ~/ros2_hex_tutorial_ws/src
cd ~/ros2_ws/srcgit clone https://github.com/carlobeni/hexapod_pkg.gitcd ~/ros2_hex_tutorial_ws
colcon build --symlink-installecho "source ~/ros2_hex_tutorial_ws/install/setup.bash" >> ~/.bashrc- Ubuntu 22.04: ROS2 Humble
- Ubuntu 24.04: ROS2 Rolling or ROS2 Jazzy (Recommended)
sudo apt install python3-colcon-common-extensionsecho "source /opt/ros/rolling/setup.bash" >> ~/.bashrc
echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrcOBS: Change rolling with your ROS2 distribution (humble, jazzy, etc.)
sudo apt update
sudo apt install python3-smbus
sudo apt install python3-smbus2
sudo apt install python3-rpi.gpio
sudo apt install python3-serial
sudo apt install python3-opencvmkdir -p ~/ros2_hex_tutorial_ws/src
cd ~/ros2_ws/srcgit clone https://github.com/carlobeni/hexapod_pkg.gitcd ~/ros2_hex_tutorial_ws
colcon build --symlink-installecho "source ~/ros2_hex_tutorial_ws/install/setup.bash" >> ~/.bashrcLoad by Arduino IDE the sketch hexapod_pkg/arduino/Hexapod2.ino
