Made my own Flight Log App - comments please!

Very nice work and soon to be unselfishly shared with members hats off to you.......phuocsandiego

The program now gives some hopefully useful voltage information for the battery and individual cells

I wouldn't have a clue as to coding or building anything like you are doing so, forgive me if the question here if it is "off the wall" so to speak.

Looking at your battery voltage information on the video and the plot applying time (milliseconds) on the X scale --- is it possible to view that 3 second sample you were showing "live time" as you fly or is this strictly for use after a flight via the logs?

Impressive work you are doing.....continued good luck.
 
Last edited:
Looks like you're making a lot of progress. Python has some real advantages.

I'm interested to know how you're doing the map interface. I had considered doing the map interface as a component of DatCon and not creating a .kml that's then displayed with Google Earth. Doing that required a license and a key from Google. It's free and easy but then that key would have to be part of the executable that gets distributed. I was uncomfortable with doing that. Do you have any insight on this?

Hi Bud,

I'm not nearly as proficient at Java, although I've started to learn and then put it on hold while I was doing a bunch of projects like this one, my stock charting program, and my movie database... but I'll pick it back up. Here's what I did in my program to integrate Google Maps:

1. Google Maps can be accessed via an HTML document that you can create dynamically in your program or save it to the local computer (or network computer) and provide the relevant URI. A simple HTML document for this looks like:

latitude = 32.948907
longitude = -117.242190
html_source = """
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js? sensor=false">
</script>
<script type="text/javascript">
var map;
var markers = [];
var defaultLocation = new google.maps.LatLng("""+str(latitude)+""", """+str(longitude)+""");
var defaultZoomLevel = 15;

function initialize()
{
var myOptions =
{
zoom: defaultZoomLevel,
center: defaultLocation,
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
</script>
</head>

<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%">
</div>
</body>
</html>
"""

latitude, longitude, html_source are variables holding exactly what you think they hold. The triple quotes is just Python's way of making a long string. You have to convert the lat & long which are floats into strings so you can concatenate them to the HTML document. You can see the line that says var defaultLocation = blah blah in the Javascript section of the HTML header. That sets the home location. This and other functions like paths, etc. are described in the Google Maps API.

2. My application just reads in the data from the logs and programmatically creates the appropriate Javascript for paths, etc. which is then inserted into the HTML document above on the fly.

3. My application has a QWebView component to display HTML from code, a file, the web, etc. QWebView is WebKit based so is very compatible with most modern web technologies. You can tell that I'm using PyQt, specifically PyQt4, from the QWebView component for my GUI. PyQt is just a Python wrapper for the mature C++ based Qt GUI interface. With QWebView, I feed it the dynamically created HTML to display. The code looks like this:

class WebPage(QWidget):
global web_page_source
def __init__(self):
QWidget.__init__(self)
self.setWindowTitle("HTML Page")
gridLayout = QGridLayout()


map = QWebView()
map.setHtml(html_page_source)
gridLayout.addWidget(map)


self.setLayout(gridLayout)

The rest is pretty straight forward PyQt stuff. I'm sure with little effort you can convert this into similar Java Swing code or whatever framework you're using for your GUI. Good luck and let me know if you have any questions!
 
Very nice work and soon to be unselfishly shared with members hats off to you.......phuocsandiego



I wouldn't have a clue as to coding or building anything like you are doing so, forgive me if the question here if it is "off the wall" so to speak.

Looking at your battery voltage information on the video and the plot applying time (milliseconds) on the X scale --- is it possible to view that 3 second sample you were showing "live time" as you fly or is this strictly for use after a flight via the logs?

Impressive work you are doing.....continued good luck.

That may be possible if you created an app that was controlling the drone itself like Litchi (which I love) or Auto Pilot. I'm not sure though as I've not had to dig into the API from DJI on the drones so I can't say for certain. My program on the other hand simply presents the log data from Litchi after the fact and displays it in a useful format.
 
Awesome of you to share such a valuable tool. Best of coding and flying to you.
 
Looks very promising! I went ahead and paid a full year's subscription to Healthy Drones, but I am always looking for an alternative or backup to what I currently have. Thank you ahead of time for your hard work and dedication to this project! Best of luck!!!
 
Any updates to this?


Sent from my iPad using PhantomPilots mobile app

I'm still working on this but have been battling the flu the last week so I've gone incognito. Just barely getting back to my feet. My biggest challenge is to figure the DJI Go app flight log format. I've figure out a few things but it everything. I'll let everyone know how it's coming. :)
 
I'm still working on this but have been battling the flu the last week so I've gone incognito. Just barely getting back to my feet. My biggest challenge is to figure the DJI Go app flight log format. I've figure out a few things but it everything. I'll let everyone know how it's coming. :)

Sorry to hear that. Hope you're feeling better.


Sent from my iPad using PhantomPilots mobile app
 
Get well soon, and thank you for this very promising application, you are a true cavalier to share your hard work with the community, I'd like to hand you out a beer or two if that's possible :)
 
