Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL SDK and Software
  3. PX4 timesync via for Voxl2

PX4 timesync via for Voxl2

Scheduled Pinned Locked Moved Unsolved VOXL SDK and Software
voxl-sdk
3 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jmltt
    Regular
    wrote on last edited by
    #1

    Where and how are incoming mavlink timesync request handled within the voxl-sdk?

    I know PX4 uses timesync via mavlink to remap incoming odometry message sample timestamps. I wrote a voxl service to receive incoming mocap data and send it to PX4 the same way VIO data is in voxl-vision-hub. I have an ntp server syncing groundstation and vehicle clocks and a separate service to get monotonic boot time from voxl so i can remap the incoming mocap timestamps to be in the same frame as the vio data. I'm getting the following warning constantly in my log whenever i start sending mocap data as odom though:

    [timesync] RTT too high for timesync: 86 ms

    It looks like PX4 is tossing the sample timestamp whenever it sends this warning and I'm worried the transit latency is too high for PX4 to assume incoming mocap is realtime

    My mocap server is a stripped down version of voxl-vision-hub with some added functionality for receiving data from the gcs and formatting the odom data. I'm wondering if I left out something that vvh is doing to handle the timesync, but I'm not sure.

    Thanks!

    ModeratorM 1 Reply Last reply
    0
    • J jmltt

      Where and how are incoming mavlink timesync request handled within the voxl-sdk?

      I know PX4 uses timesync via mavlink to remap incoming odometry message sample timestamps. I wrote a voxl service to receive incoming mocap data and send it to PX4 the same way VIO data is in voxl-vision-hub. I have an ntp server syncing groundstation and vehicle clocks and a separate service to get monotonic boot time from voxl so i can remap the incoming mocap timestamps to be in the same frame as the vio data. I'm getting the following warning constantly in my log whenever i start sending mocap data as odom though:

      [timesync] RTT too high for timesync: 86 ms

      It looks like PX4 is tossing the sample timestamp whenever it sends this warning and I'm worried the transit latency is too high for PX4 to assume incoming mocap is realtime

      My mocap server is a stripped down version of voxl-vision-hub with some added functionality for receiving data from the gcs and formatting the odom data. I'm wondering if I left out something that vvh is doing to handle the timesync, but I'm not sure.

      Thanks!

      ModeratorM Offline
      ModeratorM Offline
      Moderator
      ModalAI Team
      wrote on last edited by
      #2

      @jmltt https://gitlab.com/voxl-public/voxl-sdk/services/voxl-mavlink-server/-/blob/master/src/mavlink_services.c?ref_type=heads#L48

      J 1 Reply Last reply
      0
      • ModeratorM Moderator

        @jmltt https://gitlab.com/voxl-public/voxl-sdk/services/voxl-mavlink-server/-/blob/master/src/mavlink_services.c?ref_type=heads#L48

        J Offline
        J Offline
        jmltt
        Regular
        wrote on last edited by
        #3

        @Moderator Thanks for the response. Follow up question, are the voxl-side timesync requests only used for updating gps timestamps?

        After reading the code you linked and running mavlink-server in timesync debug mode I think that the only thing not working is the voxl timesync requests. It looks like when I start sending hil_gps or odometry mavlink messages to the autopilot pipe, one of the autopilot's responses to the voxl timesync requests is dropped or comes in after a new value for last_voxl_time_sent is generated. Then the timesync handler can't recover because it's getting responses that are 1 step behind moving forward (see below).

        Since it looks like it continues to get reasonable values for now-ts1 for the autopilot requests, I don't think this is an issue depending on what voxl-side timesync is being used for. Not sure why I'm getting the RTT too high warning in my PX4 log though

        output from mavlink server timesync debug mode at the point when I started sending odom/gps mavlink messages to the autopilot:

        sending our own ts request at 408744677609
        ap ms ahead of voxl:       -0.2ms
        timesync: now-ts1 = 0.6ms
        sending our own ts request at 408845331615
        ap ms ahead of voxl:       -0.3ms
        timesync: now-ts1 = 0.9ms
        sending our own ts request at 408945169337
        timesync: now-ts1 = 0.2ms
        sending our own ts request at 409044439310
        timesync: now-ts1 = 0.3ms
        sending our own ts request at **409145346227**
        timesync: now-ts1 = 0.5ms
        sending our own ts request at **409244599326**
        unknown timesync request ts1 = **409145346227** tc1 = 409263819000 last_voxl_time_sent = 409244599326
        timesync: now-ts1 = 0.3ms
        sending our own ts request at 409345147918
        unknown timesync request ts1 = **409244599326** tc1 = 409406867000 last_voxl_time_sent = 409345147918
        timesync: now-ts1 = 0.2ms
        sending our own ts request at 409445248290
        unknown timesync request ts1 = 409345147918 tc1 = 409506047000 last_voxl_time_sent = 409445248290
        timesync: now-ts1 = 0.2ms
        sending our own ts request at 409545084726
        unknown timesync request ts1 = 409445248290 tc1 = 409608198000 last_voxl_time_sent = 409545084726
        timesync: now-ts1 = 0.4ms
        sending our own ts request at 409645091472
        unknown timesync request ts1 = 409545084726 tc1 = 409717154000 last_voxl_time_sent = 409645091472
        
        
        1 Reply Last reply
        0

        Reading along? Create a free ModalAI Forum account to join in.

        With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.

        Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        ModalAI
        Categories Recent Tags ModalAI.com Docs
        © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups