Wayline Management

2024-10-29
No Rating

Event

Return home information

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: return_home_info

Data:

ColumnNameTypeconstraintDescription
planned_path_pointsList of planned trajectory pointsarray{"size": -, "item_type": struct}
»latitudeLatitude of the trajectory point (angle value)double{"max":90,"min":-90}Latitude of the trajectory point, angle value, negative for south latitude, positive for north latitude, accurate to 6 decimal places.
»longitudeLongitude of the trajectory point (angle value)double{"max":180,"min":-180}Longitude of the trajectory point, angle value, east longitude is positive, west longitude is negative, precision to 6 decimal places.
»heightTrajectory point heightfloat{"max":"","min":"","step":0.1,"unit_name":"Meters / m"}Trajectory point height, ellipsoid height
last_point_typeThe type of the last point in the return path.enum_int{"0":"The last point of the trajectory is above the return point.","1":"The last point of the trajectory is not above the return point."}
flight_idMission IDtext
home_dock_snDock SN of the home pointtextDock SN of current selected home point in multi-dock. Not applicable in regular missions
multi_dock_home_infoDock return information of the multi-dockarray{"size": 2, "item_type": struct}Not applicable in regular missions
»snDock SNtext
»plan_statusPath planning stateenum_int{"0":"Planning failed or in progress","1":"Path planning unreachable","2":"Path planning unreachable due to battery","3":"Destination reachable"}
»estimated_battery_consumptionEstimated battery consumptionint{"max":"100","min":"0","step":"1","unit_name":null}
»home_distanceHome point distancefloat{"unit_name":"Meters / m"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"home_dock_sn": "6QCDL870020164",
		"last_point_type": 0,
		"multi_dock_home_info": [
			{
				"estimated_battery_consumption": 30,
				"home_distance": 298.3277282714844,
				"plan_status": 3,
				"sn": "6QCDL870020164"
			},
			{
				"estimated_battery_consumption": 30,
				"home_distance": 298.289794921875,
				"plan_status": 3,
				"sn": "6QCDL820020041"
			}
		],
		"planned_path_points": [
			{
				"height": 60.285194396972656,
				"latitude": 22.755022128112614,
				"longitude": 114.89828051067889
			},
			{
				"height": 88.22719192504883,
				"latitude": 22.755022128112614,
				"longitude": 114.89828051067889
			},
			{
				"height": 88.22719192504883,
				"latitude": 22.75721542071551,
				"longitude": 114.89853624254465
			},
			{
				"height": 88.22719192504883,
				"latitude": 22.757445462048054,
				"longitude": 114.89860304631293
			},
			{
				"height": 78.30619430541992,
				"latitude": 22.757531544193625,
				"longitude": 114.89862810820341
			}
		]
	},
	"gateway": "6QCDL820020041",
	"method": "return_home_info",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1720000266772
}

Mission readiness notification

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: flighttask_ready

Data:

ColumnNameTypeconstraintDescription
flight_idsPlan IDarray{"size": -, "item_type": text}Collection of task IDs currently meeting the conditions for mission readiness

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_ids": [
			"aaaaaaa",
			"bbbbbbb"
		]
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_ready"
}

Report mission progress

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: flighttask_progress

Data:

ColumnNameTypeconstraintDescription
extExtended contentstruct
»current_waypoint_indexNumber of waypoints currently executedint
»wayline_mission_stateWayline mission stateenum_int{"0":"Disconnected","1":"This waypoint is not supported","2":"Wayline preparation state. It can upload files and execute existing files","3":"Wayline file uploading","4":"Trigger start command. The aircraft triggers logic such as reading the wayline. The mission has not started yet and it's in a preparation state","5":"Entering the wayline, heading to the first waypoint","6":"Wayline execution","7":"Wayline interrupted. Triggered conditions are 1 for User actively pauses and 2 for Flight control abnormality","8":"Wayline recovery","9":"Wayline completed"}
»media_countNumber of media files generated during the current flight missionint
»track_idTrack IDtext
»flight_idMission IDtext
»break_pointWayline breakpoint informationstructOptional field to inform the cloud of the breakpoint information for this wayline mission.
»»indexBreakpoint numberint
»»stateBreakpoint stateenum_int{"0":"On segment","1":"On waypoint"}
»»progressCurrent segment progressfloat{"max":"1.0","min":"0","step":"","unit_name":null}
»»wayline_idWayline IDint
»»break_reasonBreak reasonenum_int{"0":"No abnormalities","1":"Mission ID does not exist. The wayline mission has not been executed.","2":"Uncommon error, please contact technical support","4":"Error loading wayline file when requesting to start/resume the wayline mission, please try uploading the file again or contact technical support","5":"Failed to query breakpoint file when requesting breakpoint information. Failed to parse breakpoint type when requesting to resume the wayline mission","6":"Incorrect cmd parameter when requesting to start/end the wayline mission, incorrect protocol command in the request. Failed to parse breakpoint type when requesting to resume the wayline mission","7":"Timeout parsing the WPMZ file when requesting to start/resume the wayline mission, please retry","257":"Wayline has already started, cannot start again","258":"Unable to interrupt the wayline in this state, only allowed to pause the wayline in the executing state","259":"Wayline has not started, cannot end the wayline","261":"Flight mission conflict, unable to obtain control of the aircraft, not allowed to start the wayline during landing and return","262":"Unable to resume wayline in this state, only allowed when the wayline is paused","513":"Aircraft exceeded the maximum altitude limit","514":"Aircraft exceeded the maximum distance limit","516":"Aircraft triggered altitude limit","517":"Aircraft triggered obstacle sensing","518":"Poor RTK signal","519":"Approaching the boundary of Restricted Zone","521":"Exceeded the dock's GEO zone altitude limit","522":"Failed to request takeoff for the wayline","523":"Takeoff mission execution failed","524":"Failed to request wayline mission","526":"Failed to request wayline RTK fixing mission","527":"Wayline RTK fixing mission failed to run","769":"Weak GPS signal","770":"The remote controller gear is not in N position.","771":"Home point not refreshed","772":"Unable to start the mission due to low current battery level","773":"Wayline interrupted due to low battery causing return to home","775":"Disconnection between the remote controller and the aircraft","778":"Aircraft is on the ground with propellers spinning, not allowed to start the wayline","779":"During the real-time terrain follow, the camera state is abnormal(such as too bright, too dark and inconsistent brightness on both sides)","780":"Real-time terrain-following altitude set by the user is invalid (greater than 200m or less than 30m)","781":"Global map calculation error during real-time terrain follow","784":"Wayline interrupted due to strong winds causing return to home","1281":"User exit","1282":"User interruption","1283":"User triggered return to home","1539":"Incorrect start information (waypoint index or progress)","1540":"Using an unsupported coordinate system","1541":"Using an unsupported altitude mode","1542":"Using an unsupported transitional wayline mode","1543":"Using an unsupported yaw mode","1544":"Using an unsupported yaw direction reversal mode","1545":"Using an unsupported waypoint type","1546":"Coordinated turning type cannot be used for the start and end points","1547":"Wayline global speed exceeds a reasonable range","1548":"Waypoint number abnormal","1549":"Abnormal latitude and longitude data","1550":"Abnormal turning intercept","1551":"Maximum speed of wayline segment exceeds a reasonable range","1552":"Wayline segment target speed exceeds a reasonable range","1553":"Waypoint yaw angle exceeds a reasonable range","1555":"Input mission_id of resuming from breakpoint is wrong","1556":"Progress information of resuming from breakpoint input error","1557":"Mission state of resuming from breakpoint is abnormal","1558":"Waypoint index information of resuming from breakpoint input error","1559":"Incorrect latitude and longitude information for resuming from breakpoint","1560":"Yaw input error for waypoints during resuming from breakpoint","1561":"Incorrect flag setting for resuming from breakpoint","1563":"Wayline generation failed","1564":"Wayline execution failed","1565":"Emergency stop due to wayline obstacle sensing","1588":"Unrecognized action type","1595":"Action ID must be unique.","1598":"Action ID value cannot be 65535","1602":"Number of action groups exceeds a reasonable range","1603":"Error in action group effective range","1606":"Action index exceeds a reasonable range during resuming from breakpoint","1608":"Trigger running result of breakpoint information is abnormal","1609":"Action group ID information can not be duplicated during resume from breakpoint","1610":"Action group positions cannot be repeated during resuming from breakpoint","1611":"Action group positions exceed a reasonable range during resuming from breakpoint","1612":"Action ID is not in the breakpoint information during resuming","1613":"The action state can not be set to interrupt during the resuming flight from breakpoint","1614":"Resume failure due to incorrect breakpoint information","1634":"Unrecognized action type","1649":"Unrecognized trigger type","65534":"Unknown issue","65535":"Unknown issue"}
»»latitudeLatitude of the breakpointfloat{"max":"90","min":"-90","step":"","unit_name":"Degrees / °"}
»»longitudeLongitude of the breakpointfloat{"max":"180","min":"-180","step":"","unit_name":"Degrees / °"}
»»heightBreakpoint relative to the Earth ellipsoid heightfloat{"unit_name":"Meters / m"}
»»attitude_headBreakpoint yaw axis anglefloat
»wayline_idCurrent working Wayline IDintIncluding the transition phase of entering the wayline, for example, 0 means the aircraft is entering or has executed the first wayline
statusTask stateenum_string{"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","partially_done":"Partially completed","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"}
progressProgressstruct
»current_stepExecution stepenum_int{"0":"Initial state","1":"Pre-flight check, whether the aircraft is executing a wayline","2":"Pre-flight check, whether the dock has exited working mode","3":"Pre-flight check, wayline execution in progress","4":"Pre-return-to-home check, in the process of returning to home","5":"Wayline execution enters the preparation state, waiting for the mission to be issued","6":"Dock enters working state","7":"Enter the startup check and cover preparation work","8":"Remote image transmission frequency Pairing","9":"Waiting for the flight system to be ready, push connection established","10":"Waiting for RTK source to listen for reported values","11":"Check if the RTK source is from the dock, if not, reset it","12":"Waiting for flight control notification","13":"The dock has no control and seizes the control of the aircraft","14":"Consistency check of custom flight area","15":"Consistency check of offline maps","16":"Get the latest KMZ URL","17":"Download KMZ","18":"KMZ uploading","19":"Coloring configuration","20":"Aircraft takeoff parameter setting, alternate landing point setting, takeoff altitude setting, coloring setting","21":"Aircraft flyto takeoff parameter setting","22":"Takeoff dock checks the landing dock preparation status","23":"Home point setting","24":"Trigger wayline execution","26":"Enter pre-return-to-home check","27":"Aircraft landing at the dock","28":"Close the cover after landing","29":"Dock exits working mode","30":"Dock abnormal recovery","31":"Dock uploads flight system logs","32":"Check camera recording state","33":"Get the number of media files","34":"Abnormal recovery after dock takeoff cover","35":"Notify mission result","36":"Log list retrieval - Aircraft list","37":"Log list retrieval - Retrieve the list of docks","38":"Log list retrieval - Upload log list result","39":"Log retrieval - Retrieve aircraft logs","40":"Log retrieval - Retrieve dock logs","41":"Log retrieval - Compress aircraft logs","42":"Log retrieval - Compress dock logs","43":"Log retrieval - Upload aircraft logs","44":"Log retrieval - Upload dock logs","45":"Log retrieval - Notify the result","46":"Custom flight area file update preparation","47":"Custom flight area updating","48":"Offline map update preparation","49":"Offline map updating","65533":"Wait for service response after completion","65534":"No specific state","65535":"UNKNOWN"}
»percentProgress valueint{"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,
				"flight_id": "flight_id",
				"media_count": 6,
				"track_id": "track_id",
				"wayline_id": 0,
				"wayline_mission_state": 9
			},
			"progress": {
				"current_step": 19,
				"percent": 100
			},
			"status": "ok"
		},
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_progress"
}

