wayline
Event
Notification of device exits the Return to Home (RTH) state
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: device_exit_homing_notify
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
action | Notification type of exiting RTH | enum_int | {"0":"Exit exiting RTH state ","1":"Enter exiting RTH state "} | Entering the RTH exiting state means that the aircraft exits the RTH process due to one of the reasons in the reason field of Cloud API. Exiting the RTH exiting state means the aircraft stop the exiting process. |
reason | Reason for exiting RTH | enum_int | {"0":"Add joystick throttle","1":"Add joystick pitch","2":"The initialization of behavior tree is failed","3":"Surrounded by obstacles","4":"Flight restriction is triggered","5":"Obstacle is too closed","6":"No GPS signal","7":"The output flag of GPS and VIO location is false","8":"The error of GPS and VIO fusion position is too large","9":"Backtrack in a short distance","10":"Trigger the RTH in a short distance"} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"action": 1,
"reason": "0",
"sn": "Dock SN"
},
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"method": "device_exit_homing_notify"
}
Report wayline task progress
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: flighttask_progress
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
ext | Expand content | struct | ||
»current_waypoint_index | Current waypoint index | int | ||
»wayline_mission_state | Wayline mission state | enum_int | {"0":"Disconnect","1":"Do not support this waypoint","2":"Wayline is ready. File can be uploaded and uploaded file can be executed.","3":"Wayline file is uploading","4":"Trigger start command. Trgger aircraft reading wayline. Not start. Under preparation.","5":"Enter wayline and arrive first waypoint","6":"Execute wayline","7":"Wayline is broken. Trigger reason: 1. User pauses the wayline. 2. Flight control is abnormal.","8":"Wayline recover","9":"Wayline stop"} | |
»media_count | Media file number generated by the wayline mission execution | int | ||
»track_id | Wayline ID | text | ||
»flight_id | Mission ID | text | ||
»break_point | Wayline breakpoint information | struct | Optional field for resuming interrupted wayline task. If specified, the wayline task will start executing from the breakpoint position indicated by the field. | |
»»index | Breakpoint index | int | ||
»»state | Breakpoint state | enum_int | {"0":"On the wayline segment","1":"On the waypoint"} | |
»»progress | Current wayline segment progress | float | {"max":"1.0","min":"0"} | |
»»wayline_id | Wayline ID | int | ||
»»break_reason | Break reason | enum_int | {} | |
»»latitude | Breakpoint latitude | float | {"max":"90","min":"-90","unit":"degree / °"} | |
»»longitude | Breakpoint longitude | float | {"max":"180","min":"-180","unit":"degree / °"} | |
»»height | Breakpoint altitude relative to the Earth's ellipsoid surface | float | {"unit":"meter / m"} | |
»»attitude_head | Breakpoint yaw angle | float | Yaw angle relative to true north (meridian), with positive values from 0 to 6 o'clock direction and negative values from 6 to 12 o'clock direction | |
»wayline_id | Currently working wayline ID | int | This includes the transitional phase of entering the flight path. For example, 0 indicates that the spacecraft is entering or already executing the first route. | |
status | Task state | enum_string | {"partially_done":"partially done","sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"} | |
progress | Progress | struct | ||
»current_step | Execute Step | enum_int | {"0":"Initial state","1":"Pre-launch check: Is the spacecraft executing the route?","2":"Pre-launch check: Is the airport exiting work mode?","3":"Pre-launch check: Route execution in progress","4":"Pre-launch check: Return in progress","5":"Route execution entering preparation state, waiting for task issuance to begin","6":"Airport entering operational state","7":"Entering startup check preparation and hatch opening preparation","8":"Waiting for flight system readiness, push connection establishment","9":"Waiting for RTK source monitoring with reported values","10":"Check if RTK source is from the airport; if not, reset","11":"Waiting for flight control notification","12":"Airport has no control; wresting control from the aircraft","13":"Get the latest KMZ URL","14":"Download KMZ","15":"KMZ uploading","16":"Dye configuration","17":"Aircraft takeoff parameter settings, alternate landing point settings, takeoff altitude settings, dye settings","18":"Aircraft 'flyto' takeoff parameter settings","19":"Home point settings","20":"Trigger route execution","21":"Route execution in progress","22":"Entering return check preparation","23":"Aircraft landing at the airport","24":"Hatch closure after landing","25":"Airport exiting work mode","26":"Airport abnormal recovery","27":"Airport uploading flight system logs","28":"Camera recording status check","29":"Get the number of media files","30":"Abnormal recovery of airport takeoff hatch opening","31":"Notify task results","32":"Task execution completed; whether to initiate log retrieval based on configuration file","33":"Log list retrieval - Aircraft list","34":"Log list retrieval - Airport list retrieval","35":"Log list retrieval - Upload log list results","36":"Log retrieval - Retrieve aircraft logs","37":"Log retrieval - Retrieve airport logs","38":"Log retrieval - Compress aircraft logs","39":"Log retrieval - Compress airport logs","40":"Log retrieval - Upload aircraft logs","41":"Log retrieval - Upload airport logs","42":"Log retrieval - Notify results","0xFFFD":"Waiting for service response after completion","0xFFFE":"No specific status","0xFFFFF":"UNKNOWN"} | |
»percent | Progress value | int | {"max":"100","min":"0","step":"1"} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"output": {
"ext": {
"break_point": {
"attitude_head": 30,
"break_reason": 1,
"height": 100.23,
"index": 1,
"latitude": 23.4,
"longitude": 113.99,
"progress": 0.34,
"state": 0,
"wayline_id": 0
},
"current_waypoint_index": 3,
"wayline_mission_state": 9,
"wayline_id": 0,
"flight_id": "flight_id",
"media_count": 6,
"track_id": "track_id"
},
"progress": {
"current_step": 19,
"percent": 100
},
"status": "ok"
},
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_progress"
}
Notification of task readiness
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: flighttask_ready
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_ids | Mission ID | array | {"size": } | The task ID set that currently satisfies the task readiness conditions |
»[array_item] | Elements in array | text |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_ids": [
"aaaaaaa",
"bbbbbbb"
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_ready"
}
Return-to-home information
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: return_home_info
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
planned_path_points | Planned trajectory point list | array | {} | The real-time planned return route for the aircraft. Each push is a complete update of the route. There is an complete return path in the array. |
»[array_item] | Elements in array | struct | {} | {"size": ""} |
»»latitude | Trajectory point latitude(angle) | double | {"min":-90,"max":90} | The latitude of trajectory points, given in angular values. Negative values for south latitude and positive values for north latitude. Value is accurate to six decimal places. |
»»longitude | Trajectory point longitude(angle) | double | {"min":-180,"max":180} | The latitude of trajectory points, given in angular values. Negative values for wast latitude and positive values for east latitude. Value is accurate to six decimal places. |
»»height | Trajectory point height | float | {"unit":"meter / m","step":0.1} | ellipsoidal height |
last_point_type | Type of the last point of trajectory | enum_int | {"0":"Last point of trajectory is located above the return point.","1":"Last point of trajectory is not located above the return point."} | You can use this field to determine the display mode of the last point in the trajectory. 0 means the last point of the trajectory is located above the return point on the ground. The terminal can display a line connecting the last point of the trajectory to the return point. 1 means the last point of the trajectory is not the return point. The terminal should not display a line connecting the last point of the trajectory to the return point. The reason for not being able to reach the return point could be that the return point is in a restricted zones or inside an obstacle. |
flight_id | Mission ID | text | Currently working wayline mission ID |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "abc",
"planned_path_points": [
{
"latitude": 13.23,
"longitude": 123.234,
"height": 123.234
}
],
"last_point_type": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "return_home_info"
}
Service
Create wayline task (Deprecated)
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_create
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_id | Mission ID | text | ||
type | Mission type | text | ||
file | Wayline file object | struct | ||
»url | File URL | text | ||
»sign | MD5 signature | text |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"file": {
"sign": "xxxx",
"url": "https://xxx.com/xxxx"
},
"flight_id": "xxxxxxx",
"type": "wayline"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"method": "flighttask_create"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_create
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"method": "flighttask_create"
}
Issue mission
If user's cloud service can not connect to the Internet (that is, the WAN), it is necessary to implement the update configuration function to send the URL of the NTP service which can be accessed by the cloud service to synchronize the clock. Otherwise, the wayline task can not work properly.
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_prepare
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_id | Mission ID | text | ||
execute_time | Execution start time | int | {"length":13} | Millisecond timestamp of mission execution time. Optional field. When the task_type is 0 or 1, it is required. When the task_type is 2, it is not required. |
task_type | Mission type | enum_int | {"0":"Immediate mission","1":"Timed mission","2":"Conditional mission"} | The execution time of immediate task and timed task are defined by execute_time . The conditional mission supports the task readiness condition defined by ready_conditions . The task can be executed if conditions are satisfied within a specified period. Immediate task has the highest priority. Timed task and conditional mission have the same priority. |
wayline_type | Wayline type | enum_int | {"0":"Normal waypoint wayline"} | |
file | Wayline file object | struct | ||
»url | File URL | text | ||
»fingerprint | File signature | text | File content MD5 signature | |
ready_conditions | Notification of task readiness | struct | Optional field. Required for conditional missions (when task_type is 2), and will be ignored by other types of missions. After sending a conditional mission, the device will periodically check whether all the ready_conditions are met. If all conditions are met, it will trigger a flighttask_ready event notification. Additionally, when the device receives the flighttask_execute command, it will also check whether all the ready_conditions for the task have been met. | |
»battery_capacity | Battery capacity | int | The aircraft battery percentage threshold of the executable task. The aircraft battery must be greater than the battery_capacity when the task starts. | |
»begin_time | Start time of the mission executable period | int | {"length":13} | Start millisecond timestamp of the mission executable period. The mission execution time should be later than the begin_time |
»end_time | End time of the mission executable period | int | {"length":13} | End millisecond timestamp of the mission executable period. The mission execution time should be earlier than the end_time . |
executable_conditions | Mission executable condition | struct | Optional field. Pre-check conditions added for task execution on the device side. If any condition is not satisfied, execution will fail. | |
»storage_capacity | Storage capacity | int | The minimum storage capacity of DJI dock or aircraft that can execute a task. Unit: MB. If the storage capacity doesn't satisfy the storage_capacity , task execution will fail. | |
break_point | Wayline breakpoint information | struct | Optional field for resuming interrupted wayline task. If specified, the wayline task will start executing from the breakpoint position indicated by the field. | |
»index | Breakpoint index | int | ||
»state | Breakpoint state | enum_int | {"0":"On the wayline segment","1":"On the waypoint"} | |
»progress | Current wayline segment process | float | {"max":"1.0","min":"0"} | |
»wayline_id | Wayline ID | int | ||
rth_altitude | Return-to-home altitude | int | {"max":1500,"min":20,"unit":"meter / m"} | |
rth_mode | RTH height mode | enum_int | {"0":"Optimal height","1":"Preset height"} | Under optimal RTH mode, aircraft will automatically plan the optimal return altitude. Currently, the DJI dock does not support setting the return altitude mode. You can only choose the 'Preset height' mode. When the environment and lighting do not meet the requirements of the visual system (such as direct sunlight in the evening or no light at night), the aircraft will perform a straight-line return at the altitude you have set. |
out_of_control_action | Remote controller out of control action | enum_int | {"0":"Return-to-home (RTH)","1":"Hovering","2":"Landing"} | Current default transmitted value is 0, meaning Return-to-home (RTH). Note that this enumeration value definition is inconsistent with the flight control and dock definitions, and a conversion exists at the dock end. |
exit_wayline_when_rc_lost | Wayline out of control action | enum_int | {"0":"Continue executing the wayline task","1":"Exit the wayline task and execute the remote controller out of control action"} | consistent with the KMZ file |
simulate_mission | Whether execute mission in simulator | struct | Optional field. Used to indoor debugging the simulated mission. | |
»is_enable | Whether enable a simulated mission | enum_int | {"0":"Disable","1":"Enable"} | |
»latitude | Latitude | double | {"max":"90.0","min":"-90.0"} | |
»longitude | Longitude | double | {"max":"180.0","min":"-180.0"} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"break_point": {
"index": 1,
"progress": 0.34,
"state": 0,
"wayline_id": 0
},
"executable_conditions": {
"storage_capacity": 1000
},
"execute_time": 1234567890123,
"file": {
"fingerprint": "xxxx",
"url": "https://xxx.com/xxxx"
},
"flight_id": "xxxxxxx",
"out_of_control_action": 0,
"exit_wayline_when_rc_lost": 0,
"ready_conditions": {
"battery_capacity": 90,
"begin_time": 1234567890123,
"end_time": 1234567890123
},
"rth_altitude": 100,
"task_type": 2,
"wayline_type": 1,
"simulate_mission": {
"is_enable": 1,
"latitude": 22.1223,
"longitude": 113.2222
}
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_prepare"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_prepare
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_prepare"
}
Execute mission
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_execute
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_id | Mission ID | text |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_execute"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_execute
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_execute"
}
Cancel mission
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_undo
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_ids | Mission ID | array | {"size": } | |
»[array_item] | Elements in array | text |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_ids": [
"aaaaaaa",
"bbbbbbb"
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_undo"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_undo
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_undo"
}
Pause mission
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_pause
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_pause"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_pause
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_pause"
}
Resume mission
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_recovery
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_recovery"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_recovery
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_recovery"
}
One-key RTH
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: return_home
Data: null
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error | |
output | Output | struct | ||
»status | Mission state | enum_string | {"sent":"sent","in_progress":"in progress","ok":"succeeded","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or terminated","timeout":"timeout"} |
Cancel RTH
After returning to home, the aircraft will exit the wayline mode. At this point, if the return-to-home command is canceled, the aircraft will hover.
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: return_home_cancel
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "return_home_cancel"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home_cancel
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "return_home_cancel"
}
Requests
Mission Resource Get
Topic: thing/product/{gateway_sn}/requests
Direction: up
Method: flighttask_resource_get
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_id | Mission ID | text |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_resource_get"
}
Topic: thing/product/{gateway_sn}/requests_reply
Direction: down
Method: flighttask_resource_get
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error | |
output | Output | struct | ||
»file | Wayline file object | struct | ||
»»url | File URL | text | ||
»»fingerprint | File Signature | text | File MD5 Signature |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"output": {
"file": {
"fingerprint": "signxxxx",
"url": "https://xx.oss-cn-hangzhou.aliyuncs.com/xx.kmz?Expires=xx&OSSAccessKeyId=xxx&Signature=xxx"
}
},
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_resource_get"
}