Frame tear for zed x mini camera

Hi engineering team! I am using zed x mini camera with zed link duo on jetson orin nano. I used the python API to grab images and publish them into compressed images in ros2, which I later collected to be a rosbag and run Kalibr on it. However, the kalibr warns about “multiple april grids detected”, which turns out to be frame tearing for the images in the rosbag. Here is an example:

I am wondering what could be wrong here? Can I avoid this through some setting? Note that I the image is collected in a docker running ros on the host machine, and I am using SVGA. Here is the config file I used for launching the camera:

camera_id: 0
enable_fps_tracking: false
enable_left_rgb: true
enable_right_rgb: true
enable_depth: true
resolution: SVGA
fps: 30
depth_mode: NEURAL
depth_min: 0.2
depth_max: 10.0
coordinate_units: METER
coordinate_system: IMAGE
enable_right_side_measure: true
enable_image_enhancement: true
enable_fill_mode: true
streaming_mode: jpeg
jpeg_quality: 90
video_codec_preset: balanced
pix_fmt: null
imu_rate: 100
imu_reference: current
saturation: -1
sharpness: -1
gamma: -1
denoising: -1
whitebalance_temperature: -1
whitebalance_auto: true
auto_exposure_gain: true
exposure_time: -1
exposure_compensation: -1
analog_gain: -1
digital_gain: -1
led_status: -1

Appreciate your help!

Hi @lukechen,

Welcome to the forums! :waving_hand:

Duplicating the response from the email thread, we would prefer responding on the forum just in case someone else has the same issue :slight_smile:

Thank you for reporting this, this is not expected. I would highly recommend using the offical ROS 2 wrapper: https://github.com/stereolabs/zed-ros2-wrapper which has its implementation extensively tested and validated by our team.

Can you run the ZED_Diagnostic tool and share the resulting JSON file? This will help confirm your setup and software versions.

Thanks for the reply. I found the issue was in our code base, where we used a volatile image buffer that can be overwritten by ZED SDK. After fixing the bug, the problem is no longer there. Thanks for your help!

For future reference, ZED SDK returns a copy to the image it captured, which might be overwritten later. You should copy that image first.