Device notification of Return to Home Exit State

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: device_exit_homing_notify

Data:

ColumnNameTypeconstraintDescription
snDock SNtext{}
actionExit return notification message typeenum_int{"0":"Exit Return to Home Exit State","1":"Enter Return to Home Exit State"}Enter Return to Home Exit State indicating that the dock exits the return to home process due to the reason displayed in the reason field. Similarly, exiting the Return to Home Exit State refers to the dock stopping the exit from the return to home process.
reasonExit return reasonenum_int{"0":"Throttle added to the joystick","1":"Joystick interval added","2":"Behavior tree initialization failed","3":"Surrounded by obstacles","4":"Triggered flight restriction","5":"Obstacle too close","6":"No GPS signal","7":"GPS and VIO position output flags are false","8":"Large position error between GPS and VIO fusion","9":"Short-distance backtracking","10":"Return triggered at close range"}

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

Service

Execute a mission

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_execute

Data:

ColumnNameTypeconstraintDescription
flight_idPlan IDtext
multi_dock_taskMulti-dock task parametersstruct
»wireless_link_topoWireless link topologystruct
»»secret_codeEncryption codearray{"size": 28, "item_type": int}Obtained from aircraft device properties
»»center_nodeAircraft frequency informationstructObtained from aircraft device properties
»»»sdr_idScrambling code informationint
»»»snDevice SNtext
»»leaf_nodesDock or remote controller frequency information, assemble the dock properties related to the multi-dock taskarray{"size": -, "item_type": struct}
»»»sdr_idScrambling code informationint
»»»snDevice SNtext
»»»control_source_indexControl source numberint{"max":"2","min":"1","step":"1","unit_name":"None / "}
»dock_infosDock informationarray{"size": 2, "item_type": struct}Dock information for this multi-dock task, except for dock_type, other fields can be directly obtained from device properties
»»dock_typeDock role in multi-dock taskenum_string{"landing":"Landing","takeoff":"Takeoff dock"}
»»latitudeLatitudedouble{"max":"90","min":"-90","step":"0.01"}Dock latitude, obtainable from dock device properties
»»longitudeLongitudedouble{"max":"180","min":"-180","step":"0.01"}Dock longitude, obtainable from dock device properties
»»heightEllipsoid heightdouble{"unit_name":"Meters / m"}Dock height, obtainable from dock device properties
»»headingDock heading angledouble{"max":"180","min":"-180","step":"","unit_name":"Degrees / °"}Dock heading angle, obtainable from dock device properties
»»home_position_is_validDock home point validityenum_int{"0":"Invalid","1":"Valid"}Obtainable from dock device properties
»»indexDock task unique identifierint{"max":"31","min":"1"}Number assigned to the dock, unique within a single task and preferably fixed long-term
»»snDock SNtext
»»rtcm_infoDock RTK calibration sourcestruct
»»»mount_pointNetwork RTK mounted point informationtext
»»»portNetwork port informationtext
»»»hostNetwork host informationtext
»»»rtcm_device_typeDevice typeenum_int{"1":"Dock"}
»»»source_typeCalibration typeenum_int{"0":"Not calibrated","1":"Auto-convergence calibration","2":"Manual calibration","3":"Network RTK calibration"}
»»alternate_land_pointAlternate landing pointstruct
»»»longitudeLongitudefloat{}
»»»latitudeLatitudefloat{}
»heightEllipsoid heightfloat
»»»safe_land_heightSafe landing height (backup landing transfer height)float{}
»»»is_configuredWhether the alternate landing point is setenum_int{"0":"Not set","1":"Already set"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "aee739dc-f1cc-47d5-beaa-64d327f2d797",
		"multi_dock_task": {
			"dock_infos": [
				{
					"alternate_land_point": {
						"height": 0,
						"is_configured": 1,
						"latitude": 37.348792490321514,
						"longitude": 116.52867090782102,
						"safe_land_height": 30
					},
					"dock_type": "takeoff",
					"heading": -78.7066650390625,
					"height": 30.81130027770996,
					"home_position_is_valid": 1,
					"index": 1,
					"latitude": 37.3487657248638,
					"longitude": 116.52893686422743,
					"rtcm_info": {
						"host": "120.253.226.97",
						"mount_point": "RTCM33_GRCEJ",
						"port": "8002",
						"rtcm_device_type": 1,
						"source_type": 3
					},
					"sn": "7CTDM5900B3X1B"
				},
				{
					"alternate_land_point": {
						"height": 0,
						"is_configured": 1,
						"latitude": 37.336024417709915,
						"longitude": 116.554075635852,
						"safe_land_height": 30
					},
					"dock_type": "landing",
					"heading": -69.79183197021484,
					"height": 32.31420135498047,
					"home_position_is_valid": 1,
					"index": 2,
					"latitude": 37.33605462094235,
					"longitude": 116.55416413516038,
					"rtcm_info": {
						"host": "120.253.226.97",
						"mount_point": "RTCM33_GRCEJ",
						"port": "8002",
						"rtcm_device_type": 1,
						"source_type": 3
					},
					"sn": "7CTDM5900BK07M"
				}
			],
			"wireless_link_topo": {
				"center_node": {
					"sdr_id": 933765657,
					"sn": "1581F6Q8D245P00EKS87"
				},
				"leaf_nodes": [
					{
						"control_source_index": 1,
						"sdr_id": 920128532,
						"sn": "7CTDM5900B3X1B"
					},
					{
						"control_source_index": 2,
						"sdr_id": 911741468,
						"sn": "7CTDM5900BK07M"
					}
				],
				"secret_code": [
					0,
					0,
					0,
					0,
					1,
					0,
					0,
					0,
					123,
					114,
					19,
					203,
					192,
					100,
					244,
					160,
					146,
					228,
					196,
					213,
					105,
					220,
					176,
					147,
					87,
					182,
					90,
					210
				]
			}
		}
	},
	"method": "flighttask_execute",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1720095314016
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_execute

