ZED X One Stereo, images steaming and image IMU data recording

Hi,

I am struggling with understanding the image streaming and data recording functionalities for the ZED X One Stereo pairs and would greatly appreciate your assistance.

1. Image Streaming

I have successfully configured the ZED X One camera pairs in stereo mode, and the ZED_Media_Server software operates flawlessly. As I understand, to initiate image streaming, I must first open the software to set up the virtual camera S/N and start streaming. The software can then be closed as a background service will continue running. However, I plan to use the NVIDIA Jetson in headless setup, i.e. without monitors, keyboards, which necessitats that image streaming starts automatically upon power-up. Are there any APIs available that could automate this setup process instead of requiring manual configuration through the software?

2. Timestamp for Images

The following Python code snippet from image_capture.py captures images but I’m unclear about the timestamp logic:

while i < 50:
    if zed.grab(runtime_parameters) == sl.ERROR_CODE.SUCCESS:
        zed.retrieve_image(image, sl.VIEW.LEFT)
        timestamp = zed.get_timestamp(sl.TIME_REFERENCE.CURRENT)  
        print("Image resolution: {0} x {1} || Image timestamp: {2}\n".format(image.get_width(), image.get_height(), timestamp.get_milliseconds()))

Questions:

  1. Why does the official example use TIME_REFERENCE.CURRENT instead of TIME_REFERENCE.IMAGE for left image timestamps?
  2. What is the practical difference between these timestamp references?
  3. For hardware-synchronized stereo pairs via capture card:
  • Should both images share identical TIME_REFERENCE.IMAGE timestamps?
  • Does TIME_REFERENCE.IMAGE represent the exact sensor capture moment?
  1. If I would like to record both left and right images, is the code snippet below correct?
while i < 50:
    if zed.grab(runtime_parameters) == sl.ERROR_CODE.SUCCESS:
        zed.retrieve_image(image_left, sl.VIEW.LEFT)
        zed.retrieve_image(image_right, sl.VIEW.LEFT)
        timestamp = zed.get_timestamp(sl.TIME_REFERENCE.IMAGE)

3. Image and IMU Data Recording

Here is another script from sensor_data.py that I attempted to combine with image recording, but only images are being recorded successfully:

while time.time() - time_0 < 5:
    if zed.get_sensors_data(sensors_data, sl.TIME_REFERENCE.CURRENT) == sl.ERROR_CODE.SUCCESS:
        if ts_handler.is_new(sensors_data.get_imu_data()):
            quaternion = sensors_data.get_imu_data().get_pose().get_orientation().get()
            print(f"\tOrientation: [ Ox: {quaternion[0]}, Oy: {quaternion[1]}, Oz: {quaternion[2]}, Ow: {quaternion[3]} ]")
            linear_acceleration = sensors_data.get_imu_data().get_linear_acceleration()
            print(f"\tAcceleration: [ {linear_acceleration[0]} {linear_acceleration[1]} {linear_acceleration[2]} ] [m/sec^2]")
            angular_velocity = sensors_data.get_imu_data().get_angular_velocity()
            print(f"\tAngular Velocities: [ {angular_velocity[0]} {angular_velocity[1]} {angular_velocity[2]} ] [deg/sec]")
    if zed.grab(runtime_parameters) == sl.ERROR_CODE.SUCCESS:
        zed.retrieve_image(image_left, sl.VIEW.LEFT)
        zed.retrieve_image(image_right, sl.VIEW.RIGHT)
        timestamp = zed.get_timestamp(sl.TIME_REFERENCE.IMAGE)
        print(f"Left Image resolution: {image_left.get_width()} x {image_left.get_height()} || Image timestamp: {timestamp.get_milliseconds()}\n")

Is it feasible to record both IMU and image data in a single script without missing any data? If so, how can this be achieved effectively?

Thanks for your reply in advance.