Zed2i Framerate drop when subscribing to depth or image node

Hello, i’m running into an issue when i try to run some ros2 nodes that subscribes to zed_wrapper topics, all zed_wrapper topics frame rate drops from 20Hz to 5Hz max, and the /zed/zed_node/depth/depth_registered topic drops below 0.5Hz on average. Before going deeper on my debug results, here is a quick overview on the setup i am using:

Setup and configuration

  • i’m running everything on an Nvidia Jetson Xavier NX with Jetpack 5.11
  • I am using two separate docker containers:
    1- One that runs only the zed SDK and the zed ros2 wrapper, the container is based on the zed_ros2_l4t_35.3.1_sdk_5.0.3 docker image.
    2- One that runs ros2 Humble and the nodes i’m using for my applications
  • I have followed the DDS Middleware configuration described in this article DDS Middleware and Network tuning, and i have set up the cyclonedds config for both docker containers.
  • Both container’s network setting have been set to host.
  • I have changed the common_stereo.yaml file to have pub_resolution: 'NATIVE' and pub_frame_rate: 20.0 with grab_resolution: 'VGA' and grab_frame_rate: 20.

Faced Issue in Details

When running the command ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zed2i on the zed container, i receive on the other container all the topics with no problem and the command ros2 topic hz /zed/zed_node/depth/depth_registered outputs average rate: 20. But when i display the topics using Foxglove on a remote machine in the same subnet, or when i use ros2 topic echo the command ros2 topic hz on the image topic or the depth topic ouputs average rate: 5 and the display is a bit laggy. When i shut the display down the average rate gets back to 20. When i run nodes on the second container on the Jetson, nodes that subscribes to /zed/zed_node/depth/depth_registered, or /zed/zed_node/left/image_rect_color i get these results:

  • ros2 topic hz /zed/zed_node/depth/depth_registered ouputs something like average rate: 0.3 min: 0.180s max: 10s. The min value get stuck above 1 second sometimes.
  • ros2 topic hz /zed/zed_node/left/image_rect_color ouputs average rate: 5 min: 0.160s max: 0.230s.

I assume that the Nvidia Jetson Xavier NX is powerful enough to run both zed nodes and other nodes at the same time, especially with VGA resolution, therefore i’m stunned and have no idea where this issue come from or how to solve it, any suggestion would be more than welcome.
Thank you in advance.

Hi @statiqueplasma
Welcome to the StereoLabs community.

This value is not valid. Please set it to 15 or 30.

Did you set in this way also the remote PC running Foxglove?

Thank you.
Thanks for the heads up for the grab_frame_rate value.
I have only used the remote PC for debugging the display so no i didn’t set up the remote PC with that configuration as i’m not using it when i run my nodes.
(I don’t use Foxglove when i run the nodes i described above)
The main issue is really the frame drop when i subscribe to zed’s topics using the nodes on the Xavier docker.

How many topics do you subscribe to simultaneously?
I suspect the load required by all the memory copies is too much for the old Xavier NX

I thought so as well, but i’m only subscribing to /zed/zed_node/depth/depth_registered and /zed/zed_node/left/image_rect_color, shouldn’t the cyclonedds be enough to handle that ?.

Is there a way to debug where the bottleneck is coming from ? memory copy or the zed_wrapper ?

The ROS2 ZED wrapper has been debugged and validated to achieve maximum ROS 2 processing speed.
Memory copying is a limitation of NVIDIA Jetson devices, especially when handling large amounts of data at high speed.
Performance with newer Jetson Orin devices has improved in this regard.