{"id":13436616,"url":"https://github.com/Alpaca-zip/ultralytics_ros","last_synced_at":"2025-03-18T21:30:45.434Z","repository":{"id":170206034,"uuid":"646208578","full_name":"Alpaca-zip/ultralytics_ros","owner":"Alpaca-zip","description":"ROS/ROS 2 package for Ultralytics YOLOv8 real-time object detection and segmentation. https://github.com/ultralytics/ultralytics","archived":false,"fork":false,"pushed_at":"2024-06-25T11:28:10.000Z","size":210,"stargazers_count":195,"open_issues_count":17,"forks_count":38,"subscribers_count":2,"default_branch":"humble-devel","last_synced_at":"2024-10-27T20:20:22.258Z","etag":null,"topics":["object-detection","object-segmentation","ros","ros2","ultralytics","yolo","yolov3","yolov5","yolov8"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alpaca-zip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-27T16:27:22.000Z","updated_at":"2024-10-22T16:45:25.000Z","dependencies_parsed_at":"2024-02-13T08:28:16.927Z","dependency_job_id":"7527a291-8d50-4e12-9743-a533dd78da18","html_url":"https://github.com/Alpaca-zip/ultralytics_ros","commit_stats":null,"previous_names":["alpaca-zip/ultralytics_ros"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alpaca-zip%2Fultralytics_ros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alpaca-zip%2Fultralytics_ros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alpaca-zip%2Fultralytics_ros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alpaca-zip%2Fultralytics_ros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alpaca-zip","download_url":"https://codeload.github.com/Alpaca-zip/ultralytics_ros/tar.gz/refs/heads/humble-devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244310357,"owners_count":20432522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["object-detection","object-segmentation","ros","ros2","ultralytics","yolo","yolov3","yolov5","yolov8"],"created_at":"2024-07-31T03:00:50.730Z","updated_at":"2025-03-18T21:30:42.715Z","avatar_url":"https://github.com/Alpaca-zip.png","language":"C++","funding_links":[],"categories":["C++","Other Versions of YOLO"],"sub_categories":[],"readme":"# ultralytics_ros\n### Introduction\nROS/ROS 2 package for real-time object detection and segmentation using the Ultralytics YOLO, enabling flexible integration with various robotics applications.\n\n|  `tracker_node`  |  `tracker_with_cloud_node`  |\n| :------------: | :-----------------------: |\n| \u003cimg src=\"https://github.com/Alpaca-zip/ultralytics_ros/assets/84959376/7ccefee5-1bf9-48de-97e0-a61000bba822\" width=\"450px\"\u003e | \u003cimg src=\"https://github.com/Alpaca-zip/ultralytics_ros/assets/84959376/674f352f-5171-4fcf-beb5-394aa3dfe320\" height=\"160px\"\u003e |\n\n- The `tracker_node` provides real-time object detection on incoming ROS/ROS 2 image messages using the Ultralytics YOLO model.\n- The `tracker_with_cloud_node` provides functionality for 3D object detection by integrating 2D detections, mask image, LiDAR data, and camera information.\n\n### Status\n| ROS distro | Industrial CI | Docker |\n| :--------: | :-----------: | :----: |\n|  ROS Melodic | [![ROS-melodic Industrial CI](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/melodic-ci.yml/badge.svg)](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/melodic-ci.yml) | [![ROS-melodic Docker Build Check](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/melodic-docker-build-check.yml/badge.svg)](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/melodic-docker-build-check.yml)\n|  ROS Noetic | [![ROS-noetic Industrial CI](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/noetic-ci.yml/badge.svg)](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/noetic-ci.yml) | [![ROS-noetic Docker Build Check](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/noetic-docker-build-check.yml/badge.svg)](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/noetic-docker-build-check.yml)\n|  ROS 2 Humble | [![ROS2-humble Industrial CI](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/humble-ci.yml/badge.svg)](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/humble-ci.yml) | [![ROS2-humble Docker Build Check](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/humble-docker-build-check.yml/badge.svg)](https://github.com/Alpaca-zip/ultralytics_ros/actions/workflows/humble-docker-build-check.yml)\n\n## Setup ⚙\n### ROS Melodic\n```bash\n$ cd ~/{ROS_WORKSPACE}/src\n$ GIT_LFS_SKIP_SMUDGE=1 git clone -b melodic-devel https://github.com/Alpaca-zip/ultralytics_ros.git\n$ rosdep install -r -y -i --from-paths .\n$ pip install pipenv\n$ cd ultralytics_ros\n$ pipenv install\n$ pipenv shell\n$ cd ~/{ROS_WORKSPACE} \u0026\u0026 catkin build\n```\n### ROS Noetic\n```bash\n$ cd ~/{ROS_WORKSPACE}/src\n$ GIT_LFS_SKIP_SMUDGE=1 git clone -b noetic-devel https://github.com/Alpaca-zip/ultralytics_ros.git\n$ rosdep install -r -y -i --from-paths .\n$ python3 -m pip install -r ultralytics_ros/requirements.txt\n$ cd ~/{ROS_WORKSPACE} \u0026\u0026 catkin build\n```\n### ROS 2 Humble\n```bash\n$ cd ~/{ROS2_WORKSPACE}/src\n$ GIT_LFS_SKIP_SMUDGE=1 git clone -b humble-devel https://github.com/Alpaca-zip/ultralytics_ros.git\n$ rosdep install -r -y -i --from-paths .\n$ python3 -m pip install -r ultralytics_ros/requirements.txt\n$ cd ~/{ROS2_WORKSPACE} \u0026\u0026 $ colcon build\n```\n**NOTE**: If you want to download KITTI datasets, remove `GIT_LFS_SKIP_SMUDGE=1` from the command line.\n\n## Run 🚀\n### ROS Melodic \u0026 ROS Noetic\n**`tracker_node`**\n```bash\n$ roslaunch ultralytics_ros tracker.launch debug:=true\n```\n**`tracker_node` \u0026 `tracker_with_cloud_node`**\n```bash\n$ roslaunch ultralytics_ros tracker_with_cloud.launch debug:=true\n```\n### ROS 2 Humble\n**`tracker_node`**\n```bash\n$ ros2 launch ultralytics_ros tracker.launch.xml debug:=true\n```\n**`tracker_node` \u0026 `tracker_with_cloud_node`**\n```bash\n$ ros2 launch ultralytics_ros tracker_with_cloud.launch.xml debug:=true\n```\n**NOTE**: If the 3D bounding box is not displayed correctly, please consider using a lighter yolo model(`yolov8n.pt`) or increasing the `voxel_leaf_size`.\n\n## `tracker_node`\n### Params\n- `yolo_model`: Pre-trained Weights.  \nFor yolov8, you can choose `yolov8*.pt`, `yolov8*-seg.pt`.\n\n  |  YOLOv8  |  \u003cimg src=\"https://github.com/Alpaca-zip/ultralytics_ros/assets/84959376/08770080-bf20-470b-8269-eee7a7c41acc\" width=\"350px\"\u003e  |\n  | :-------------: | :-------------: |\n  |  **YOLOv8-seg**  |  \u003cimg src=\"https://github.com/Alpaca-zip/ultralytics_ros/assets/84959376/7bb6650c-769d-41c1-86f7-39fcbf01bc7c\" width=\"350px\"\u003e  |\n  \n  See also: https://docs.ultralytics.com/models/\n- `input_topic`: Topic name for input image.\n- `result_topic`: Topic name of the custom message containing the 2D bounding box and the mask image.\n- `result_image_topic`: Topic name of the image on which the detection and segmentation results are plotted.\n- `conf_thres`: Confidence threshold below which boxes will be filtered out.\n- `iou_thres`: IoU threshold below which boxes will be filtered out during NMS.\n- `max_det`: Maximum number of boxes to keep after NMS.\n- `tracker`: Tracking algorithms.\n- `device`: Device to run the model on(e.g. cpu or cuda:0).\n  ```xml\n  \u003carg name=\"device\" default=\"cpu\"/\u003e\n  ```\n  ```xml\n  \u003carg name=\"device\" default=\"cuda:0\"/\u003e\n  ```\n- `classes`: List of class indices to consider.\n  ```xml\n  \u003cparam name=\"classes\" value=\"0, 1\" value-sep=\", \"/\u003e \u003c!-- person, bicycle --\u003e\n  ```\n  See also: https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco128.yaml \n- `result_conf`:  Whether to plot the detection confidence score.\n- `result_line_width`: Line width of the bounding boxes.\n- `result_font_size`: Font size of the text.\n- `result_labels`: Font to use for the text.\n- `result_font`: Whether to plot the label of bounding boxes.\n- `result_boxes`: Whether to plot the bounding boxes.\n### Topics\n- Subscribed Topics:\n  - Image data from `input_topic` parameter. ([sensor_msgs/Image](https://github.com/ros2/common_interfaces/blob/humble/sensor_msgs/msg/Image.msg))\n- Published Topics:\n  - Plotted images to `result_image_topic` parameter. ([sensor_msgs/Image](https://github.com/ros2/common_interfaces/blob/humble/sensor_msgs/msg/Image.msg))\n  - Detected objects(2D bounding box, mask image) to `result_topic` parameter. (ultralytics_ros/YoloResult)\n    ```\n    std_msgs/Header header\n    vision_msgs/Detection2DArray detections\n    sensor_msgs/Image[] masks\n    ```\n\n## `tracker_with_cloud_node`\n### Params\n- `camera_info_topic`: Topic name for camera info.\n- `lidar_topic`: Topic name for lidar.\n- `yolo_result_topic`: Topic name of the custom message containing the 2D bounding box and the mask image.\n- `yolo_3d_result_topic`: Topic name for 3D bounding box.\n- `cluster_tolerance`: Spatial cluster tolerance as a measure in the L2 Euclidean space.\n- `voxel_leaf_size`: Voxel size for pointcloud downsampling.\n- `min_cluster_size`: Minimum number of points that a cluster needs to contain.\n- `max_cluster_size`: Maximum number of points that a cluster needs to contain.\n### Topics\n- Subscribed Topics:\n  - Camera info from `camera_info_topic` parameter. ([sensor_msgs/CameraInfo](https://docs.ros.org/en/api/sensor_msgs/html/msg/CameraInfo.html))\n  - Lidar data from `lidar_topic` parameter. ([sensor_msgs/PointCloud2](https://docs.ros.org/en/api/sensor_msgs/html/msg/PointCloud2.html))\n  - Detected objects(2D bounding box, mask image) from `yolo_result_topic` parameter. (ultralytics_ros/YoloResult)\n    ```\n    std_msgs/Header header\n    vision_msgs/Detection2DArray detections\n    sensor_msgs/Image[] masks\n    ```\n- Published Topics:\n  - Detected cloud points to `/detection_cloud` topic. ([sensor_msgs/PointCloud2](https://docs.ros.org/en/api/sensor_msgs/html/msg/PointCloud2.html))\n  - Detected objects(3D bounding box) to `yolo_3d_result_topic` parameter. ([vision_msgs/Detection3DArray](http://docs.ros.org/en/lunar/api/vision_msgs/html/msg/Detection3DArray.html))\n  - Visualization markers to `/detection_marker` topic. ([visualization_msgs/MarkerArray](https://docs.ros.org/en/api/visualization_msgs/html/msg/MarkerArray.html))\n\n## Docker with KITTI datasets 🐳\n[![dockeri.co](https://dockerico.blankenship.io/image/alpacazip/ultralytics_ros)](https://hub.docker.com/r/alpacazip/ultralytics_ros)\n\n### Docker Pull \u0026 Run\n**ROS Melodic**\n```bash\n$ docker pull alpacazip/ultralytics_ros:melodic\n$ docker run -p 6080:80 --shm-size=512m alpacazip/ultralytics_ros:melodic\n```\n**ROS Noetic**\n```bash\n$ docker pull alpacazip/ultralytics_ros:noetic\n$ docker run -p 6080:80 --shm-size=512m alpacazip/ultralytics_ros:noetic\n```\n**ROS 2 Humble**\n```bash\n$ docker pull alpacazip/ultralytics_ros:humble\n$ docker run -p 6080:80 --shm-size=512m alpacazip/ultralytics_ros:humble\n```\n### Run tracker_node \u0026 tracker_with_cloud_node\n**ROS Melodic**\n```bash\n$ roscd ultralytics_ros \u0026\u0026 pipenv shell\n$ roslaunch ultralytics_ros kitti_predict_with_cloud.launch\n$ cd ~/catkin_ws/src/ultralytics_ros/rosbag \u0026\u0026 rosbag play kitti_2011_09_26_drive_0106_synced.bag --clock --loop\n```\n**ROS Noetic**\n```bash\n$ roslaunch ultralytics_ros kitti_tracker_with_cloud.launch\n$ cd ~/catkin_ws/src/ultralytics_ros/rosbag \u0026\u0026 rosbag play kitti_2011_09_26_drive_0106_synced.bag --clock --loop\n```\n**ROS 2 Humble**\n```bash\n$ ros2 launch ultralytics_ros kitti_tracker_with_cloud.launch.xml\n$ cd ~/colcon_ws/src/ultralytics_ros/ros2bag \u0026\u0026 ros2 bag play kitti_2011_09_26_drive_0106_synced --clock --loop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlpaca-zip%2Fultralytics_ros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlpaca-zip%2Fultralytics_ros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlpaca-zip%2Fultralytics_ros/lists"}