YOLOV8_ROS2

This repository contains the implementation of YOLOv8 integrated with ROS 2 (Robot Operating System 2) for real-time object detection. YOLOv8 is the version of the “You Only Look Once” (YOLO) family of models, designed for efficient and accurate object detection.

Features

Requirements

To run this project, you need to have the following installed:

Installation

  1. Clone this repository to your local machine:

     git clone https://github.com/enginksz/YOLOV8_ROS2.git
     cd yolov8_ros2
    
  2. Install dependencies:

     pip install ultralytics
     sudo apt install gazebo
     sudo apt install python3-colcon-common-extensions
     sudo apt install ros-foxy-gazebo-ros
    
  3. Ensure that ROS 2 is properly installed and sourced on your machine.

Running YOLOv8 with ROS 2

  1. Colcon build:

     cd yolov8_ros2
     colcon build
     source yolov8_ros2/install/setup.bash
    
  2. Launch ROS 2 nodes:

     ros2 launch yolov8_gazebo yolov8_ros2_launch.py
    

    Open a second terminal for recognition:

     ros2 launch yolov8_ros2_recognition launch_yolov8.launch.py
    
  3. Start detection by publishing images to the corresponding ROS 2 topic.

Usage

ROS 2 Topics

Contributing

Feel free to submit issues, create pull requests, or fork this repository to improve and extend the project.