• DepthAI-v2ROS
  • FPS problem about depth topic when recording rosbag.

When recording a rosbag including color, left, right, and depth information according to https://docs.luxonis.com/projects/sdk/en/latest/samples/recording/SDK_rosbag_record/, I found that the depth frame numbers are nearly half of the other cameras in the recorded rosbag. However, I set the fps to the same for all cameras. I cannot figure out the problem. The rosbag information, code, and environment are shown below.

    Hi jarvis
    Perhaps the inference is to slow since you are running both subpixel as well as extended disparity? Could you check without?

    Thanks,
    Jaka

      jakaskerl Thanks. I tried to disable subpixel and extended disparity and set camera output to compressed rather than raw. The frame number increases. But how to get high quality depth frames and enough frames at the same time.

        Hi jarvis
        I believe it's a hardware limitation. You can try disabling the color stream/encoding and lowering fps to see if you get better results.

        Thanks,
        Jaka

        5 days later

        Thanks, I successfully record the rosbag with correct frame numbers using 20fps for color and depth camera. The sub-pixel is activated while extended disparity is not activated. Is there a pipeline to post-process the depth frames in the record like using the extended disparity or making it better? And I need to record the RGB-D frames, so I cannot disable the color frame. But what does disabling the encoding mean, should I set encode=None?

          jarvis Is there a pipeline to post-process the depth frames in the record like using the extended disparity or making it better?

          You can use the StereoDepth node's postprocessing filters that run on-device to improve the quality of the disparity map. These filters introduce additional latency and have a performance cost, so you may need to use lower-resolution frames or the Decimation filter to improve the cost.
          https://docs.luxonis.com/projects/api/en/latest/tutorials/configuring-stereo-depth/#stereo-postprocessing-filters

          jarvis But what does disabling the encoding mean, should I set encode=None?

          Regarding your question about disabling the encoding, it refers to the process of converting the raw video data into a format that is easier to store or transmit. In the context of Luxonis' DepthAI, encoding is used to convert the video data from the RGB camera into a format that can be saved to a file or transmitted over a network. If you set encode=None, it means that you are not specifying any encoding for the video data, and the raw data will be used instead.

          Thanks,
          Jaka