-
Build
yolo_msgsfrom yolo_ros. -
Install the required Python packages.
pip install -r requirements.txt- Note that
torch,torchvisionandonnxruntime-gpuare excluded fromrequirements.txtbecause the default versions are CPU-only.ultralyticsis excluded to not override existingtorchdependencies. Install them separately here.
For Nvidia Jetpack 6, see the Ultralytics guide. We have implemented this in a Dockerfile.
Run export.py to export trained .pt models to .engine files. For example,
python export.py yolov11s_gate_20250520_0.ptThen run yolo_node. For example:
ros2 run yolo_ros_trt yolo_node --ros-args -p model_path:="yolov11s_gate_20250520_0.engine"yolo_node is a lifecycle node that starts with the Inactive state. You can toggle the state to Active by
ros2 lifecycle set /yolo_node activateFor object detection using YOLOv8, see our fork of Isaac ROS Object Detection to utilize Nvidia's claim of higher efficiency due to zero copy.