Skip to content

Commit

Permalink
update to 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel.chen committed Mar 9, 2023
1 parent 6984fda commit 7913ed1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# DJIFlightRecord

### <p>[中文版](https://github.com/dji-sdk/FlightRecordParsingLib/blob/master/README_cn.md)</p>

## 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.
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](https://developer.dji.com/user), 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?

Expand Down Expand Up @@ -34,6 +41,7 @@ Here is an introduction to the role of file directories:
* FR-V1.0.0/dji-flightrecord-kit/source: Source code for the dji-flightrecord-kit library
* FR-V1.0.0/images:Photo resources cited in README


## How to run the sample?

### Running the sample in Docker
Expand All @@ -43,15 +51,15 @@ https://docs.docker.com/get-docker

**Build docker image**
```shell
docker build --build-arg SDK_KEY=your_sdk_key -t pf .
docker build --build-arg SDK_KEY=your_app_key -t pf .
```

**Docker run**
```shell
docker run -v host_dir:container_dir -it pf "container_flight_record_dir"
docker run -v host_dir:container_dir pf "container_flight_record_dir"
```
Sample code:
docker run -v $(pwd):/tmp -it pf "/tmp/V132_DJIFlightRecord_2020-06-18_[19-01-24].txt" > json_result.json
docker run -v $(pwd):/tmp pf "/tmp/V132_DJIFlightRecord_2020-06-18_[19-01-24].txt" > json_result.json

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

Expand All @@ -70,7 +78,7 @@ sh generate.sh

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
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

Expand All @@ -81,7 +89,7 @@ sh generate.sh
```

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
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?
Expand Down
21 changes: 15 additions & 6 deletions README_cn.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# DJIFlightRecord

### <p>[English Version](https://github.com/dji-sdk/FlightRecordParsingLib/blob/master/README.md)</p>

## 什么是 DJIFlightRecord?

飞行记录解析库是一款可以解析版本 13 飞行记录文件的应用程序。它将 DJI 协议数据转换为时间帧对象,用于展示和分析。
飞行记录解析库是一款可以解析版本 13 飞行记录文件的应用程序。它将 DJI 协议数据转换为时间帧对象,用于展示和分析,运行飞行记录解析库需要申请 App Key。

## 如何申请我的 App Key?

1. 登录 [DJI 开发者平台](https://developer.dji.com/user),点击"创建应用",App Type 选择 "Open API",自行填写“App 名称”“分类”和“描述”,点击 "创建"。

2. 通过个人邮箱激活 App,在开发者网平台个人点击查看对应 App 信息,其中 **App Key** 即为下文所需的 SDK 密钥参数。

## 该应用程序在哪里创建版本 13 的飞行记录日志?

使用 Mobile SDK 4.12 版本的应用程序


## 架构关系

![](images/architectural.png)
Expand All @@ -35,6 +42,8 @@
* FR-V1.0.0/dji-flightrecord-kit/source:dji-flightrecord-kit 库的源代码
* FR-V1.0.0/images:在 README 中引用的照片资源



## 如何运行示例代码?

### 在 Docker 上运行示例代码
Expand All @@ -44,12 +53,12 @@ https://docs.docker.com/get-docker

**创建 Docker 镜像**
```shell
docker build --build-arg SDK_KEY=your_sdk_key -t pf .
docker build --build-arg SDK_KEY=your_app_key -t pf .
```

**运行 Docker**
```shell
docker run -v 宿主机目录:容器目录 -it pf "容器内的飞行记录文件路径"
docker run -v 宿主机目录:容器目录 pf "容器内的飞行记录文件路径"
```
命令示例:
docker run -v $(pwd):/tmp -it pf "/tmp/V132_DJIFlightRecord_2020-06-18_[19-01-24].txt" > json_result.json
Expand All @@ -71,7 +80,7 @@ sh generate.sh

1. 打开 dji-flightrecord-kit/build/Mac/FRSample/FRSample.xcodeproj
2. 转到 main.cc 文件并将要解析的文件路径配置到变量 file_path 中
3. 配置startRequestParser接口的 SDK 密钥参数,即可解析版本为 Flight Record 13 的文件
3. 配置 "startRequestParser" 接口的 SDK 密钥参数,即可解析版本为 Flight Record 13 的文件

### 在 Ubuntu 上运行示例代码

Expand All @@ -82,7 +91,7 @@ sh generate.sh
```

1. 转到 main.cc 文件并将要解析的文件路径配置到变量 file_path 中
2. 配置startRequestParser接口的 SDK 密钥参数,即可解析版本为 Flight Record 13 的文件
2. 配置 "startRequestParser" 接口的 SDK 密钥参数,即可解析版本为 Flight Record 13 的文件
3. 运行上面的脚本

## 如何编译库?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ SDKError ParserImp::startRequestParser(const std::string& sdk_key, const Request
request->SetRequestHeader("Content-Type", "application/json;charset=UTF-8");

request->SendRequest([this, request_json, sdk_key, callback, featurePointMap, version_extension](dji::core::CLHttpRequest *request, bool succeeded) {
dji::core::CLHttpRequest *httpReq = dji::core::CLHttpRequest::Post("https://api.djiservice.org/api/ds-grocery/v2/flight-record/decode-aes-key", (char *)request_json.c_str(), request_json.length());
dji::core::CLHttpRequest *httpReq = dji::core::CLHttpRequest::Post("https://dev.dji.com/openapi/v1/flight-records/keychains", (char *)request_json.c_str(), request_json.length());
httpReq->SetTimeout(30);
httpReq->SetRequestHeader("Accept", "application/json");
httpReq->SetRequestHeader("Api-Key", sdk_key);
Expand Down

0 comments on commit 7913ed1

Please sign in to comment.