PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.53k stars 13.51k forks source link

Snapdragon timestamp offset #11134

Closed karliss closed 5 years ago

karliss commented 5 years ago

Describe the bug Seems that timestamp synchronization between qurt and linux parts is broken.

To Reproduce

  1. Start px4 on snapdragon
  2. listener sensor_accel
  3. observe that timestamp is (18446744073701.398438 seconds ago) taking in to account integer wrapping that is approximately 8 seconds in future

Expected behavior Timestamps from uorb messages can be used directly without knowing if it was produced on qurt or Linux side.

Log Files and Screenshots

pxh> listener sensor_accel

TOPIC: sensor_accel instance 0 #1
 sensor_accel_s
        timestamp: 18235529088  (18446744073701.398438 seconds ago)
        error_count: 0
        device_id: 4288784 (Type: 0x41, UNKNOWN:2 (0x71)) 
        x: -0.2183
        y: 0.0912
        z: -9.6670
        integral_dt: 3997
        x_integral: -0.0007
        y_integral: 0.0004
        z_integral: -0.0385
        temperature: 0.0000
        scaling: -1.0000
        x_raw: -57
        y_raw: 330
        z_raw: -9753

Drone (please complete the following information):

Additional context I also had a test subscribed to sensor_combined topic and immediately printed message timestamp and current hrt_absolute_time(). Previously the difference was ~400us now it is 8s.

I found that there is dsp_offset which was previously used but currently is unused.

karliss commented 5 years ago

Looks like qurt/src/px4_layer/drv_hrt.c is also unused.

karliss commented 5 years ago

Added dsp_offset usage back, seemed to work.