Data:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "flighttask_execute"
}

Designate home point for returning

In multi-dock task, a specific airport should be designated as the return destination.

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: return_specific_home

Data:

ColumnNameTypeconstraintDescription
home_dock_snTarget dock SN for returningtext

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"home_dock_sn": "xxxxxxxx"
	},
	"method": "return_specific_home",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: return_specific_home

Data:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"method": "return_specific_home",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1695634358385
}

Task termination

When a dock reports the task termination, this method should be issued to the other dock during the multi-dock task.

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_stop

Data:

ColumnNameTypeconstraintDescription
flight_idTask idtext
reasonTermination reasonenum_int{"0":"Normal termination","1":"The state machine of the other dock is abnormal"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"reason": 0
	},
	"method": "flighttask_stop",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_stop

Data:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"method": "flighttask_stop",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1695634358385
}

Cancel return

After returning home, the aircraft will exit the wayline mode. If return is canceled at this point, 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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an 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"
}

One-key return

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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error
outputOutputstruct
»statusTask stateenum_string{"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"}

Wayline recovery

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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an 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"
}

Paused the wayline

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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an 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"
}

Cancel mission

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_undo

Data:

ColumnNameTypeconstraintDescription
flight_idsPlan IDarray{"size": -, "item_type": 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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "flighttask_undo"
}