Get well soon, and thank you for this very promising application, you are a true cavalier to share your hard work with the community, I'd like to hand you out a beer or two if that's possible :)
Eine Maß, bitte! :D
 
  • Like
Reactions: Elysion
would you like to share the work with fellow developer? I have some 10+ years of experience in coding. I also have the similar thought of creating an offline log viewer using python. Now trying to learn how to decode the .DAT file and convert to CSV. If anybody can help me then it will be really useful. Sharing code or sharing how the log is encoded, anything is fine.

thanks in advance
 
  • Like
Reactions: manju91080
Hum, what happen with @phuocsandiego ?

This is a year old.

Rod
 
Yeah, what happened was life unfortunately. I moved to Washington D.C. for a year to take care of a very complicated project and didn't even have time to fly my Phantom let alone do any programming. I hired someone to take over the remainder of that project and am now back in San Diego with a mini project in San Francisco and then I should be done. I picked up a Mavic Pro in the meantime for an upcoming European trip to the UK, Italy and Greece in late summer/early fall. And I just started to get back into my programming hobby. Sorry everyone for the LONG absence.

So in light of all this, I've decided to release the Python code I wrote to the community. It was written in Python 3. Modules included PyQT4 for the GUI and matplotlib for plotting/graphing. SQLite is the database. All are freely available. To be fully transparent, I did this project after learning Python for about a month. I'm also not a coding expert by any means. I had some tinkering way back when in BASIC and do a little bit of VBA macros for Excel. I think I took an introductory CS course in C++ 20 years ago and have probably forgotten 99+% of it. But that's it. So if you think the code is messy, it probably is. If you think some of the algorithms could be better, it most definitely could be. I think Python is great though - you can do very useful things with it quickly, so I'm eager to start picking it back up now that I have a very little bit of time to spread between flying again, photography and a little bit of programming. So please be gentle but I welcome constructive criticism. If there's any questions I can answer, feel free to ask and I'll do my best to remember what/why I did what.

@BudWalker has done some great stuff too, but in Java. If anyone or a group of people want to mess around with this and improve it, please by all means. I retain the copyright to this version but give anyone the right to change/improve/etc. it provided you're going to share it with everyone else. And all the blah blah blah legalese that goes with that. Anyways, I hope you all find this useful and/or instructive. I'll be uploading the Python source and my SQLite database of some flights. I've had to rename the .RAR file to .TXT to get it upload. Please rename the extension after you've downloaded it.
 

Attachments

  • Flight_Log_1.0.5.txt
    8.2 MB · Views: 126
  • Like
Reactions: hms
Yeah, what happened was life unfortunately. I moved to Washington D.C. for a year to take care of a very complicated project and didn't even have time to fly my Phantom let alone do any programming. I hired someone to take over the remainder of that project and am now back in San Diego with a mini project in San Francisco and then I should be done. I picked up a Mavic Pro in the meantime for an upcoming European trip to the UK, Italy and Greece in late summer/early fall. And I just started to get back into my programming hobby. Sorry everyone for the LONG absence.

So in light of all this, I've decided to release the Python code I wrote to the community. It was written in Python 3. Modules included PyQT4 for the GUI and matplotlib for plotting/graphing. SQLite is the database. All are freely available. To be fully transparent, I did this project after learning Python for about a month. I'm also not a coding expert by any means. I had some tinkering way back when in BASIC and do a little bit of VBA macros for Excel. I think I took an introductory CS course in C++ 20 years ago and have probably forgotten 99+% of it. But that's it. So if you think the code is messy, it probably is. If you think some of the algorithms could be better, it most definitely could be. I think Python is great though - you can do very useful things with it quickly, so I'm eager to start picking it back up now that I have a very little bit of time to spread between flying again, photography and a little bit of programming. So please be gentle but I welcome constructive criticism. If there's any questions I can answer, feel free to ask and I'll do my best to remember what/why I did what.

@BudWalker has done some great stuff too, but in Java. If anyone or a group of people want to mess around with this and improve it, please by all means. I retain the copyright to this version but give anyone the right to change/improve/etc. it provided you're going to share it with everyone else. And all the blah blah blah legalese that goes with that. Anyways, I hope you all find this useful and/or instructive. I'll be uploading the Python source and my SQLite database of some flights. I've had to rename the .RAR file to .TXT to get it upload. Please rename the extension after you've downloaded it.
Much respect for coming back and sharing this, that's what community is all about and love seeing it. Do you know what the latest version of logs the tool worked on?
 
Much respect for coming back and sharing this, that's what community is all about and love seeing it. Do you know what the latest version of logs the tool worked on?

I'm not entirely sure. I primarily fly with Litchi and my guess would be that it works with whatever version from at least mid- to late summer 2016. That's when I took a long hiatus from flying.
 
  • Like
Reactions: Digdat0

Recent Posts

Members online

No members online now.

Forum statistics

Threads
143,090
Messages
1,467,565
Members
104,974
Latest member
shimuafeni fredrik