Transfer code from previous repo
Esse commit está contido em:
+69
-2
@@ -1,2 +1,69 @@
|
||||
# rosettadrone
|
||||
Mavlink wrapper for DJI drones
|
||||
# Rosetta Drone
|
||||
MAVLink wrapper for DJI
|
||||
|
||||
*** IMPORTANT SAFETY NOTE *** Due to imperfect translation between DJI and Mavlink, props may begin spinning at unexpected times. This usually occurs when the user requests arming or takeoff in the GCS, then changes their mind, but the GCS sends repeated arm or takeoff requests. The recommended method to arm motors is to use the RC transmitter. Always treat props as if they are live! ***
|
||||
|
||||
# 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. 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.
|
||||
|
||||
4. 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.
|
||||
|
||||
5. Takeoff is recommended using the RC transmitter. To arm or takeoff from the GCS, the "ARMING ENABLED" button in RosettaDrone must be green.
|
||||
before commanding an arm or takeoff.
|
||||
|
||||
|
||||
# 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 sign up for an Application key.
|
||||
|
||||
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.
|
||||
|
||||
- DJI reports heading in True, which RosettaDrone passes along in vfr_hud.hdg. The mavlink protocol does not specify magnetic or true.
|
||||
|
||||
- DJI only reports altitude above home point, or what mavlink calls "relative altitude." There is know to extract altitude above mean sea level (AMSL) from DJI's SDK.
|
||||
|
||||
- DJI and Mavlink use different scales to characterize GPS accuracy. DJI also does not report hdop or vdop.
|
||||
|
||||
- RosettaDrone reports groundspeed and airspeed as the same, and does no wind correction
|
||||
|
||||
# Acknowledgements
|
||||
|
||||
Rosetta Drone uses a modified version of DJI's [Android Video Stream Decoding Sample](https://developer.dji.com/mobile-sdk/documentation/sample-code/index.html), which is released under the MIT License.
|
||||
|
||||
Video RTP packing uses code modified from the [libstreamer](https://github.com/fyhertz/libstreaming) library, licensed under Apache 2.
|
||||
|
||||
# Developer notes
|
||||
|
||||
RosettaDrone uses MAVLink code generated by the MAVLink code generator, using the ArduPilot dialect. The Java code generator contains errors (see issues [#805](https://github.com/mavlink/mavlink/issues/805) and [#806](https://github.com/mavlink/mavlink/issues/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.
|
||||
Referência em uma Nova Issue
Bloquear um usuário