Git Product home page Git Product logo

dji-waypoints's Introduction

Automatically adjust the altitude of waypoints in DJI GO Mod to follow the terrain

This script connects to the waypoints database in DJI Go Mod and, for each waypoint, looks up the elevation for the GPS position using the Google Elevations service, adds a configurable altitude value to the elevation and writes the new altitudes back to the waypoint.

The goal is to keep the drone at a fairly constant altitude in hilly terrain.

Notes

  • This works for me but might crash your drone

  • Requires that you obtain an API key from Google in order to access the Google Elevation service. It is very unlikely that you will exceed their free usage tier, but you will still need to register a payment method, such as a credit card, or bank account with Google.

  • Works only with the hacked version of DJI Go, called DJI Go Mod

  • Works only on Linux, due to dependency on go-mtpfs

Linux Setup

  • Install go-mtpfs

    • $ apt install go-mtpfs
  • Clone this repo and enter it:

    • $ git clone <copy and paste the "Clone with HTTPS " URL from the top of this page>
    • $ cd dji-waypoint
  • Prepare and activate a Python 3 virtual environment

    • $ python3 -m venv venv
    • $ . ./venv/bin/activate
    • $ pip install requests
  • Obtain a API key from Google for the Elevation service

  • Prepare and edit the settings

    • $ cp settings_sample.py settings.py
    • Edit settings.py
      • Replace the API key placeholder with your Google API key
      • Check and adjust ALTITUDE_M
        • To reduce the chance of a crash, starting out with a higher altitude than you think you need is probably a good idea

Usage

  • On an Android device that has DJI Go Mod installed, set the USB configuration to MTP (Media Transfer Protocol)

  • Connect the Android device to the Linux box via USB

  • Run ./adjust_waypoint_altitude.py

Example workflow

Resources

DJI hacks

https://github.com/Bin4ry/deejayeye-modder

go-mtpfs

https://github.com/hanwen/go-mtpfs

dji-waypoints's People

Contributors

rogerdahl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.