Issue a 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 mission can not work properly.

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_prepare

Data:

ColumnNameTypeconstraintDescription
flight_idPlan IDtext
execute_timeStart execution timeint{"length":13}Start time of the mission execution in milliseconds timestamp. Optional field. Required when task_type is 0 or 1, optional for 2.
task_typeMission typeenum_int{"0":"Immediate mission","1":"Timed mission","2":"Conditional mission"}Immediate tasks and scheduled tasks are both specified with the execute_time for execution. Conditional tasks support the ready_conditions field to specify conditions for task readiness. The device can execute the task as soon as it meets the readiness conditions within the specified time period. Media upload for immediate tasks has the highest priority, while scheduled and conditional tasks have equal priority for media uploads.
fileWayline file objectstruct
»urlFile URLtext
»fingerprintFile signaturetext文件内容 MD5 签名
ready_conditionsMission readiness conditionsstructOptional field. Required for conditional missions (task_type is 2). Ignored for other types of missions. After sending a conditional mission, the device will periodically check whether all ready_conditions are met. If all conditions are met, a flighttask_ready event notification will be sent. Also, when the device receives the flighttask_execute command, it will check whether all ready_conditions for the mission are met.
»battery_capacityBattery capacityintThe percentage threshold of aircraft battery power for executable missions. The aircraft battery power must be greater than battery_capacity when the mission starts.
»begin_timeStart time of the mission's executable periodint{"length":13}Start time of the mission's executable period in milliseconds; the mission must start execution after the time specified in begin_time.
»end_timeEnd time of the mission execution periodint{"length":13}Deadline in milliseconds for the mission execution period, the execution time must be less than end_time.
executable_conditionsMission execution conditionsstructOptional field for adding pre-execution check conditions on the device side. The mission will fail if any of the conditions are not met.
»storage_capacityStorage capacityintThe minimum storage capacity of the dock or aircraft that can execute tasks. If the storage capacity of the dock or aircraft does not meet storage_capacity, the task execution fails.
break_pointWayline breakpoint informationstructOptional field for resuming from breakpoint. If specified, the wayline mission will resume from the specified breakpoint.
»indexBreakpoint numberint
»stateBreakpoint stateenum_int{"0":"On segment","1":"On waypoint"}
»progressCurrent segment progressfloat{"max":"1.0","min":"0"}
»wayline_idWayline IDint
rth_altitudeReturn home altitudeint{"max":1500,"min":20,"unit_name":"Meters / m"}
rth_modeReturn home altitude modeenum_int{"0":"Intelligent altitude","1":"Preset altitude"}In intelligent return home mode, the aircraft will automatically plan the optimal return home altitude. The DJI dock currently does not support setting the return home altitude mode and can only choose the 'Preset Altitude' mode. When the environment or lighting does not meet the requirements of the visual system (such as direct sunlight in the evening, weak or no light at night), the aircraft will use the return home altitude you set for straight-line return home.
out_of_control_actionRemote controller lost control actionenum_int{"0":"Returning to home","1":"Hovering","2":"Landing"}Out-of-control action, the current fixed value is 0, which means return to home. Note that the enumeration definition is inconsistent between the flight control and the dock, and the dock side will perform conversion.
exit_wayline_when_rc_lostWayline lost control actionenum_int{"0":"Continue executing the wayline mission","1":"Exit wayline mission, execute remote controller lost control action"}Keep consistent with the KMZ file
wayline_precision_typeWayline Precision Typeenum_int{"0":"GPS Mission","1":"High-precision RTK mission"}High-precision RTK mission: After takeoff, the aircraft will wait in the air until RTK convergence before executing the mission. The mission cannot be paused during the waiting process. It is recommended for default scenarios. GPS Mission: The aircraft can start executing without waiting for RTK convergence. It is recommended for tasks with low precision requirements or tasks with high requirements for takeoff timeliness.
simulate_missionWhether to execute the mission in the simulatorstructOptional field for simulating mission debugging indoors.
»is_enableWhether to enable the simulator missionenum_int{"0":"Do not enable","1":"Enable"}Open or close the simulator for this mission
»latitudeLatitudedouble{"max":"90.0","min":"-90.0"}
»longitudeLongitudedouble{"max":"180.0","min":"-180.0"}
flight_safety_advance_checkPre-check for flight safetybool{"0":"Closed","1":"Opened"}Set to pre-check the flight safety for Take Off and flight route task.This field is optional. The default value is 0, which represents closed. 1 represents opened.Checking if the local operating area file is consistent with the cloud side before the task starts. If the files are different, pull file from the cloud side to update.

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,
		"exit_wayline_when_rc_lost": 0,
		"file": {
			"fingerprint": "xxxx",
			"url": "https://xxx.com/xxxx"
		},
		"flight_id": "xxxxxxx",
		"flight_safety_advance_check": 1,
		"out_of_control_action": 0,
		"ready_conditions": {
			"battery_capacity": 90,
			"begin_time": 1234567890123,
			"end_time": 1234567890123
		},
		"rth_altitude": 100,
		"simulate_mission": {
			"is_enable": 1,
			"latitude": 22.1223,
			"longitude": 113.2222
		},
		"task_type": 2,
		"wayline_precision_type": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "flighttask_prepare"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_prepare

