Hello,

I am currently trying to port all my sensor drivers from ROS1 to ROS2. While doing so, I was able to get the ROS2 versions running for my OAK POE however it seems the compression is considerably worse than with ROS1. The bandwidth I am seeing with ROS1 is in the order of 1.5Mb/s at a frame rate of around 47 fps but for ROS2 I am seeing around 9Mb/s at a frame frat eof around 30fps.

Am I somehow configuring my ROS2 settings in correctly? The following are my settings for ROS1 and ROS2 respectively.

ROS1

/front_oak:
    camera_i_mx_id: 18443010E1DA100900
    camera_i_pipeline_type: RGB
    camera_i_enable_imu: false
    camera_i_enable_ir: false
    camera_i_resolution: '480'
    rgb:
      image_raw:
        compressed:
          format: jpeg
          jpeg_optimize: true
          jpeg_progressive: true
          jpeg_quality: 10
          jpeg_restart_interval: 0
          png_level: 1
        compressedDepth:
          depth_max: 10.0
          depth_quantization: 100.0
          format: png
          png_level: 9
        theora:
          keyframe_frequency: 64
          optimize_for: 1
          quality: 31
          target_bitrate: 800000
    rgb_i_low_bandwidth: true
    rgb_i_low_bandwidth_quality: 10
    camera_i_nn_type: none
    nn_i_nn_config_path: depthai_ros_driver/yolo

ROS2

/front_oak:
  ros__parameters:
    camera:
      i_mx_id: 18443010B1B8FF0800
      i_pipeline_type: RGB
      i_enable_imu: false
      i_enable_ir: false
      i_resolution: '480'
      i_nn_type: none
    nn:
      i_nn_config_path: depthai_ros_driver/yolo
    rgb:
      image_raw:
        compressed:
          format: jpeg
          jpeg_optimize: true
          jpeg_progressive: true
          jpeg_quality: 10
          jpeg_restart_interval: 0
          png_level: 1
          i_resolution: '1080'
          i_low_bandwidth: true
          i_low_bandwidth_quality: 10

Hi, currently ROS2 requires some tuning to achieve similar "speed" as ROS1 in the same setup, hopefully this will be changed in the future. For now, some pointers:

  • In ROS2 you can use composition/intra-process communication to mitigate transport layer
  • There is a section for DDS Tuning in the official ROS docs which can help with the setup.