ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.19k stars 9.71k forks source link

IMU measurement time not matching timestamp #14717

Closed rtzu6 closed 1 year ago

rtzu6 commented 1 year ago

Describe the bug In cyber_monitor, when investigating IMU data (/apollo/sensor/gnss/imu) produced by lgsvl, the measurement time does not match the timestamp. The timestamp starts with 167058 (epoch here), the measurement time starts with 135462.

To Reproduce Steps to reproduce the behavior:

  1. Create an lgsvl simulation. I used Borregas Ave map, Lincoln2017MKZ car and I tried both Apollo 6.0 (modular testing) as well as Apollo R7.0 - full-analysis - ty configs.
  2. Run it on your machine and enable the bridge.
  3. Check the cyber_monitor. All timestamps are epoch, except IMU.

Expected behavior This should also probably be epoch.

Screenshots imu

Desktop (please complete the following information):

Additional context I stumbled across this problem while trying to setup MSF on my machine. Currently, I am facing the same problem as in #13027, whose screenshots also show the time discrepancy for best_pos. Could this problem stem from the aforementioned time discrepancy? Otherwise, how should I proceed to debug this problem, as, according to #5969 , there is no plan to open source this component?

rtzu6 commented 1 year ago

After checking a bit more, this seems to be a difference in time encoding on the simulator side. The timestamp is in epoch, the measurement time in GPS time. For more information see here.

boyang9602 commented 4 months ago

In the code comment, it mentioned that // The time of IMU measurement, seconds since the GPS epoch (Jan 6, 1980). , so I think it is different from the timestamp in header.