dji-sdk / FlightRecordParsingLib

DJI Flight Record Parsing Lib
Other
39 stars 12 forks source link

DJIFlightRecord

中文版

ReleaseNote

What is DJIFlightRecord?

Flight record parsing library can parse version 13 flight log files. Convert DJI protocol data into time frame objects for presentation and analysis. An App Key is required to run the flight record parsing library.

How to apply for my App Key?

  1. Log in to the DJI Developer Technologies, click "CREATE APP", select "Open API" for App Type, fill in the "App Name", "Category" and "Description" by yourself, and click "CREATE".

  2. Activate the App through your personal email. After activation, click on the corresponding App information on your developer user page. The App Key is the SDK key parameter you need for the next steps.

Where does the app create the version 13 flight log?

Architectural relationship

Folder structure

Here is an introduction to the role of file directories:

How to run the sample?

Running the sample in Docker

Get docker

https://docs.docker.com/get-docker

Build docker image

docker build --build-arg SDK_KEY=your_app_key -t pf .

Docker run

docker run -v host_dir:container_dir pf "container_flight_record_dir"

Sample code: docker run -v $(pwd):/tmp pf "/tmp/V132_DJIFlightRecord2020-06-18[19-01-24].txt" > json_result.json

"> json_result.json" Redirecting the running result to a specified file

Running the Sample in Mac

Here is the Mac version of the Sample run creation process.

cd dji-flightrecord-kit/build/Mac/FRSample
sh generate.sh

// Which do you want to build? Please Input the number:
// 0: Executable 1: Project        input:
// input 1 can create a xcode project.
  1. Open dji-flightrecord-kit/build/Mac/FRSample/FRSample.xcodeproj
  2. Go to the main.cc file and configure the path of the file you want to parse to the variable file_path
  3. Configure the SDK key parameter of the "startRequestParser" interface and you are able to parse the file for the version of Flight Record 13

Running the sample in Ubuntu

cd dji-flightrecord-kit/build/Ubuntu/FRSample
sh generate.sh
./FRSample
  1. Go to the main.cc file and configure the path of the file you want to parse to the variable file_path
  2. Configure the SDK key parameter of the "startRequestParser" interface and you will be able to parse the file for the version of Flight Record 13
  3. Run the above script

How to compile the library?

Mac

cd dji-flightrecord-kit/build/Mac/FlightRecordStandardizationCpp
sh generate.sh
./FRSample
  1. Run the above script
  2. Get the library you want, the header files are stored in the dji-flightrecord-kit/source/FlightRecordStandardizationCpp/parser/DJIFRProtoParser.hpp

Ubuntu

cd dji-flightrecord-kit/build/Ubuntu/FlightRecordStandardizationCpp
sh generate.sh
./FRSample
  1. Run the above script
  2. Get the library you want, the header files are stored in the dji-flightrecord-kit/source/FlightRecordStandardizationCpp/parser/DJIFRProtoParser.hpp

Error Codes

If an error occurs during the flight record files parsing, you can solve the problem according to the returned value. The table below shows returned values and error descriptions. Returned value 0 indicates successful parsing.

Error Code Error Description
1 Illegal input parameter
2 Illegal flight record file content
3 Unsupported flight record file version
4 The flight record parser does not exist
5 The flight record file includes unsupported functions
6 Parsing failed due to message loss
7 File operation failed
8 Invalid data. The file might be modified
9 Data filling failed. Unsupported data filling types
255 Unknown error

Credits

FlightRecord is owned and maintained by DJI SDK.

Support

Expect more customized data, please let us know your data needs and application scenarios. You can get support from DJI with the following methods:

License

DJIFlightRecord is available under the MIT license. See the LICENSE.txt file for more info.