# ROS2 DeepStream Cpp

**URL:** <https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274>\
**Category:** Jetson Xavier NX\
**Tags:** ros\
**Created:** [October 9, 2022, 11:45am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274 "2022-10-09T11:45:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark60](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mark60](https://forums.developer.nvidia.com/u/mark60)\
**Post date:** [October 9, 2022, 11:45am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/1 "2022-10-09T11:45:42Z")

</div>

Hello,  
after the all new amazing news, what is the best practice(s) to use Jetson for Object Detection?  
Let’s suggest the one has a ROS2 node of camera driver (RealSense/ZED/Mipi, doesn’t matter) and wants to connect to another node using shared memory for Object Detection? If the one wants the shared memory he should implement the ROS2 nodes in C++, am I wrong?  
If so, what is the best way for infer? Do I need to convert the DeepStream node from Python to C++ or should I use some ROS2 nodes provided by NVIDIA such as [ROS2 TORCH TRT](https://github.com/NVIDIA-AI-IOT/ros2_torch_trt)?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [October 10, 2022, 4:30pm UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/2 "2022-10-10T16:30:00Z")

</div>

Hi @mark60, to utilize shared memory transport between ROS2 nodes and perform optimized DNN inferencing, I would recommend looking into Isaac ROS:

- [NVIDIA Isaac ROS | NVIDIA Developer](https://developer.nvidia.com/isaac-ros)
- [NVIDIA Isaac ROS · GitHub](https://github.com/NVIDIA-ISAAC-ROS)

There are also these ROS/ROS2 nodes available for the jetson-inference library: [https://github.com/dusty-nv/ros\_deep\_learning](https://github.com/dusty-nv/ros_deep_learning)

---

<div class="post-metadata">

**Author:** ![mark60](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mark60](https://forums.developer.nvidia.com/u/mark60)\
**Post date:** [October 12, 2022, 12:39am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/3 "2022-10-12T00:39:38Z")

</div>

Hello @dusty_nv ,  
Thank you for your response.  
What you sent was the reason for my question. So, if I understand right, it’s time to say goodbye to Deepstream with ROS?  
Do you still recommend using TAO?

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [October 12, 2022, 2:36am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/4 "2022-10-12T02:36:17Z")

</div>

Certainly you could still use DeepStream for optimized inference using TAO models with ROS2 if you made a node for it. [Here](https://forums.developer.nvidia.com/t/ros2-jetson-repo-unable-to-run-ros2-example-app-inside-container-built-from-repo-dockerfile/229024) is another thread about that.

---

<div class="post-metadata">

**Author:** ![mark60](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mark60](https://forums.developer.nvidia.com/u/mark60)\
**Post date:** [October 23, 2022, 3:36pm UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/5 "2022-10-23T15:36:56Z")

</div>

Thank you for the link!  
But what is the best practice supposed by you/NVIDIA?  
I don’t want to continue into the dead end. If DeepStream is out, it’s ok for me, I guess that I can also convert etlt to TensorRT and run it with the ROS2 node.

Can you still use TAO with ROS2 inference nodes?  
Is there some way to convert it to ONNX or do these nodes support .etlt?

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [October 24, 2022, 3:38pm UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/6 "2022-10-24T15:38:45Z")

</div>

> [@mark60](#):
>
> Can you still use TAO with ROS2 inference nodes?

Hi @mark60, yes you can use TAO-trained models with Isaac ROS (ROS2) - see the section titled `DNN Inference Processing` on this page:

> **[NVIDIA Isaac ROS](https://developer.nvidia.com/isaac/ros)**
>
> Streamline and expedite development of advanced AI robotics applications.

---

<div class="post-metadata">

**Author:** ![mark60](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mark60](https://forums.developer.nvidia.com/u/mark60)\
**Post date:** [October 25, 2022, 7:41am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/7 "2022-10-25T07:41:01Z")

</div>

> [@dusty\_nv](#):
>
> [https://developer.nvidia.com/isaac-ros](https://developer.nvidia.com/isaac-ros)

It’s compatible only for JetPack 5.0.2, isn’t it?  
I still have projects that use JetPack 4.6 because of carrier boards. Is there some solution for this?

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [October 25, 2022, 5:51pm UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/8 "2022-10-25T17:51:17Z")

</div>

> [@mark60](#):
>
> I still have projects that use JetPack 4.6 because of carrier boards. Is there some solution for this?

OK, if you want to use TAO models in ROS2 on JetPack 4.x, I would try using the previous [ros2\_deepstream](https://github.com/NVIDIA-AI-IOT/ros2_deepstream) nodes then.

---

<div class="post-metadata">

**Author:** ![mark60](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mark60](https://forums.developer.nvidia.com/u/mark60)\
**Post date:** [October 25, 2022, 7:46pm UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/9 "2022-10-25T19:46:39Z")

</div>

I use these nodes…  
But I’m looking for something in cpp for fast data transfer, zero copy and etc.

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [October 26, 2022, 1:11am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/10 "2022-10-26T01:11:13Z")

</div>

ros2\_deepstream does zero-copy within the camera/inferencing pipeline (because that’s all contained within the deepstream node and not broken up into separate ROS nodes). Once it publishes the detection metadata to the ROS topic however, that is no longer zero-copy (however it is not high-bandwidth data at that point)

For breaking up the camera/inferencing pipeline into multiple ROS nodes, Isaac ROS implements NITROS to achieve zero-copy in ROS2, however that would require upgrading your systems to JetPack 5.x

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 9, 2022, 1:11am UTC](https://forums.developer.nvidia.com/t/ros2-deepstream-cpp/230274/11 "2022-11-09T01:11:46Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
