yolo_detector is a ROS 2 package set for YOLO-based 2D object detection.
It contains:
yolo_interfaces/: YOLO-specific message definitionsyolo_detector/: Python node that runs YOLO and publishes detectionslaunch/: launch entry for the detector nodeconfig/: default runtime parameters
The current output is intentionally minimal and only keeps fields needed for pure YOLO 2D detection.
float32 center_x
float32 center_y
float32 size_x
float32 size_y- All values are pixel-space
xywh center_x,center_yare the box center in the imagesize_x,size_yare width and height
int32 class_id
string class_name
float32 scoreclass_id: model output class idclass_name: resolved class labelscore: confidence score
YoloHypothesis hypothesis
YoloBox bbox- One detected object
- Contains only category and bounding box
std_msgs/Header header
YoloDetection[] detections- One frame of detector output
header.stamp: detection timestampheader.frame_id: usually the source image frame
Default topics:
- input image:
/image_raw - detections:
/perception/detections - debug image:
/perception/debug/yolo_result
- Ubuntu 22.04
- ROS 2 Humble
- Python 3
- OpenCV /
cv_bridge
Use rosdep first:
cd ~/venom_ws
rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -yyolo_detector/package.xml declares:
cv_bridgesensor_msgsrclpyyolo_interfacespython3-ultralytics-pip
colcon build does not install Python dependencies by itself. It only builds the ROS workspace.
rosdep is the step that installs external dependencies declared in package.xml.
For this package, ultralytics is declared via the rosdep key:
python3-ultralytics-pip
According to the ROS dependency index, this key resolves to a pip install of ultralytics on Ubuntu/Debian.
That means:
- If
rosdepis installed and configured correctly,rosdep install ...should installultralytics - If
rosdepis not available in the environment, you need to install it manually
Manual fallback:
python3 -m pip install -U ultralyticscd ~/venom_ws
colcon build --packages-select yolo_interfaces yolo_detector
source install/setup.bashros2 launch yolo_detector yolo_detector.launch.py model_path:=/path/to/model.ptOr with defaults:
ros2 run yolo_detector yolo_node- The current format is only for YOLO-style 2D bounding-box output
- It does not include depth, pose, or tracker state
- If you later add depth or tracking, it is better to extend with a new message instead of polluting this minimal format