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

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL Dev Drones
  3. Qualcomm Flight RB5 5G Drone
  4. RB5 System Clock Issues

RB5 System Clock Issues

Scheduled Pinned Locked Moved Qualcomm Flight RB5 5G Drone
rb5steady clocksystem clocksynchronizationlinux
4 Posts 1 Posters 1.4k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    eric
    wrote on last edited by eric
    #1

    Hello,

    We've noticed that on our RB5, the system clock seems very unstable, even with chrony disabled and internet off.

    We have captured system clock vs steady (monotonic) clock, and plotted the difference in time.

    For the RB5, it appears that that a bias is randomly introduced, almost as if something is trying and failing to synchronize the system clock.

    See the following plots, showing the issue on RB5 vs m500.

    2080185d-a833-4f47-9101-d421efb260c0-image.png

    9168f0cc-77d5-42b5-a1b8-7532aa1205ee-image.png

    This issue makes the system clock unusable. How can we resolve this issue for the RB5? This causes big problems when using ROS, because ROS uses the system clock for timing.

    Using SDK 0.9.5 on RB5, see this post for additional system information: https://forum.modalai.com/post/11990

    Here is a script you can use to reproduce these issues:

    #include <iomanip>
    #include <fstream>
    #include <chrono>
    #include <iostream>
    #include <thread>
    
    int main(int argc, char **argv)
    {
        // Create file to record clock stamps
        std::ofstream filestream;
        filestream.open("clocks_log.csv");
        if (!filestream.is_open()) {
            std::cerr << "Could not open log file" << std::endl;
            return 1;
        }
    
        // Write CSV headers to the file
        filestream << "chrono_system_clock,chrono_steady_clock\n";
    
        // Record stamps to 9 decimal places
        filestream << std::fixed << std::setprecision(9);
    
        // Define variables for storing time
        std::chrono::steady_clock::time_point steady_stamp;
        std::chrono::system_clock::time_point system_stamp;
    
        // Capture start time for both clocks
        const std::chrono::steady_clock::time_point steady_start = std::chrono::steady_clock::now();
        const std::chrono::system_clock::time_point system_start = std::chrono::system_clock::now();
    
        for (int i=0; i < 60000; ++i)
        {
            // Capture time stamps for both clocks
            steady_stamp = std::chrono::steady_clock::now();
            system_stamp = std::chrono::system_clock::now();
    
            // Capture change in time since start (in seconds)
            auto steady_seconds = std::chrono::duration<double>(steady_stamp - steady_start).count();
            auto system_seconds = std::chrono::duration<double>(system_stamp - system_start).count();
    
            filestream << system_seconds  << "," << steady_seconds << "\n";
    
            // Note that this is not an expected stamp dt
            std::this_thread::sleep_for(std::chrono::microseconds(1000));
        }
    
        // Close the file
        filestream.close();
    
        return 0;
    };
    

    You can then run this python script to visualize the data:

    import pandas as pd
    
    
    df = pd.read_csv('clocks_log.csv', dtype=np.float64)
    
    # Plot the differences in each time series versus chrono steady
    plt.title("Difference between Steady and System Time")
    plt.scatter(df.index, df['chrono_system_clock'] - df['chrono_steady_clock'], 0.1)
    plt.ylabel('Difference (s)')
    plt.xlabel('Sequence ID')
    plt.show()
    

    Again, no issues for us when testing on our own PCs or on the m500, but significant issues on the RB5.

    E 1 Reply Last reply
    0
    • E eric referenced this topic on
    • E eric

      Hello,

      We've noticed that on our RB5, the system clock seems very unstable, even with chrony disabled and internet off.

      We have captured system clock vs steady (monotonic) clock, and plotted the difference in time.

      For the RB5, it appears that that a bias is randomly introduced, almost as if something is trying and failing to synchronize the system clock.

      See the following plots, showing the issue on RB5 vs m500.

      2080185d-a833-4f47-9101-d421efb260c0-image.png

      9168f0cc-77d5-42b5-a1b8-7532aa1205ee-image.png

      This issue makes the system clock unusable. How can we resolve this issue for the RB5? This causes big problems when using ROS, because ROS uses the system clock for timing.

      Using SDK 0.9.5 on RB5, see this post for additional system information: https://forum.modalai.com/post/11990

      Here is a script you can use to reproduce these issues:

      #include <iomanip>
      #include <fstream>
      #include <chrono>
      #include <iostream>
      #include <thread>
      
      int main(int argc, char **argv)
      {
          // Create file to record clock stamps
          std::ofstream filestream;
          filestream.open("clocks_log.csv");
          if (!filestream.is_open()) {
              std::cerr << "Could not open log file" << std::endl;
              return 1;
          }
      
          // Write CSV headers to the file
          filestream << "chrono_system_clock,chrono_steady_clock\n";
      
          // Record stamps to 9 decimal places
          filestream << std::fixed << std::setprecision(9);
      
          // Define variables for storing time
          std::chrono::steady_clock::time_point steady_stamp;
          std::chrono::system_clock::time_point system_stamp;
      
          // Capture start time for both clocks
          const std::chrono::steady_clock::time_point steady_start = std::chrono::steady_clock::now();
          const std::chrono::system_clock::time_point system_start = std::chrono::system_clock::now();
      
          for (int i=0; i < 60000; ++i)
          {
              // Capture time stamps for both clocks
              steady_stamp = std::chrono::steady_clock::now();
              system_stamp = std::chrono::system_clock::now();
      
              // Capture change in time since start (in seconds)
              auto steady_seconds = std::chrono::duration<double>(steady_stamp - steady_start).count();
              auto system_seconds = std::chrono::duration<double>(system_stamp - system_start).count();
      
              filestream << system_seconds  << "," << steady_seconds << "\n";
      
              // Note that this is not an expected stamp dt
              std::this_thread::sleep_for(std::chrono::microseconds(1000));
          }
      
          // Close the file
          filestream.close();
      
          return 0;
      };
      

      You can then run this python script to visualize the data:

      import pandas as pd
      
      
      df = pd.read_csv('clocks_log.csv', dtype=np.float64)
      
      # Plot the differences in each time series versus chrono steady
      plt.title("Difference between Steady and System Time")
      plt.scatter(df.index, df['chrono_system_clock'] - df['chrono_steady_clock'], 0.1)
      plt.ylabel('Difference (s)')
      plt.xlabel('Sequence ID')
      plt.show()
      

      Again, no issues for us when testing on our own PCs or on the m500, but significant issues on the RB5.

      E Offline
      E Offline
      eric
      wrote on last edited by
      #2

      @Moderator, has anyone been able to replicate this issue? Is this there a known solution to this?

      E 1 Reply Last reply
      0
      • E eric

        @Moderator, has anyone been able to replicate this issue? Is this there a known solution to this?

        E Offline
        E Offline
        eric
        wrote on last edited by
        #3

        @Moderator, we've observed that when we kill voxl-px4-imu-server, the timing discrepancy disappears. We of course need this to be running to get IMU data, but this process at least seems to be related to the issue.

        E 1 Reply Last reply
        0
        • E eric

          @Moderator, we've observed that when we kill voxl-px4-imu-server, the timing discrepancy disappears. We of course need this to be running to get IMU data, but this process at least seems to be related to the issue.

          E Offline
          E Offline
          eric
          wrote on last edited by
          #4

          FWIW, we are not seeing this issue on the VOXL2 flightdeck (which does not use voxl-px4-imu-server)

          @Moderator Is there someone else I should tag for this issue if you are unable to provide support?

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          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