Timesync in MicroDDS

Hi all.

I have some question related to time syncing between PX4 and ROS 2.

I am setting up visual inertial SLAM system on a drone, and as you may know the camera images and the IMU time stamps have to be accurate for a usable and successful estimation.

I am using the v1.14beta vesion of PX4, and ROS 2 humble. I use MicroXRCEAgent to communicate with PX4. I get the IMU measurements from the fmu/out/sensor_combined topic, which look like this

timestamp: 1686500596970849
gyro_rad:
- -8.57829737419772e-15
- 1.4755774727093218e-12
- 6.035771080086626e-18
gyro_integral_dt: 4000
accelerometer_timestamp_relative: 0
accelerometer_m_s2:
- -6.62371348880697e-08
- 1.710423020995222e-07
- -9.800002098083496
accelerometer_integral_dt: 4000
accelerometer_clipping: 0
gyro_clipping: 0
accel_calibration_count: 0
gyro_calibration_count: 1

Now, the important part is the timestamp field of the message in the topic. Is this timestamp of the PX4 or the ROS side?

My camera images are published with ROS timestamps, and of course, the IMU readings need to be published with ROS timestamps as well in order for the SLAM software to work properly.

If the timestamp in the fmu/out/sensor_combined corresponds to PX4 clock, how can I synchronize it with ROS clock ?

@Jaeyoung-Lim @Julia_Nitsch any hint is highly appreciated.

Thanks!