![]() |
ros2_deepstream repositoryeloquent real-time deep-learning robotics deepstream jetson ros2 multi_stream_pkg single_stream_pkg subscriber_pkg |
Repository Summary
Description | ROS 2 package for NVIDIA DeepStream applications on Jetson Platforms |
Checkout URI | https://github.com/nvidia-ai-iot/ros2_deepstream.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2024-06-27 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | eloquent real-time deep-learning robotics deepstream jetson ros2 |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
multi_stream_pkg | 0.0.0 |
single_stream_pkg | 0.0.0 |
subscriber_pkg | 0.0.0 |
README
——————————————————
This sample application is no longer maintained
——————————————————
DeepStream_ROS2
ROS2 nodes for DeepStream applications.
This work is based on sample applications from the DeepStream Python Apps project. The packages have been tested on NVIDIA Jetson AGX Xavier with Ubuntu 18.04, ROS Eloquent, DeepStream SDK 5.0 (or later) and TensorRT. The project accesses some files in the DeepStream 5.0 root location (/opt/nvidia/deepstream/deepstream/samples/).
This project includes ROS2 publisher nodes which take a single/multiple video streams as input from webcam or from file:
- single_stream node: This performs 2 inference tasks on a single video input:
- Object Detection: Detects 4 classes of objects: Vehicle, Person, Road Sign, Two wheeler.
-
Output of this inference is published on topic ‘infer_detection’.
- Attribute Classification: For objects of class ‘Vehicle’, 3 categories of atrributes are identified: color, make and type.
- Output of this inference is published on topic ‘infer_classification’.
- multi_stream node: This takes multiple video files as input, performs the same inference tasks and publishes to topics multi_detection and multi_classification.
Sample ROS2 subscriber nodes have also been provided in subscriber_pkg, subscribing to the following topics:
Node | Topic |
---|---|
sub_detection | infer_detection |
sub_classification | infer_classification |
sub_multi_detection | multi_detection |
sub_multi_classification | multi_classification |
Prerequisites
Ubuntu 18.04
Python 3.6
DeepStream SDK 5.0 or later
NumPy
OpenCV
Gst Python v1.14.5 (should already be installed on Jetson)
If missing, install using following commands:
sudo apt update
sudo apt install python3-gi python3-dev python3-gst-1.0 -y
Running the ROS2 nodes
- Clone this repo into the src folder inside your ROS2 workspace (creating a ROS2 workspace) using the following command:
git clone https://github.com/NVIDIA-AI-IOT/ros2_deepstream.git
The directory structure should look like this:
.
+- dev_ws
+- src
+- ros2_deepstream
+- common
+- config_files
+- dstest1_pgie_config.txt (several other config files)
+- single_stream_pkg
+- multi_stream_pkg
+- subscriber_pkg
+- resource
+- subscriber_pkg
+- test
+- package.xml
+- setup.cfg
+- setup.py
- To build the package, navigate back to your workspace and run the following:
colcon build
- Source your main ROS 2 installation:
source /opt/ros/eloquent/setup.bash
- Then, to source your workspace, run the following command from your workspace:
. install/setup.bash
- To run the single_stream publisher node, run the following command by specifying the input_source. This command will take some time to start and print log messages to the console.
ros2 run single_stream_pkg single_stream --ros-args -p input_source:="/dev/video0"
This project has been tested using a Logitech C270 usb webcam to capture camera stream as input. H.264/H.265 video streams can also be given as input as shown later in this repo.
File truncated at 100 lines see the full file