Timesync using ntp and mavros

Hi I have a question to time syncing my complete system.
I have a Trimble GPS connected to a raspberry pi. The RPI runs ntp, using the GPS as source. The GPS is also connected to my Pixhawk 4. The Pixhawk is running PX4 stack and is connected to the companion computer.
I wanted to test my timesync. I run mavros to the Pixhawk and compare the timestamps between the mavros msgs(from header) and the timestamps in Trimbles position message by reading a serial port that is connected between the Trimble and RPI. It seems like the mavros messages have a delay of 35ms, which seems like a lot. I wanted to ask if there are any suggestion on how to set it up or if I can get the offset between the two systems from another mavros msg?

1 Like