# Time sync not working / wrong mavros timestamp?

**URL:** <https://discuss.px4.io/t/time-sync-not-working-wrong-mavros-timestamp/5309>\
**Category:** PX4 Autopilot\
**Created:** [January 4, 2018, 10:43am UTC](https://discuss.px4.io/t/time-sync-not-working-wrong-mavros-timestamp/5309 "2018-01-04T10:43:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarLi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@MarLi](https://discuss.px4.io/u/MarLi)\
**Post date:** [January 4, 2018, 10:43am UTC](https://discuss.px4.io/t/time-sync-not-working-wrong-mavros-timestamp/5309/1 "2018-01-04T10:43:27Z")

</div>

Time sync not working / Latency to high?

Hi,

I’ve got some troubles sending mocap data to the FCU. I’m using a PixRacer with the latest stable Firmware-Build and the following parameters, to enable the vision fusion in the LPE:

> SYS\_MC\_EST\_GROUP, 1  
> LPE\_FUSION, 148  
> ATT\_EXT\_HDG\_M, 2

The mocap data is streamed to the FCU via mavros by an development computer. However I continously get a mocap timeout followed by a new mocap position init:

> [INFO] [1515059074.509043320]: FCU: [lpe] mocap position init: 2.91, 0.67, 0.00 m  
> [INFO] [1515059074.511829727]: FCU: [lpe] mocap timeout  
> [INFO] [1515059074.515107459]: FCU: [lpe] mocap position init: 2.45, 1.69, 0.00 m  
> [INFO] [1515059074.672871313]: FCU: [lpe] mocap position init: 1.78, -2.37, 0.00 m  
> [INFO] [1515059074.682006186]: FCU: [lpe] mocap timeout

Consequenty the local\_position does not follow the mocap data and I also can’t see the streamed mocap data in the log files.  
I checked that the time synchronization is enabled, but I’m not sure whether it is working correctly. I also tried different baudrates and reducing the mocap streaming rate to 7 Hz (defautl 25 Hz), but without success.

Could anyone provide some help for this issue? 🙂

Below you can find the mavros log, an extract from the /diagnostic and the /mavros/time\_reference topics.

Thanks a lot in advance!

**mavros log**

> mli@ubuntu:~$ roslaunch mavros px4.launch fcu\_url:=/dev/ttyACM0:921600 gcs\_url:=udp://@127.0.0.1  
> … logging to /home/mli/.ros/log/38bc6fd4-f137-11e7-84f0-000c290399b7/roslaunch-ubuntu-19760.log  
> Checking log directory for disk usage. This may take awhile.  
> Press Ctrl-C to interrupt  
> Done checking log file disk usage. Usage is \<1GB.

> started roslaunch server [http://ubuntu:42379/](http://ubuntu:42379/)

> SUMMARY

> CLEAR PARAMETERS
> 
> - /mavros/

> PARAMETERS
> 
> - /mavros/cmd/use\_comp\_id\_system\_control: False
> - /mavros/conn/heartbeat\_rate: 5.0
> - /mavros/conn/system\_time\_rate: 5.0
> - /mavros/conn/timeout: 10.0
> - /mavros/conn/timesync\_rate: 5.0
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/field\_of\_view: 0.0
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/frame\_id: hrlv\_ez4\_sonar
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/id: 0
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/orientation: ROLL\_180
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/send\_tf: True
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/sensor\_position/x: 0.0
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/sensor\_position/y: 0.0
> - /mavros/distance\_sensor/hrlv\_ez4\_pub/sensor\_position/z: -0.1
> - /mavros/distance\_sensor/laser\_1\_sub/id: 3
> - /mavros/distance\_sensor/laser\_1\_sub/orientation: ROLL\_180
> - /mavros/distance\_sensor/laser\_1\_sub/subscriber: True
> - /mavros/distance\_sensor/lidarlite\_pub/field\_of\_view: 0.0
> - /mavros/distance\_sensor/lidarlite\_pub/frame\_id: lidarlite\_laser
> - /mavros/distance\_sensor/lidarlite\_pub/id: 1
> - /mavros/distance\_sensor/lidarlite\_pub/orientation: ROLL\_180
> - /mavros/distance\_sensor/lidarlite\_pub/send\_tf: True
> - /mavros/distance\_sensor/lidarlite\_pub/sensor\_position/x: 0.0
> - /mavros/distance\_sensor/lidarlite\_pub/sensor\_position/y: 0.0
> - /mavros/distance\_sensor/lidarlite\_pub/sensor\_position/z: -0.1
> - /mavros/distance\_sensor/sonar\_1\_sub/id: 2
> - /mavros/distance\_sensor/sonar\_1\_sub/orientation: ROLL\_180
> - /mavros/distance\_sensor/sonar\_1\_sub/subscriber: True
> - /mavros/fcu\_url: /dev/ttyACM0:921600
> - /mavros/gcs\_url: udp://@127.0.0.1
> - /mavros/global\_position/frame\_id: fcu
> - /mavros/global\_position/rot\_covariance: 99999.0
> - /mavros/global\_position/tf/child\_frame\_id: fcu\_utm
> - /mavros/global\_position/tf/frame\_id: local\_origin
> - /mavros/global\_position/tf/send: False
> - /mavros/image/frame\_id: px4flow
> - /mavros/imu/angular\_velocity\_stdev: 0.000349065850399
> - /mavros/imu/frame\_id: fcu
> - /mavros/imu/linear\_acceleration\_stdev: 0.0003
> - /mavros/imu/magnetic\_stdev: 0.0
> - /mavros/imu/orientation\_stdev: 1.0
> - /mavros/local\_position/frame\_id: fcu
> - /mavros/local\_position/tf/child\_frame\_id: fcu
> - /mavros/local\_position/tf/frame\_id: local\_origin
> - /mavros/local\_position/tf/send: False
> - /mavros/local\_position/tf/send\_fcu: False
> - /mavros/mission/pull\_after\_gcs: True
> - /mavros/mocap/use\_pose: True
> - /mavros/mocap/use\_tf: False
> - /mavros/plugin\_blacklist: [‘safety\_area’, '…
> - /mavros/plugin\_whitelist: 
> - /mavros/px4flow/frame\_id: px4flow
> - /mavros/px4flow/ranger\_fov: 0.0
> - /mavros/px4flow/ranger\_max\_range: 5.0
> - /mavros/px4flow/ranger\_min\_range: 0.3
> - /mavros/safety\_area/p1/x: 1.0
> - /mavros/safety\_area/p1/y: 1.0
> - /mavros/safety\_area/p1/z: 1.0
> - /mavros/safety\_area/p2/x: -1.0
> - /mavros/safety\_area/p2/y: -1.0
> - /mavros/safety\_area/p2/z: -1.0
> - /mavros/setpoint\_accel/send\_force: False
> - /mavros/setpoint\_attitude/reverse\_throttle: False
> - /mavros/setpoint\_attitude/tf/child\_frame\_id: attitude
> - /mavros/setpoint\_attitude/tf/frame\_id: local\_origin
> - /mavros/setpoint\_attitude/tf/listen: False
> - /mavros/setpoint\_attitude/tf/rate\_limit: 10.0
> - /mavros/setpoint\_position/tf/child\_frame\_id: setpoint
> - /mavros/setpoint\_position/tf/frame\_id: local\_origin
> - /mavros/setpoint\_position/tf/listen: False
> - /mavros/setpoint\_position/tf/rate\_limit: 50.0
> - /mavros/startup\_px4\_usb\_quirk: True
> - /mavros/sys/disable\_diag: False
> - /mavros/sys/min\_voltage: 10.0
> - /mavros/target\_component\_id: 1
> - /mavros/target\_system\_id: 1
> - /mavros/tdr\_radio/low\_rssi: 40
> - /mavros/time/time\_ref\_source: fcu
> - /mavros/time/timesync\_avg\_alpha: 0.6
> - /mavros/time/timesync\_mode: MAVLINK
> - /mavros/vibration/frame\_id: vibration
> - /mavros/vision\_pose/tf/child\_frame\_id: vision
> - /mavros/vision\_pose/tf/frame\_id: local\_origin
> - /mavros/vision\_pose/tf/listen: False
> - /mavros/vision\_pose/tf/rate\_limit: 10.0
> - /mavros/vision\_speed/listen\_twist: False
> - /rosdistro: kinetic
> - /rosversion: 1.12.7

> NODES  
> /  
> mavros (mavros/mavros\_node)

> auto-starting new master  
> process[master]: started with pid [19771]  
> ROS\_MASTER\_URI=[http://localhost:11311](http://localhost:11311)

> setting /run\_id to 38bc6fd4-f137-11e7-84f0-000c290399b7  
> process[rosout-1]: started with pid [19784]  
> started core service [/rosout]  
> process[mavros-2]: started with pid [19797]  
> [INFO] [1515060514.137583076]: FCU URL: /dev/ttyACM0:921600  
> [WARN] [1515060514.138111338]: init: message from ASLUAV, MSG-ID 201 ignored! Table has different entry.  
> [WARN] [1515060514.138328962]: init: message from autoquad, MSG-ID 150 ignored! Table has different entry.  
> [WARN] [1515060514.138390605]: init: message from autoquad, MSG-ID 152 ignored! Table has different entry.  
> [WARN] [1515060514.138556828]: init: message from matrixpilot, MSG-ID 150 ignored! Table has different entry.  
> [WARN] [1515060514.138625931]: init: message from matrixpilot, MSG-ID 151 ignored! Table has different entry.  
> [WARN] [1515060514.138681072]: init: message from matrixpilot, MSG-ID 152 ignored! Table has different entry.  
> [WARN] [1515060514.138728859]: init: message from matrixpilot, MSG-ID 153 ignored! Table has different entry.  
> [WARN] [1515060514.138776074]: init: message from matrixpilot, MSG-ID 155 ignored! Table has different entry.  
> [WARN] [1515060514.138822915]: init: message from matrixpilot, MSG-ID 156 ignored! Table has different entry.  
> [WARN] [1515060514.138870230]: init: message from matrixpilot, MSG-ID 157 ignored! Table has different entry.  
> [WARN] [1515060514.138918424]: init: message from matrixpilot, MSG-ID 158 ignored! Table has different entry.  
> [WARN] [1515060514.138978449]: init: message from matrixpilot, MSG-ID 170 ignored! Table has different entry.  
> [WARN] [1515060514.139032650]: init: message from matrixpilot, MSG-ID 171 ignored! Table has different entry.  
> [WARN] [1515060514.139079525]: init: message from matrixpilot, MSG-ID 172 ignored! Table has different entry.  
> [WARN] [1515060514.139126672]: init: message from matrixpilot, MSG-ID 173 ignored! Table has different entry.  
> [WARN] [1515060514.139173020]: init: message from matrixpilot, MSG-ID 174 ignored! Table has different entry.  
> [WARN] [1515060514.139230863]: init: message from matrixpilot, MSG-ID 175 ignored! Table has different entry.  
> [WARN] [1515060514.139281451]: init: message from matrixpilot, MSG-ID 176 ignored! Table has different entry.  
> [WARN] [1515060514.139332346]: init: message from matrixpilot, MSG-ID 177 ignored! Table has different entry.  
> [WARN] [1515060514.139382034]: init: message from matrixpilot, MSG-ID 178 ignored! Table has different entry.  
> [WARN] [1515060514.139431838]: init: message from matrixpilot, MSG-ID 179 ignored! Table has different entry.  
> [WARN] [1515060514.139500666]: init: message from matrixpilot, MSG-ID 180 ignored! Table has different entry.  
> [WARN] [1515060514.139551906]: init: message from matrixpilot, MSG-ID 181 ignored! Table has different entry.  
> [WARN] [1515060514.139601635]: init: message from matrixpilot, MSG-ID 182 ignored! Table has different entry.  
> [WARN] [1515060514.139651360]: init: message from matrixpilot, MSG-ID 183 ignored! Table has different entry.  
> [WARN] [1515060514.139703422]: init: message from matrixpilot, MSG-ID 184 ignored! Table has different entry.  
> [WARN] [1515060514.139753945]: init: message from matrixpilot, MSG-ID 185 ignored! Table has different entry.  
> [WARN] [1515060514.139803954]: init: message from matrixpilot, MSG-ID 186 ignored! Table has different entry.  
> [WARN] [1515060514.139950709]: init: message from paparazzi, MSG-ID 180 ignored! Table has different entry.  
> [WARN] [1515060514.140149562]: init: message from paparazzi, MSG-ID 181 ignored! Table has different entry.  
> [WARN] [1515060514.140202235]: init: message from paparazzi, MSG-ID 182 ignored! Table has different entry.  
> [WARN] [1515060514.140252504]: init: message from paparazzi, MSG-ID 183 ignored! Table has different entry.  
> [WARN] [1515060514.140302779]: init: message from paparazzi, MSG-ID 184 ignored! Table has different entry.  
> [WARN] [1515060514.140445887]: init: message from slugs, MSG-ID 170 ignored! Table has different entry.  
> [WARN] [1515060514.140524791]: init: message from slugs, MSG-ID 172 ignored! Table has different entry.  
> [WARN] [1515060514.140575561]: init: message from slugs, MSG-ID 173 ignored! Table has different entry.  
> [WARN] [1515060514.140625022]: init: message from slugs, MSG-ID 176 ignored! Table has different entry.  
> [WARN] [1515060514.140674572]: init: message from slugs, MSG-ID 177 ignored! Table has different entry.  
> [WARN] [1515060514.140724535]: init: message from slugs, MSG-ID 179 ignored! Table has different entry.  
> [WARN] [1515060514.140774132]: init: message from slugs, MSG-ID 180 ignored! Table has different entry.  
> [WARN] [1515060514.140823759]: init: message from slugs, MSG-ID 181 ignored! Table has different entry.  
> [WARN] [1515060514.140872999]: init: message from slugs, MSG-ID 184 ignored! Table has different entry.  
> [WARN] [1515060514.140923087]: init: message from slugs, MSG-ID 185 ignored! Table has different entry.  
> [WARN] [1515060514.140991893]: init: message from slugs, MSG-ID 186 ignored! Table has different entry.  
> [WARN] [1515060514.141046869]: init: message from slugs, MSG-ID 188 ignored! Table has different entry.  
> [WARN] [1515060514.141098282]: init: message from slugs, MSG-ID 191 ignored! Table has different entry.  
> [WARN] [1515060514.141148328]: init: message from slugs, MSG-ID 192 ignored! Table has different entry.  
> [WARN] [1515060514.141197794]: init: message from slugs, MSG-ID 193 ignored! Table has different entry.  
> [WARN] [1515060514.141247302]: init: message from slugs, MSG-ID 194 ignored! Table has different entry.  
> [INFO] [1515060514.141590007]: serial0: device: /dev/ttyACM0 @ 921600 bps  
> [INFO] [1515060514.142690823]: GCS URL: udp://@127.0.0.1  
> [INFO] [1515060514.142985986]: udp1: Bind address: 0.0.0.0:14555  
> [INFO] [1515060514.143099289]: udp1: Remote address: 127.0.0.1:14550  
> [INFO] [1515060514.203479923]: Plugin 3dr\_radio loaded  
> [INFO] [1515060514.205509131]: Plugin 3dr\_radio initialized  
> [INFO] [1515060514.205655208]: Plugin actuator\_control loaded  
> [INFO] [1515060514.208995651]: Plugin actuator\_control initialized  
> [INFO] [1515060514.248129625]: Plugin adsb loaded  
> [INFO] [1515060514.253982152]: Plugin adsb initialized  
> [INFO] [1515060514.254153737]: Plugin altitude loaded  
> [INFO] [1515060514.255394912]: Plugin altitude initialized  
> [INFO] [1515060514.255513671]: Plugin cam\_imu\_sync loaded  
> [INFO] [1515060514.256209062]: Plugin cam\_imu\_sync initialized  
> [INFO] [1515060514.256355830]: Plugin command loaded  
> [INFO] [1515060514.261853010]: Plugin command initialized  
> [INFO] [1515060514.261949586]: Plugin distance\_sensor blacklisted  
> [INFO] [1515060514.262096794]: Plugin ftp loaded  
> [INFO] [1515060514.278561847]: Plugin ftp initialized  
> [INFO] [1515060514.278717288]: Plugin global\_position loaded  
> [INFO] [1515060514.288072110]: Plugin global\_position initialized  
> [INFO] [1515060514.288244079]: Plugin hil\_actuator\_controls loaded  
> [INFO] [1515060514.289027474]: Plugin hil\_actuator\_controls initialized  
> [INFO] [1515060514.289152471]: Plugin hil\_controls loaded  
> [INFO] [1515060514.289887203]: Plugin hil\_controls initialized  
> [INFO] [1515060514.290025273]: Plugin home\_position loaded  
> [INFO] [1515060514.294243303]: Plugin home\_position initialized  
> [INFO] [1515060514.294437708]: Plugin imu\_pub loaded  
> [INFO] [1515060514.311480416]: Plugin imu\_pub initialized  
> [INFO] [1515060514.312278901]: Plugin local\_position loaded  
> [INFO] [1515060514.323890319]: Plugin local\_position initialized  
> [INFO] [1515060514.324070368]: Plugin manual\_control loaded  
> [INFO] [1515060514.324908339]: Plugin manual\_control initialized  
> [INFO] [1515060514.325042488]: Plugin mocap\_fake\_gps loaded  
> [INFO] [1515060514.328096807]: Plugin mocap\_fake\_gps initialized  
> [INFO] [1515060514.328230755]: Plugin mocap\_pose\_estimate loaded  
> [INFO] [1515060514.334178458]: Plugin mocap\_pose\_estimate initialized  
> [INFO] [1515060514.334360411]: Plugin param loaded  
> [INFO] [1515060514.337049388]: Plugin param initialized  
> [INFO] [1515060514.337190172]: Plugin px4flow loaded  
> [INFO] [1515060514.352760815]: Plugin px4flow initialized  
> [INFO] [1515060514.352940874]: Plugin rc\_io loaded  
> [INFO] [1515060514.357303428]: Plugin rc\_io initialized  
> [INFO] [1515060514.357387337]: Plugin safety\_area blacklisted  
> [INFO] [1515060514.357754870]: Plugin setpoint\_accel loaded  
> [INFO] [1515060514.361956613]: Plugin setpoint\_accel initialized  
> [INFO] [1515060514.362146335]: Plugin setpoint\_attitude loaded  
> [INFO] [1515060514.385981524]: Plugin setpoint\_attitude initialized  
> [INFO] [1515060514.386172231]: Plugin setpoint\_position loaded  
> [INFO] [1515060514.395836622]: Plugin setpoint\_position initialized  
> [INFO] [1515060514.396022871]: Plugin setpoint\_raw loaded  
> [INFO] [1515060514.418047576]: Plugin setpoint\_raw initialized  
> [INFO] [1515060514.418516847]: Plugin setpoint\_velocity loaded  
> [INFO] [1515060514.427273308]: Plugin setpoint\_velocity initialized  
> [INFO] [1515060514.427474270]: Plugin sys\_status loaded  
> [INFO] [1515060514.436032668]: Plugin sys\_status initialized  
> [INFO] [1515060514.436198174]: Plugin sys\_time loaded  
> [INFO] [1515060514.441096270]: TM: Timesync mode: MAVLINK  
> [INFO] [1515060514.442118829]: Plugin sys\_time initialized  
> [INFO] [1515060514.442297362]: Plugin vfr\_hud loaded  
> [INFO] [1515060514.444420359]: Plugin vfr\_hud initialized  
> [INFO] [1515060514.444513339]: Plugin vibration blacklisted  
> [INFO] [1515060514.444752050]: Plugin vision\_pose\_estimate loaded  
> [INFO] [1515060514.463384378]: Plugin vision\_pose\_estimate initialized  
> [INFO] [1515060514.463548366]: Plugin vision\_speed\_estimate loaded  
> [INFO] [1515060514.470250019]: Plugin vision\_speed\_estimate initialized  
> [INFO] [1515060514.470534525]: Plugin waypoint loaded  
> [INFO] [1515060514.474849906]: Plugin waypoint initialized  
> [INFO] [1515060514.474995009]: Autostarting mavlink via USB on PX4  
> [INFO] [1515060514.475195699]: Built-in SIMD instructions: SSE, SSE2  
> [INFO] [1515060514.475548713]: Built-in MAVLink package version: 2017.8.8  
> [INFO] [1515060514.475671417]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad matrixpilot paparazzi slugs standard uAvionix ualberta  
> [INFO] [1515060514.475780592]: MAVROS started. MY ID 1.240, TARGET ID 1.1  
> [INFO] [1515060514.486760742]: IMU: High resolution IMU detected!  
> [INFO] [1515060514.486924819]: IMU: Attitude quaternion IMU detected!  
> [WARN] [1515060514.644309560]: TM: Clock skew detected (-1515060332.877885342 s). Hard syncing clocks.  
> [INFO] [1515060514.949281264]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot  
> [INFO] [1515060514.980282653]: IMU: High resolution IMU detected!  
> [INFO] [1515060514.980357316]: IMU: Attitude quaternion IMU detected!  
> [INFO] [1515060515.952754645]: VER: 1.1: Capabilities 0x000000000000e4ef  
> [INFO] [1515060515.952848134]: VER: 1.1: Flight software: 010702ff (000000008027C0B4)  
> [INFO] [1515060515.953015691]: VER: 1.1: Middleware software: 010702ff (000000008027C0B4)  
> [INFO] [1515060515.953176385]: VER: 1.1: OS software: 071600ff (0000000000000000)  
> [INFO] [1515060515.953675492]: VER: 1.1: Board hardware: 00000012  
> [INFO] [1515060515.953963726]: VER: 1.1: VID/PID: 26ac:0012  
> [INFO] [1515060515.954067313]: VER: 1.1: UID: 3335511435303335  
> [WARN] [1515060515.954240314]: CMD: Unexpected command 520, result 0  
> [INFO] [1515060524.951065222]: HP: requesting home position  
> [INFO] [1515060525.572785586]: udp1: Remote address: 127.0.0.1:14550  
> [INFO] [1515060525.577585769]: FCU: data link #0 lost  
> [INFO] [1515060525.580241904]: FCU: [lpe] mocap position init: -0.31, 1.93, -0.00 m  
> [INFO] [1515060525.585596669]: FCU: [lpe] mocap timeout  
> [INFO] [1515060525.593355437]: FCU: [lpe] mocap position init: 2.74, 1.18, 0.00 m  
> [INFO] [1515060525.598346005]: FCU: [lpe] mocap timeout  
> [INFO] [1515060525.602314034]: FCU: data link #0 regained  
> [INFO] [1515060525.709789664]: FCU: [lpe] mocap position init: -1.85, 2.34, -0.00 m  
> [INFO] [1515060525.718416808]: FCU: [lpe] mocap timeout  
> [INFO] [1515060525.966304336]: VER: 1.1: Capabilities 0x000000000000e4ef  
> [INFO] [1515060525.966417403]: VER: 1.1: Flight software: 010702ff (000000008027C0B4)  
> [INFO] [1515060525.966973394]: VER: 1.1: Middleware software: 010702ff (000000008027C0B4)  
> [INFO] [1515060525.967132678]: VER: 1.1: OS software: 071600ff (0000000000000000)  
> [INFO] [1515060525.967254596]: VER: 1.1: Board hardware: 00000012  
> [INFO] [1515060525.967474561]: VER: 1.1: VID/PID: 26ac:0012  
> [INFO] [1515060525.967593248]: VER: 1.1: UID: 3335511435303335  
> [WARN] [1515060525.968939301]: CMD: Unexpected command 520, result 0  
> [INFO] [1515060526.119682012]: WP: seems GCS requesting mission  
> [INFO] [1515060526.119771418]: WP: sheduling pull after GCS is done  
> [INFO] [1515060526.551316120]: FCU: [lpe] mocap position init: -2.56, 1.56, -0.00 m  
> [INFO] [1515060526.562863812]: FCU: [lpe] mocap timeout  
> [INFO] [1515060527.391986151]: FCU: [lpe] mocap position init: -2.94, 0.51, -0.00 m  
> [INFO] [1515060527.398962812]: FCU: [lpe] mocap timeout  
> [INFO] [1515060528.231636665]: FCU: [lpe] mocap position init: -2.91, -0.60, -0.00 m  
> [INFO] [1515060528.245285121]: FCU: [lpe] mocap timeout  
> [INFO] [1515060529.063284710]: FCU: [lpe] mocap position init: -2.51, -1.59, -0.00 m  
> [INFO] [1515060529.075468188]: FCU: [lpe] mocap timeout  
> [INFO] [1515060529.913966376]: FCU: [lpe] mocap position init: -1.80, -2.39, -0.00 m  
> [INFO] [1515060529.921949212]: FCU: [lpe] mocap timeout

**/diagnostics**

> ## header: seq: 13 stamp: secs: 1515060353 nsecs: 746046303 frame\_id: ‘’ status:
> 
> ```
> level: 0
> name: mavros: FCU connection
> message: connected
> hardware_id: /dev/ttyACM0:921600
> values: 
> - 
> key: Received packets:
> value: 1401
> - 
> key: Dropped packets:
> value: 0
> - 
> key: Buffer overruns:
> value: 0
> - 
> key: Parse errors:
> value: 0
> - 
> key: Rx sequence number:
> value: 72
> - 
> key: Tx sequence number:
> value: 123
> - 
> key: Rx total bytes:
> value: 59142
> - 
> key: Tx total bytes:
> value: 2723
> - 
> key: Rx speed:
> value: 18520.000000
> - 
> key: Tx speed:
> value: 848.000000
> 
> ```
> 
> - 
> ## level: 2 name: mavros: GPS message: No satellites hardware\_id: /dev/ttyACM0:921600 values:
> 
> ```
> key: Satellites visible
> value: 0
> 
> ```
> 
> - key: Fix type  
> value: 0
> - key: EPH (m)  
> value: Unknown
> - key: EPV (m)  
> value: Unknown
> 
> - 
> ## level: 0 name: mavros: Heartbeat message: Normal hardware\_id: /dev/ttyACM0:921600 values:
> 
> ```
> key: Heartbeats since startup
> value: 5
> 
> ```
> 
> - key: Frequency (Hz)  
> value: 0.988538
> - key: Vehicle type  
> value: Quadrotor
> - key: Autopilot type  
> value: PX4 Autopilot
> - key: Mode  
> value: MANUAL
> - key: System status  
> value: Standby
> 
> - 
> ## level: 0 name: mavros: System message: Normal hardware\_id: /dev/ttyACM0:921600 values:
> 
> ```
> key: Sensor present
> value: 0x00000000
> 
> ```
> 
> - key: Sensor enabled  
> value: 0x00000000
> - key: Sensor helth  
> value: 0x00000000
> - key: CPU Load (%)  
> value: 49.9
> - key: Drop rate (%)  
> value: 0.0
> - key: Errors comm  
> value: 0
> - key: Errors count #1  
> value: 0
> - key: Errors count #2  
> value: 0
> - key: Errors count #3  
> value: 0
> - key: Errors count #4  
> value: 0
> 
> - 
> ## level: 0 name: mavros: Battery message: Normal hardware\_id: /dev/ttyACM0:921600 values:
> 
> ```
> key: Voltage
> value: 65.54
> 
> ```
> 
> - key: Current  
> value: -0.0
> - key: Remaining  
> value: -1.0
> 
> - 
> ## level: 0 name: mavros: Time Sync message: Normal hardware\_id: /dev/ttyACM0:921600 values:
> 
> ```
> key: Timesyncs since startup
> value: 24
> 
> ```
> 
> - key: Frequency (Hz)  
> value: 4.965071
> - key: Last dt (ms)  
> value: 0.176547
> - key: Mean dt (ms)  
> value: 0.008759
> - key: Last system time (s)  
> value: 20.827369000
> - key: Time offset (s)  
> value: 1515060332.883697748
> 
> * * *

**/time\_reference**

> header:  
> seq: 19  
> stamp:  
> secs: 1515060365  
> nsecs: 316023025  
> frame\_id: ‘’  
> time\_ref:  
> secs: 1515060460  
> nsecs: 501000000  
> source: fcu

---

<div class="post-metadata">

**Author:** ![MarLi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@MarLi](https://discuss.px4.io/u/MarLi)\
**Post date:** [January 4, 2018, 2:04pm UTC](https://discuss.px4.io/t/time-sync-not-working-wrong-mavros-timestamp/5309/2 "2018-01-04T14:04:55Z")

</div>

Ok, found the soluation by myself.  
The timestamp in the header of the mocap data published by ros was incorrect. Setting the timestamp to ros::time::now() solved the problem.

---

<div class="post-metadata">

**Author:** ![chrisb](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/b38774/32.png) [@chrisb](https://discuss.px4.io/u/chrisb)\
**Post date:** [July 16, 2020, 8:17am UTC](https://discuss.px4.io/t/time-sync-not-working-wrong-mavros-timestamp/5309/3 "2020-07-16T08:17:43Z")

</div>

Hello MarLi,

If I’m not mistaking, using ros::time::now() probably only covers the issue but does not solve it. I’m facing an issue in which the PX4 IMU timestamps are not correctly synced.
