Is there a mavlink message that has the current flight time? Or what time the vehicle last took off so flight time could be calculated? I know these can be displayed in mission planner, but I’m using a c++ interface to drive the autopilot. I’m assuming mission planner just watches for the change to in-flight and then calculates flight based on that (since it only resets of you disconnect/reconnect mission planner)
I didn’t see anything in there about flight time. I can send and receive mavlink messages no problem, upload missions, download missions, set params, etc.
I don’t see any parameters. Not sure if you can read this parameter value STAT_FLTTIME remotely via Mavlink while in flight. That might be the only solution.
Was also wondering about this the other day so I quickly took a glance at the code.
There seems to be a section which is updated every second and if the autpilot is armed AND the throttle is above 12% OR the ground speed is above 3m/s a variable (“timeInAir”) keeping the time (in seconds) is increased.
There is also a second variable which is increased, “timeSinceArmInAir” which is set to 0 as long as the autopilot is not armed.
Here is a screenshot of that snippet that gets updated every second: