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
Review of the new Nivida Jetson NX for robocars https://t.co/bWjd3sH2o4
yesterday
DIY Robocars via Twitter
RT @chr1sa: My review of the new @NVIDIAEmbedded Jetson Xavier NX in robotics and @DIYRobocars applications https://t.co/O7TfJZhiF9 https:/…
yesterday
DIY Drones via Twitter
RT @chr1sa: Somehow I missed this, but last week @Nvidia released a new version of its Isaac robot development framework. Lots of new Lidar…
Monday
DIY Robocars via Twitter
RT @Smartphone89: DonkeyCar Racing League Korea #donkeycar @diyrobocars https://t.co/mDlHDR1d98
Friday
Jørn Ramnæs liked VIDEO LINK's profile
Friday
Mark Harrison left a comment on Moderators
"Wow, Ning2 looks really great on mobile. I had sort of drifted away as my browse-time went more on my phone, so this is great."
Friday
Hank Deucker left a comment on PIXHAWK
"I am sure most will say not again, Pixhawk telemetry. I do need help and all can be reassured that I have spent many hours scouring the net for useful information. I am not new at quadcopter flying, I started in 2012 and have progressed through many…"
Thursday
DIY Robocars via Twitter
https://t.co/rLmFr8M2UK
Thursday
Hank Deucker left a comment on PIXHAWK
"Tomorrow, I am thinking about the wording at the moment."
May 28
DIY Drones via Twitter
Welcome to the new DIY Drones design!. You may have noticed that DIY Drones looks a little different today. That's… https://t.co/cg2EmeDGMQ
May 27
DIY Drones via Twitter
New! Online Training on Drones for Disaster Response https://t.co/brqRuujjY2
May 26
DIY Robocars via Twitter
https://t.co/8EMCvYW6oz
May 25
DIY Robocars via Twitter
RT @OttawaAVGroup: We are going to try something new this week. We will be having a drop-in style meeting Wednesday @ 7-9pm EST. Pop in and…
May 25
DIY Robocars via Twitter
RT @tawnkramer: Thanks Everyone for another fun virtual race! Amazing Ai racers competing head-to-head, Virtual Makers Fair event. Catch us…
May 23
DIY Robocars via Twitter
RT @make: Find out the latest from @diyrobocars at 10am PT from @chr1sa of @3DRobotics on Virtually Make Faire! #makerfaire #maketogether #…
May 23
DIY Robocars via Twitter
RT @Heavy02011: Join us Saturday online: Virtual Race League: @DIYRobocars Race #2 - Parking Lot Nerds https://t.co/aJUu4sdutx #Meetup via…
May 22
More…