3

I tested if my ros2 node was subscribing exactly to /camera/depth/image_rect_raw topic from reassense ROS2 node.I attatched a realsense camera to TX2 board and configured as 15 fps. However, I expected that the rate of subscribing /camera/depth/image_rect_raw should be similar to 15 hz but it is different as below. Why is there the rate difference between publising and subscribing image topic? Is it possible to match the subscribing rate to publishing rate?

$ ros2 topic hz /camera/depth/image_rect_raw

average rate: 10.798

min: 0.040s max: 0.144s std dev: 0.03146s window: 13

average rate: 8.610

min: 0.040s max: 0.357s std dev: 0.06849s window: 22

average rate: 8.085

min: 0.040s max: 0.357s std dev: 0.07445s window: 30

average rate: 9.498

min: 0.015s max: 0.357s std dev: 0.06742s window: 45

average rate: 9.552

min: 0.015s max: 0.415s std dev: 0.07555s window: 55

average rate: 9.265

min: 0.015s max: 0.415s std dev: 0.07543s window: 63

average rate: 8.510

min: 0.015s max: 0.415s std dev: 0.08619s window: 68

average rate: 7.940

min: 0.015s max: 0.480s std dev: 0.09757s window: 73

average rate: 7.539

min: 0.015s max: 0.480s std dev: 0.10456s window: 77

average rate: 7.750

min: 0.015s max: 0.480s std dev: 0.09972s window: 87
Jaehyun Lee
  • 247
  • 1
  • 2
  • 4

1 Answers1

0

It is likely that the difference is due to the transport delay of putting the image into the network. The significance of this delay depends on whether your subscriber is running on the Jetson or if it is on a separate device on the same physical network. Regardless, I would suggest changing the default QoS policies to get better performance for video streaming such as setting RELIABILITY=BEST_EFFORT. That said the biggest improvement (if you are streaming over a network) will likely come from using the image_transport_plugins to compress the images before they are published. Although these are CPU based (theora, etc.) they will likely help.

Another thing to consider is using the compression hardware accelerators that are built into the Jetson though that will require some more work until the maintainers of image_transport_plugins or another enterprising developer gets this working.

di55olve88
  • 26
  • 3