{"id":29093254,"url":"https://github.com/nvidia-ai-iot/ros2_deepstream","last_synced_at":"2026-03-05T13:03:11.165Z","repository":{"id":62603207,"uuid":"312118791","full_name":"NVIDIA-AI-IOT/ros2_deepstream","owner":"NVIDIA-AI-IOT","description":"ROS 2 package for NVIDIA DeepStream applications on Jetson Platforms ","archived":false,"fork":false,"pushed_at":"2024-06-27T11:10:47.000Z","size":4403,"stargazers_count":92,"open_issues_count":7,"forks_count":16,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-06-28T08:07:54.830Z","etag":null,"topics":["deep-learning","deepstream","eloquent","jetson","real-time","robotics","ros2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NVIDIA-AI-IOT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-11T23:49:02.000Z","updated_at":"2025-05-28T13:32:33.000Z","dependencies_parsed_at":"2025-06-28T08:07:58.056Z","dependency_job_id":"419dd6db-f4b2-4011-8343-542f514e5529","html_url":"https://github.com/NVIDIA-AI-IOT/ros2_deepstream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NVIDIA-AI-IOT/ros2_deepstream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-AI-IOT%2Fros2_deepstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-AI-IOT%2Fros2_deepstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-AI-IOT%2Fros2_deepstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-AI-IOT%2Fros2_deepstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NVIDIA-AI-IOT","download_url":"https://codeload.github.com/NVIDIA-AI-IOT/ros2_deepstream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-AI-IOT%2Fros2_deepstream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30127218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deep-learning","deepstream","eloquent","jetson","real-time","robotics","ros2"],"created_at":"2025-06-28T08:07:43.688Z","updated_at":"2026-03-05T13:03:11.141Z","avatar_url":"https://github.com/NVIDIA-AI-IOT.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ------------------------------------------------------\n# This sample application is no longer maintained\n# ------------------------------------------------------\n\n# DeepStream_ROS2\n\nROS2 nodes for DeepStream applications.\n\n[NVIDIA Developer Blog](https://developer.nvidia.com/blog/implementing-robotics-applications-with-ros-2-and-ai-on-jetson-platform-2/)\n\nThis work is based on sample applications from the [DeepStream Python Apps](https://github.com/NVIDIA-AI-IOT/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/).\n\nThis project includes ROS2 publisher nodes which take a single/multiple video streams as input from webcam or from file:\n\n1. **single_stream** node: This performs 2 inference tasks on a single video input:\n\n- **Object Detection:** Detects 4 classes of objects: Vehicle, Person, Road Sign, Two wheeler.\n- Output of this inference is published on topic '**infer_detection**'.\n\n- **Attribute Classification:** For objects of class 'Vehicle', 3 categories of atrributes are identified: color, make and type.\n- Output of this inference is published on topic '**infer_classification**'.\n\n2. **multi_stream** node: This takes multiple video files as input, performs the same inference tasks and publishes to topics **multi_detection** and **multi_classification**. \n\nSample ROS2 subscriber nodes have also been provided in **subscriber_pkg**, subscribing to the following topics:\n\n| Node | Topic |\n| ------ | ------ |\n| sub_detection | infer_detection |\n| sub_classification | infer_classification |\n| sub_multi_detection | multi_detection |\n| sub_multi_classification | multi_classification |\n\n## Prerequisites\n\nUbuntu 18.04\n\nPython 3.6\n\n[DeepStream SDK 5.0](https://developer.nvidia.com/deepstream-getting-started) or later\n\nNumPy\n\nOpenCV\n\n[vision_msgs](https://github.com/Kukanani/vision_msgs/tree/ros2)\n\n[Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.14.5 (should already be installed on Jetson)\n\nIf missing, install using following commands:\n\n`sudo apt update`\n\n`sudo apt install python3-gi python3-dev python3-gst-1.0 -y`\n\n## Running the ROS2 nodes\n\n1. Clone this repo into the **src** folder inside your ROS2 workspace ([creating a ROS2 workspace](https://index.ros.org/doc/ros2/Tutorials/Workspace/Creating-A-Workspace/)) using the following command:\n\n`git clone https://github.com/NVIDIA-AI-IOT/ros2_deepstream.git`\n\nThe directory structure should look like this:\n\n```python\n.\n+- dev_ws\n   +- src\n      +- ros2_deepstream\n         +- common\n         +- config_files\n            +- dstest1_pgie_config.txt (several other config files)\n         +- single_stream_pkg\n         +- multi_stream_pkg\n         +- subscriber_pkg\n            +- resource\n            +- subscriber_pkg\n            +- test\n            +- package.xml\n            +- setup.cfg\n            +- setup.py     \n```\n\n2. To build the package, navigate back to your workspace and run the following:\n\n`colcon build`\n\n3. Source your main ROS 2 installation:\n\n`source /opt/ros/eloquent/setup.bash`\n\n4. Then, to source your workspace, run the following command from your workspace:\n\n`. install/setup.bash`\n\n5. 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.\n\n`ros2 run single_stream_pkg single_stream --ros-args -p input_source:=\"/dev/video0\"`\n\nThis 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.\n\n6. To run the subscribers, open separate terminals, navigate to your ros workspace and repeat step 4 in each. \n\n**sub_detection** subscribes to output from detection inference.\n\n`ros2 run subscriber_pkg sub_detection`\n\n**sub_classification** subscribes to output from classification inference.\n\n`ros2 run subscriber_pkg sub_classification`\n\nTo understand the application workflow better:\n\n![alt text](images/DS_publisher.PNG \"publisher\")\n\nThe pipeline uses a GStreamer **tee** element to branch out and perform different tasks after taking video input. In this example, we perform only two tasks but more tasks can be added to the pipeline easily.\n\nAn example output:\n\n![alt text](images/blue_bmw_sedan.png \"sample output\")\n\nMessage received by the node subscribing to topic **infer_detection**: \n\n```\n[vision_msgs.msg.Detection2D(header=std_msgs.msg.Header(stamp=builtin_interfaces.msg.Time(sec=0, nanosec=0), frame_id=''), results=[vision_msgs.msg.ObjectHypothesisWithPose(id='Car', score=0.4975374639034271, pose=geometry_msgs.msg.PoseWithCovariance(pose=geometry_msgs.msg.Pose(position=geometry_msgs.msg.Point(x=0.0, y=0.0, z=0.0), orientation=geometry_msgs.msg.Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), covariance=array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n       0., 0.])))], bbox=vision_msgs.msg.BoundingBox2D(center=geometry_msgs.msg.Pose2D(x=733.5, y=70.3125, theta=0.0), size_x=627.0, size_y=303.75), source_img=sensor_msgs.msg.Image(header=std_msgs.msg.Header(stamp=builtin_interfaces.msg.Time(sec=0, nanosec=0), frame_id=''), height=0, width=0, encoding='', is_bigendian=0, step=0, data=[]), is_tracking=False, tracking_id='')]\n```\n\nThe **infer_detection** topic publishes messages in the `vision_msgs` Detection2DArray type.\n\nMessage received by the node subscribing to topic **infer_classification**: \n\n`[vision_msgs.msg.ObjectHypothesis(id='blue', score=0.9575958847999573), vision_msgs.msg.ObjectHypothesis(id='bmw', score=0.6080179214477539), vision_msgs.msg.ObjectHypothesis(id='sedan', score=0.8021238446235657)]`\n\nThe **infer_classification** topic publishes messages in the `vision_msgs` Classification2D type. These messages contain information about the color, make and type of detected cars alongwith their confidence scores.\n\n## Multi input publisher node\n\nFor applications that take videos from multiple input sources, we have provided node **multi_stream**. This takes multiple H.264/H.265 video streams as input and performs inference (detection and classification). Output is published on topics **multi_detection** and **multi_classification** in Detection2DArray and Classification2D types respectively. \n\nRun the multi_stream publisher using the following command (check that workspace is sourced by following steps 3 and 4 above). This command will take some time to start and print log messages to the console.\n\n`ros2 run multi_stream_pkg multi_stream --ros-args -p input_sources:=\"['file://\u003cabsolute path to file1.mp4\u003e', 'file://\u003cabsolute path to file2.mp4\u003e']\"`\n\nFor instance, you can use some sample videos that come with the DeepStream installation:\n\n`ros2 run multi_stream_pkg multi_stream --ros-args -p input_sources:=\"['file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4', 'file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_qHD.mp4']\"`\n\nThe command above takes input from two sources. This can be modified to take input from one or more sources by specifying the input file names in the list **input_sources**.\n\nTo run the sample subscribers, open separate terminals, navigate to your ros workspace and repeat step 4 above in each.\n\n**sub_multi_detection** subscribes to topic multi_detection.\n\n`ros2 run subscriber_pkg sub_multi_detection`\n\n**sub_multi_classification** subscribes to topic multi_classification.\n\n`ros2 run subscriber_pkg sub_multi_classification`\n\nAn example output:\n\n![alt text](images/two_stream.png \"two stream output\")\n\n## Performance\n```\nFps of stream 1 is 36.6\nFps of stream 0 is 36.6\n\nFps of stream 1 is 40.4\nFps of stream 0 is 40.0\n```\n\nFPS with one input video source for **multi_stream** node was observed to be between 30-40; with two input sources was observed to be between 20-30; and with three sources was observed to be between 20-25 (with JAX in **MODE 15W**).\n\nTo see the rate at which data is being published on topic **multi_detection**, open a separate terminal and source it (Step 3 above). Make sure the publisher node is running in another terminal and run the following command:\n\n`ros2 topic hz multi_detection`\n\nReplace **multi_detection** with **multi_classification** to see the publishing rate on topic multi_classification.\n\nSample average rate for multi_detection: 75.96\n\nSample average rate for inference: 46.599-118.048\n\n## Contact Us\nPlease let us know if you run into any issues [here](https://github.com/NVIDIA-AI-IOT/ros2_deepstream/issues).\n\n## Related ROS 2 Projects\n- [ros2_torch_trt](https://github.com/NVIDIA-AI-IOT/ros2_torch_trt) : ROS 2 Real Time Classification and Detection\n- [ros2_jetson_stats](https://github.com/NVIDIA-AI-IOT/ros2_jetson_stats) : ROS 2 package for monitoring and controlling NVIDIA Jetson Platform resources\n- [ros2_trt_pose](https://github.com/NVIDIA-AI-IOT/ros2_trt_pose) : ROS 2 package for \"trt_pose\": real-time human pose estimation on NVIDIA Jetson Platform\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia-ai-iot%2Fros2_deepstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvidia-ai-iot%2Fros2_deepstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia-ai-iot%2Fros2_deepstream/lists"}