# imu to camera delay

Source: https://forum.modalai.com/topic/4573/imu-to-camera-delay
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2025-07-08 13:33:36 UTC by yardy
Replies: 7 · Views: 1162

## yardy · 2025-07-08 13:33:36 UTC

I'm currently working on a setup involving the VOXL 2 platform, and I'm observing some unexpectedly large delays between sensor measurements when using the MPA-to-ROS interface.

Specifically, I'm seeing:
350 ms delay between the onboard VOXL 2 IMU readings and the TOF M0178 data.
170 ms delay between the IMU and the IR camera M0166 data.

Is there any known filtering, buffering, or image preprocessing occurring on the TOF M0178 or IR camera M0166 streams that might account for the latency?

What else can cause such latency on my setup? 
Thanks in advance,

## Reply by Alex Kushleyev (ModalAI staff) · 2025-07-09 05:17:35 UTC

@yardy , can you please clarify how you are measuring the latency? 

`voxl-camera-server` sends out TOF data without delay (after performing required processing to generate the depth data) and `voxl-imu-server` sends out IMU data in batches, depending on the settings in `voxl-imu-server.conf`. However, there should not be delay of such magnitude at the MPA pipe level.

It is possible that the data gets backed up in mpa-to-ros application, we can figure it out if you let me know how you are measuring the latency.

Alex

## Reply by yardy · 2025-07-09 10:55:16 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev 
Thanks for replying.

temporal alignment between the IMU signal and the camera motion, extracted using a calibration target. The IMU and the camera were rigidly attached and moved together as a single unit during the test.

B.R

## Reply by Alex Kushleyev (ModalAI staff) · 2025-07-09 13:36:41 UTC (in reply to yardy)

@yardy , i understand. Which timestamps are you looking at after temporal alignment? Are those timestamps of ros packets being received or timestamps within the packets themselves?

## Reply by yardy · 2025-07-10 06:08:13 UTC (in reply to Alex Kushleyev)

Hi @Alex-Kushleyev,

The results I shared earlier are based on the difference between the internal header timestamps of both sensors.

Also, we measured a delay of approximately 50 ms between the internal header timestamp and the ROS message timestamp for the camera, and about 30 ms for the IMU.

## Reply by Alex Kushleyev (ModalAI staff) · 2025-07-11 16:21:57 UTC (in reply to yardy)

@yardy ,

looking at mpa to ros code..

The timestamps for the message headers are assigned here : 

https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-to-ros/-/blob/master/catkin_ws/src/src/interfaces/imu_interface.cpp?ref_type=heads#L113

https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-to-ros/-/blob/master/catkin_ws/src/src/interfaces/camera_interface.cpp#L163

So the timestamps should be correctly converted to ROS time and not susceptible to any delays in the mpa to ros conversion.

Are you logging the ros messages using `rosbag record` and analyzing them offline? Make sure that you are not using the `bag` timestamp for that.

Alex

## Reply by yardy · 2025-07-14 12:33:12 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev We found out that we didnt take into account the phase difference when comparing angular rate to angle. Thanks and sorry for the confusion.

## Reply by Alex Kushleyev (ModalAI staff) · 2025-07-15 16:59:45 UTC (in reply to yardy)

@yardy , ah, that makes sense!! thank you for clarying.

Alex
