Welcome to PhantomPilots.com

Sign up for a weekly email of the latest drone news & information

Made my own Flight Log App - comments please!

Discussion in 'Pro/Adv Discussion' started by phuocsandiego, Feb 24, 2016.

  1. phuocsandiego

    Joined:
    May 3, 2015
    Messages:
    151
    Likes Received:
    65
    Location:
    San Diego, CA
    Well, after thinking about it a little bit over the weekend, I decided, what the hell? Let's put some of that education to work so I put together my own program to allow me to go over my own flight logs. Here's the super alpha version. I'd love to get the community's thoughts and ideas. What do you think? Continue? Abandon this foolish quest? Go have a beer?

    Like I said, right now it's like in pre-Alpha version so it's not even close to being released ready yet. But it does work for what it does at the moment. The current features are:
    1. Import flight records from Litchi.
    2. Display the flight map/path using Google Maps.
    3. Display relevant flight information like date, time, top speed, distance, etc.

    Upcoming immediate features:
    - Power/battery information
    - Sensors information

    Longer term features:
    - Read DJI Go App flight records natively. Currently the app only works with Litchi logs as those are in a plain CSV format that's easy to read. DJI Go App produces a binary file that has to be decoded. You can work around it by loading it into FlyLitchi.com and having the site convert to CSV for you but that's clunky. I'll make it native to my app.
    - Perhaps read the .DAT files directly from the drones for even more data.

     
    jonne, Ken Hanks, GadgetGuy and 6 others like this.
  2. eaglegoaltender

    Joined:
    Jan 13, 2016
    Messages:
    743
    Likes Received:
    274
    Hmm.....let's see.............ok, continue and go have a beer!

    Looks good to me and after only a day and a half. Looks like a long time between flights from Oct/15 - Feb/16?

    I haven't really dealt into any of that kind of work - good luck to you and will be looking forward to see where you take this.
     
  3. skitchen8

    Joined:
    Feb 6, 2016
    Messages:
    30
    Likes Received:
    14
    Looks great so far

    What platform are you making it for? I've been thinking about making one myself just haven't had time to start work on it yet.
     
  4. Kenotic

    Joined:
    Feb 7, 2016
    Messages:
    6
    Likes Received:
    0
    Looks go so far. What language are you programing it in?
     
  5. T Dunkin

    Joined:
    Dec 24, 2015
    Messages:
    30
    Likes Received:
    6
    Looks very nice....Stop drinking and get back to work!
     
  6. wheeliesteve

    Joined:
    Jan 29, 2016
    Messages:
    151
    Likes Received:
    19
    Looks good so far!
     
  7. phuocsandiego

    Joined:
    May 3, 2015
    Messages:
    151
    Likes Received:
    65
    Location:
    San Diego, CA
    I went and had my beer after that post. :)

    Part of why you don't see as many flights there is because I haven't loaded them all in yet. Although I'll admit I don't get to fly as much as I would like.
     
  8. phuocsandiego

    Joined:
    May 3, 2015
    Messages:
    151
    Likes Received:
    65
    Location:
    San Diego, CA
    Writing it in Python so it should work on Windows, Mac or Linux. You can distribute Python programs as native binaries via wrapper these days so they're almost like compiled applications and do not need a Python install on the system.
     
  9. phuocsandiego

    Joined:
    May 3, 2015
    Messages:
    151
    Likes Received:
    65
    Location:
    San Diego, CA
    I'm doing it in Python. It's awesome to just make stuff FAST!
     
  10. skitchen8

    Joined:
    Feb 6, 2016
    Messages:
    30
    Likes Received:
    14
    Any thoughts of sharing source and making it a community effort?

    I love healthydrones for what they've done for the community, but something like a log file viewer is practically begging to be an open source project. When I first thought of trying to figure out the log files I imagined a project that would work with all the major apps (ie litchi, go, autopilot, etc.) and also eventually work with things like dat files to create a resource that could help the entire community.
     
    phuocsandiego likes this.
  11. Jcarlson1701

    Joined:
    Feb 10, 2016
    Messages:
    86
    Likes Received:
    13
    Looks great so far. Once native DJI Go importing is implemented it will be a very useful tool


    Sent from my iPhone using PhantomPilots mobile app
     
  12. Alien Warrior

    Joined:
    Jul 11, 2015
    Messages:
    96
    Likes Received:
    31
    You have my encouragement ;)
     
  13. phuocsandiego

    Joined:
    May 3, 2015
    Messages:
    151
    Likes Received:
    65
    Location:
    San Diego, CA
    I don't mind sharing at all. In fact, that's what I was thinking when I started this project. All of the stuff I've done thus far are based on what others have in some form or fashion. Feel free to ask me anything and I'll do my best to answer. Here's the basis of the program so far:

    - Python 3
    - PyQt4 for the GUI
    - SQLite for the database

    I'm basically creating a QMainWindow() application with a tabbed interface using QTabWidget() to manage the individual layouts. Layouts themselves are composed of individual GUI elements like labels, text fields, tables, and buttons. I can position those elements any which way I choose. I'm still playing with it so the look & feel may change yet. A QWebView() is used to display the Google Map. I wrote the functions to generate the HTML and Javascript code that goes into that QWebView() to actually display the map itself using the Google Map API. Other functions are connected to different elements to do different things: for example, double-clicking on a date in the flight list queries the SQLite database to pull up all the data points for that flight. For things like max. altitude or max. speed, I can just query that directly. For others like battery temp, I use SQL's Max() to find the maximum value in the database which is then converted to Fahrenheit.

    The map itself is drawn with a path that is composed of latitude & longitude points that's then passed to the Google Map API. It takes the form of a tuple of tuples which is easy to get from the database.

    For power/battery information which I'm working on now, I plan to use Matplotlib to do the charting. My BIGGEST hurdle is to figure out how to convert the DJI Go app logs into a format I can work with. I have some studying to do but I'm confident it can be done. Any help or suggestion there is most welcomed. I've only started learning Python about 3 weeks ago so I'm still picking up a lot of tricks. I have a pretty decent background in other languages though so it's not hard to pick it up. I'm pretty amazed at what I can do with it in so little code... what you see now takes less than 900 lines... it's messy and non-Pythonic as I'm still learning it but it works. If I did this in Java or C++ it'll easily be 5-6 times the code base at least!

    Any other direct questions? Can you program in Python?
     
  14. Richard W

    Joined:
    Dec 16, 2015
    Messages:
    115
    Likes Received:
    27
    Location:
    East Coast, USA and CANADA
    Interesting and interested ... it's going to be a great utility once you get over DJI GO native data format hump. Carry on ... and thanks!
     
  15. Richard W

    Joined:
    Dec 16, 2015
    Messages:
    115
    Likes Received:
    27
    Location:
    East Coast, USA and CANADA
    Something interesting poped up when searching this forum ... potential for collaboration and code sharing. Check this out ...

    free-phantom-3-flight-log-viewer
    I'm working on building a free log viewer to view data from Phantom 3 TXT flight logs. My idea is to build a tool that will summarize the flight log and allow all data to be downloaded in CSV format for those who want to do detailed research and/or import the data into another application.

    Free Phantom 3 Flight Log Viewer

    node-js-log-parser
    I couldn't find any code out there for parsing DJI log files, so I wrote a small npm library for doing it.

    node.js log parser
     
    schroeder1959 and phuocsandiego like this.
  16. phuocsandiego

    Joined:
    May 3, 2015
    Messages:
    151
    Likes Received:
    65
    Location:
    San Diego, CA
    That's awesome. Now I have something to play with. :)
     
  17. alokbhargava

    Joined:
    Sep 28, 2015
    Messages:
    5,145
    Likes Received:
    1,664
    Location:
    San Francisco, CA
    We need alternatives to HealthyDrones. Thanks for the initiative.
     
    skitchen8 likes this.
  18. skitchen8

    Joined:
    Feb 6, 2016
    Messages:
    30
    Likes Received:
    14
    I'm about as far into Python as you, a little more time but probably not much more knowledge. My experience has mostly been in other languages in the past but I recently found another project that interested me that was written in Python, and I've found that I really like it as a language so I started to teach myself how it works. As you've stated it's a very portable language and therefore very powerful.

    I will probably start decoding some Go log files soon. If you want to put something up on Git I think we can probably start pulling a full featured project together. I have a new P3A and a newborn daughter so I can't promise a ton of dev hours right now but I am definitely interested in contributing as much as I can, and from what I've seen there's a lot of people looking for a project to contribute to.
     
  19. Noodle

    Joined:
    Oct 29, 2015
    Messages:
    535
    Likes Received:
    178
    Location:
    Sydney, Australia
    Will this be an alternative to Healthy Drones? It seems like since Healthy Drones has gone paid-subscription service, lots of people are now starting to look for other free alternatives. I wonder people give encouragement to you as "just hurry up and create this free app, so we can have our flight logs and not having to pay Healthy Drones". :tearsofjoy:
     
    n6vmo likes this.
  20. Muva Bee

    Joined:
    Jan 3, 2016
    Messages:
    87
    Likes Received:
    44
    what about doing some "proper" open source project. I'm low with my free time, but fine with ruby & node and would love to spend some nightly hours
     
    phuocsandiego likes this.