Data:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "flighttask_prepare"
}

Create a mission (deprecated)

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_create

Data:

ColumnNameTypeconstraintDescription
flight_idPlan IDtext
typeMission typetext
fileWayline file objectstruct
»urlFile URLtext
»signMD5 signaturetext

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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"method": "flighttask_create"
}

Requests

Obtain dock task execution state

Dock requests for the task execution state of the other dock during the multi-dock task.

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: flighttask_progress_get

Data:

ColumnNameTypeconstraintDescription
target_snTarget device sntext
flight_idTarget flight route task uuidtext

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"target_sn": "xxx"
	},
	"gateway": "xxx",
	"method": "flighttask_progress_get",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123
}

Topic: thing/product/{gateway_sn}/requests_reply

Direction: down

Method: flighttask_progress_get

Data:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error
outputOutputstruct
»flight_idDevice's latest current task IDtext
»progressTask progressstructField enumeration values are the same as those in the reported flight task progress progress field
»»current_stepExecution stepint
»»percentExecution progressint{"max":"100","min":"0","step":"","unit_name"}
»statusTask statetextField enumeration values are the same as those in the reported flight task progress status field

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"output": {
			"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
			"progress": {
				"current_step": 27,
				"percent": 90
			},
			"status": "in_progress"
		},
		"result": 0
	},
	"gateway": "xxx",
	"method": "flighttask_progress_get",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 0
}

Obtain mission resources

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: flighttask_resource_get

Data:

ColumnNameTypeconstraintDescription
flight_idPlan IDtext

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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero represents an error
outputOutputstruct
»fileWayline file objectstruct
»»urlFile URLtext
»»fingerprintFile signaturetextFile 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"
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.