I'm trying to display the current time down to the microsecond (for latency measurements) after each command sent in a script, but everything smaller than a second appears as All Zeroes!

How can I get Mission Planner to display the current time down to the microsecond in the script console???

This is the output I get in Mission Planner:

 3691094807?profile=original

Here's a portion of the code for the script I'm using [Link to the full script being run]:

3691094729?profile=original

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    try

    import System

    dt = System.DateTime.Now
    st = dt.ToString("yyyy-MM-ddTHH:mm:ss.fff") + ' setting wp 1'

    print st

    System.Console.WriteLine(st)

    • This helped! Thanks!!!

      But now I need Mission Planner to display in the HUD the time down to the millisecond (even better: microsecond!) when I load a telemetry log...

      Do you know off hand which file I need to modify to implement this change?

      • Developer

        is this for realtime, or post processing?

        • Disregard the Mission Planner HUD mod... I'm able to use the output from mavlogdump.py (in the pymavlink library) to identify the time of different events.

          However, can you tell me if Mission Planner tlog files record both the transmitted command FROM Mission Planner along with the data received from the APM?

          I ask because I noticed that when I send one command (e.g., "SET_MODE"), the .tlog shows it twice — is one the Mission Planner transmission, and the second an immediate response from the APM? Because the MISSION_ACK doesn't come until later (not immediately following the transmitted command)

        • I'm using it for post processing... I have the script displaying the timestamp of when the command was processed/transmitted; now I need the exact microsecond (or millisecond if that's the best I can get) that the telemetry indicates the command was processed on the APM.

          For clarity: The command MAV.setGuidedModeWP(item) is run in the script, immediately followed by a print statement displaying the timestamp: "2014-02-07 17:09:19.767205 Guiding to WP 1"

          THEN, I see the mode change on the HUD about ½ second later... I need to know exactly when the mode changes to determine the precise latency.

          THANKS!!

This reply was deleted.

Activity

DIY Drones via Twitter
23 hours ago
DIY Robocars via Twitter
RT @Heavy02011: @diyrobocars : A Home-brew computer club* for Connected Autonomous Driving on Jan 23rd, 2021 https://www.meetup.com/Connected-Autonomous-Driving/events/275728684/ #Meetu…
23 hours ago
DIY Robocars via Twitter
23 hours ago
David Hori liked Isabella Domi's profile
Wednesday
DIY Robocars via Twitter
RT @Heavy02011: ⁦@diyrobocars⁩ Autonomous Driving Assembly at #rC3. join us at https://rc3.world/rc3/assembly/diyrobocars-f1tenth/ ⁦@f1tenth⁩ ⁦@DAVGtech⁩ ⁦@DWalmroth⁩…
Monday
DIY Robocars via Twitter
RT @chr1sa: New car designs coming for our next @DIYRobocars @donkey_car virtual race on the 23rd. Choose any one you want at race time Le…
Monday
DIY Robocars via Twitter
RT @RoboticMasters: Thanks to @EllerbachMaxime and the Sydney Uni Capstone Students the @donkey_car @diyrobocars simulator is getting a ma…
Monday
DIY Robocars via Twitter
Jan 6
DIY Robocars via Twitter
Dec 28, 2020
DIY Robocars via Twitter
An interesting line-following simulator to use with with your robocars: https://github.com/ron-grant/LFS
Dec 23, 2020
DIY Robocars via Twitter
Dec 23, 2020
DIY Robocars via Twitter
An improved version of the @IntelAIResearch OpenBot: https://diyrobocars.com/2020/12/14/an-improved-version-of-the-intel-openbot/
Dec 14, 2020
DIY Drones via Twitter
An improved version of the Intel OpenBot https://ift.tt/2KkHT8Q
Dec 14, 2020
DIY Robocars via Twitter
Dec 10, 2020
DIY Robocars via Twitter
RT @KN_Richardson: Delivery 📦😬 Early xmas present from @ccbdcdt ! Sims ready, will put h/w together over Christmas break. Didn’t need to mo…
Dec 7, 2020
DIY Robocars via Twitter
RT @RoboticMasters: Did we mention there's new car models in the #donkeycar simulator too? Here is an RB16 from team @redbull @donkey_ca…
Dec 7, 2020
More…