• DepthAI
  • OAK-D IMU sequence number and timestamps don't line up

Hi all,
I like to get synchronised IMU data and stereo images from the OAK-D hardware.
I am using 30fps left and right for the stereo images at 640x400 and 500Hz for the IMU. I am checking timestamps on both stereo images, accel and gyro in an IMU packet on the host side and ensure that they line up. I have noticed that even though accel and gyro timestamps are pretty close (within a few miliseconds) their sequence numbers are quite different sometimes by 20 counts or so- which should result in a timestamp diffence of 40ms or so. For instance I might receive a very first IMU packet, with sequence number of 20 for accel and seuence number of 0 for gyro but their respective timestamps are within 1 milisecond!
Do sequence numbers in IMU suppose to line up with timestamps?
Also any pointers as to the best method for ensuing synchronisation of gyro, accel, left and right images other than checking and comparing timestamp associated with each one of them?

Thanks for clarification.

    Shaadee
    Hello.
    Gyro and accelerometer sequence numbers are different because they are running at different sampling rates internally, accelerometer at 500 hz, gyro at 400.
    You don't need to sync them on host side, when multiple outputs are enabled for the IMU node they are automatically synced.

    For syncing with Left/Right cameras the best way is using timestamp information.

    Thanks for the reply. I can see the reasoning now, however in my logs the sequence numbers don't follow a 500/400 ratio- They are more like 256/245 for whatever reason. Anyway I only use the timestamps now for the IMU and to get rid of the 1-2ms jitter between sample times of accel and gyro, I use the timestamp of accel and linear-interpolate gyro values with timestamps just before and after the accel timestamp to get a gyro value at the exact time of the accel sample time. That's of course assuming that the gyro values change linearly with time. I hope this makes sense.
    Thanks