Creating a mission programmatically

Joe Desbonnet

I'd like to create a mission using a python script. It will feature a combination of maps, photos, panos at pre-defined locations pulled from a database.  I'd like the script to create a Dronelink import file so that there is no further touch up required within the Dronelink app ... just upload a batch of missions and fly them.

I see there is KML upload etc, but that seems to require many steps after import before the mission is ready to fly.

I'm guessing the .dronelink file is the format is what I should be using, but I can't find any documentation on this format. 

Any pointers would be greatly appreciated.

 

0

Comments

7 comments

  • Comment author
    Daniel Snyder
    • Edited

    Try to first export a .csv file from Litchi (to see all required field - there are a lot) and then reverse populate the entire record including all Litchi Parameters in the file.  I've attached one of mine, which imports quite well to DL.

     

    latitude,longitude,altitude(ft),heading(deg),curvesize(ft),rotationdir,gimbalmode,gimbalpitchangle,actiontype1,actionparam1,actiontype2,actionparam2,actiontype3,actionparam3,actiontype4,actionparam4,actiontype5,actionparam5,actiontype6,actionparam6,actiontype7,actionparam7,actiontype8,actionparam8,actiontype9,actionparam9,actiontype10,actionparam10,actiontype11,actionparam11,actiontype12,actionparam12,actiontype13,actionparam13,actiontype14,actionparam14,actiontype15,actionparam15,altitudemode,speed(m/s),poi_latitude,poi_longitude,poi_altitude(ft),poi_altitudemode,photo_timeinterval,photo_distinterval
    26.431876170296206,-81.79726797570297,143.0017391185077,1,0.6561679897776649,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1
    26.43201667681989,-81.79730418551325,143.0017391185077,1,2.9967608808661375,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1
    26.432164388621842,-81.79730150331464,143.0017391185077,1,2.540599822339181,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1
    26.43228928300581,-81.79730686773252,143.0017391185077,1,2.540599822339181,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1
    26.432417482662583,-81.79732187215339,143.0017391185077,1,2.6336156214644975,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1
    26.43256879666278,-81.79733260098911,143.0017391185077,1,2.6856450589885483,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1
    26.432699695122,-81.79732455435251,143.0017391185077,1,2.6856450589885483,0,2,-90,0,500,1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,1,0,0,0,0,0,-1,-1

    1
  • Comment author
    Joe Desbonnet

    Daniel, thanks for the CSV example above. It works and yes it was the curvesize that was causing the error in my example. I think I have enough to do a few experiments now. If I get time I'll write up what I learn for others.

    1
  • Comment author
    Joe Desbonnet

    To partially answer my own question, I found some documentation on the Litchi CSV file format. The CSV file header is:

    latitude,longitude,altitude(m),heading(deg),curvesize(m),rotationdir,pointofinterest,pitch(deg),roll(deg),yaw(deg),action,actionparam

    This covers most of what I need to generate my mission file. 

    HOWEVER... despite Dronelink supporting this file format, when I go to import the UI just hangs. I can see from the browser developer tools there is a Javascript error in the console. The text of the error is "Uncaught TypeError: Cannot read properties of undefined (reading 'distance')".  The line of Javascript code throwing the error is:

     return gb['distance'] = 0x0 === gr ? 0x0 : gz['segmentEndPoints'][gr - 0x1]['distance'],

     

    I've tried with both Firefox 113.0.2 (on Ubuntu 18.04) and Google Chrome 124.0.6367.60 (also on Ubuntu 18.04) and I get the same error.

    This is the CSV file I'm attempting to import:

    latitude,longitude,altitude(m),heading(deg),curvesize(m),rotationdir,pointofinterest,pitch(deg),roll(deg),yaw(deg),action,actionparam
    53.275031701236266,-8.98897930846308,50,0,0,0,1,-90,0,0,1,0
    53.27521148148091,-8.98897926222346,50,0,0,0,1,-90,0,0,1,0
    53.275391261720124,-8.988979215983342,50,0,0,0,1,-90,0,0,1,0
    53.27503167314252,-8.988679382552483,50,0,0,0,1,-90,0,0,1,0

    0
  • Comment author
    Jim McAndrew Dronelink Staff
    • Edited

    The code is having an issue importing your file because it expects curvesize to be non-zero (Litchi never generates files with it set to zero).

    As for the .dronelink format, it is a compressed json format, and it can be generated by using javascript/typescript: https://github.com/dronelink/dronelink-kernel-js

    This is what many of our enterprise customers do, but honestly it takes quite a bit of hand-holding due to minimal docs. If this is something you are interested in paying for, we can have a consultant reach out to you.

    0
  • Comment author
    Joe Desbonnet

    Thanks for the quick reply Jim. I'm doing some background research for a project involving surveying hedgerows (thin woody features) on farmland. Yes, it would be nice to have a quick conversation about the services you can provide and see if it's compatible with our budget.  Who can I email, or can you pull my email address from my profile info?

    0
  • Comment author
    Ben Barnard

    Any update Joe?

    0
  • Comment author
    Joe Desbonnet

    Hi Ben, 

    Not yet, I got pulled away on another project but need to get back to that very soon. I believe I was missing a few columns to make the Litchi file work (one of the posts above was very helpful). I'll update hopefully in a few weeks.

    Regards,

    Joe

    0

Please sign in to leave a comment.