Code Monkey home page Code Monkey logo

rosettadrone's Introduction

Rosetta Drone

Rosetta Drone is a Mavlink wrapper for the DJI SDK, which allows users to fly DJI drones using Mavlink-speaking ground control stations. In theory it should work with any Mavlink GCS, but all testing so far has been done with QGroundControl.

Rosetta Drone currently only supports the Mavic Pro. We are looking for help troubleshooting one remaining bug that is garbling video feeds from other DJI drone types.

*** IMPORTANT SAFETY NOTE *** Due to imperfect translation between DJI and Mavlink, props may begin spinning at unexpected times. Always treat props as if they are live. Use Rosetta Drone's "safety" feature, which should prevent the drone from acknowledging unexpected GCS arm or takeoff commands.

The user assumes all responsibility for prevention of harm or damage. This is an evolving, experimental app. See "Known issues" below before use.

Download the Android .APK from the Releases tab.

Features

  • Report telemetry in QGC like position, attitude, relative altitude, heading, and battery remaining
  • Command Return-to-Launch from QGC
  • View drone video feeds in QGC or forward RTP to an IP address of your choice (currently Mavic Pro only)
  • Create and fly waypoint missions

Usage

Setup (QGroundControl)

  1. Connect your Android phone to a DJI transmitter and power on your DJI drone.

  2. Start Rosetta Drone. The DJI light in the top-right will turn green if the app is successfully communicating with your drone.

  3. If you wish to use QGroundControl on an external device, click the Gear icon to access Settings, check Use GCS on an external device, then specify an IP address.

  4. Start QGroundControl. A telemetry connection should be immediately established, and the GCS light in Rosetta Drone will turn green. Note that if you are using QGroundControl on the same device as RosettaDrone, the GCS light may not turn green if QGC is in the background.

  5. To start video:

    a. Click the "Q" icon in the top-left corner of QGC

    b. Under Video change Video Source to UDP Video Stream.

    c. Change UDP Port to 5600.

  6. Takeoff is recommended using the RC transmitter. To arm or takeoff from the GCS, click the SAFETY ENABLED button. It will turn green and say READY TO FLY. Then use the QGroundControl Takeoff or Start Mission function.

  7. After flight, ensure the safety is enabled before approaching props.

Building from source

  1. Clone or download the repository.

  2. In Android Studio, select File->New->Import Project and navigate to the downloaded folder.

  3. Sign up for the DJI Developer Program at https://developer.dji.com/mobile-sdk/ and create an Application key. The package name should be sq.rogue.rosettadrone.

  4. Create a new file called keys.xml in the /values folder, and insert the following:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="dji_key">INSERT KEY HERE</string>
    </resources>
    
  5. Run Build->Make Project

DJI-Mavlink Translation Notes

Anyone who speaks multiple languages knows that translations are rarely perfect. The same is the case here.

  • The ARM button in QGC does not work, by design. Sending a "Takeoff" or "Start Mission" command from QGC will arm the motors and takeoff.

  • DJI reports heading in True, which RosettaDrone passes along in vfr_hud.hdg. The mavlink protocol does not specify magnetic or true.

  • DJI and Mavlink use different scales to characterize GPS accuracy. DJI also does not report hdop or vdop.

  • Radio signal strength is not yet implemented

  • RosettaDrone reports groundspeed and airspeed as the same, and does no wind correction

  • There is currently no way to turn the video camera on or off in QGC, but DJI controllers will still work fine

  • The only implemented waypoint actions include delaying at a waypoint, taking a photo, or changing the gimbal pitch

Known Issues for Users

  • Video streaming only works for the Mavic Pro. Some unknown bug in the code causes video from other platforms to be scrambled. Help wanted!

  • Occassionally RosettaDrone will loop through repeated "Connecting to drone..." messages upon plugging in a drone. We believe this is a bug in the DJI SDK. Try restarting the drone, killing RosettaDrone, and restarting it. If that doesn't work, reinstalling the app clears caches and usually solves the problem.

  • If you change the UDP port while QGC is running, you may need to restart QGC

  • There is no bounds checking for DJI parameters. It is your responsibility to enter valid parameters.

Known Issues for Developers

RosettaDrone uses MAVLink code generated by the MAVLink code generator, using the ArduPilot dialect. The Java code generator contains errors (see issues #805 and #806), and the code required manual tweaking after generation. This means that simply dropping in updated auto-generated files will likely produce errors.

The use of an ArduPilot dialect over PX4 is not intended to be a statement of preference. The author believes strongly in the importance of maintaining maximum compatibility across both projects.

Acknowledgements

Rosetta Drone was brought to you by developers from Rogue Squadron, a UAS/C-UAS red team at the Defense Innovation Unit Experimental.

Icons

Icons made by Pixel Perfect & Freepik at flaticon

Licensing

Rosetta Drone is licensed under BSD3. For particularities related to U.S. federal government code release, please read Intent.MD. For more information, visit code.mil or code.gov.

Rosetta Drone uses a modified version of DJI's Android Video Stream Decoding Sample, which is released under the MIT License.

Video RTP packing uses code modified from the libstreamer library, licensed under Apache 2.

rosettadrone's People

Contributors

alexkrob avatar dbaldwin avatar markdjacobsen avatar radarku avatar sdowhy 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.