# mpa_to_ros publish stereo left and right image in different timestamp

Source: https://forum.modalai.com/topic/2021/mpa_to_ros-publish-stereo-left-and-right-image-in-different-timestamp
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2023-03-30 17:19:47 UTC by Dong Liu
Replies: 4 · Views: 978

## Dong Liu · 2023-03-30 17:19:47 UTC

Here is the code,

    imgL.header.stamp = (_clock_monotonic_to_ros_time(meta.timestamp_ns));
    imgL.width    = meta.width;
    imgL.height   = meta.height;
    imgL.step     = meta.width;
    imgL.encoding = GetRosFormat(meta.format);

    imgR.header.stamp = (_clock_monotonic_to_ros_time(meta.timestamp_ns));
    imgR.width    = meta.width;
    imgR.height   = meta.height;
    imgR.step     = meta.width;
    imgR.encoding = GetRosFormat(meta.format);

They are all from meta.timestamp_ns, but _clock_monotonic_to_ros is using the current time, so the final times are slight different.

I think it should be
imgR.header.stamp = imgL.header.stamp

## Reply by Chad Sweet (ModalAI staff) · 2023-03-30 17:21:03 UTC

Thanks for the suggestion! We are happy to incorporate our partners merge requests if you want to make one on gitlab!

## Reply by Dong Liu · 2023-03-30 17:58:49 UTC

will do soon.

## Reply by Dong Liu · 2023-03-30 21:12:16 UTC

MR submitted.

## Reply by Dong Liu · 2023-04-03 20:30:12 UTC

Just tried to calibrated the stereo camera using ROS camera calibrator. Had to run the fixed voxl-mpa-to-ros. Because the ROS calibrator expects left and right to be exactly synchronized.
