wayline

2023-11-30
No Rating

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:

ColumnNameTypeconstraintDescription
actionNotification type of exiting RTHenum_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.
reasonReason for exiting RTHenum_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:

ColumnNameTypeconstraintDescription
extExpand contentstruct
»current_waypoint_indexCurrent waypoint indexint
»wayline_mission_stateWayline mission stateenum_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_countMedia file number generated by the wayline mission executionint
»track_idWayline IDtext
»flight_idMission IDtext
»break_pointWayline breakpoint informationstructOptional field for resuming interrupted wayline task. If specified, the wayline task will start executing from the breakpoint position indicated by the field.
»»indexBreakpoint indexint
»»stateBreakpoint stateenum_int{"0":"On the wayline segment","1":"On the waypoint"}
»»progressCurrent wayline segment progressfloat{"max":"1.0","min":"0"}
»»wayline_idWayline IDint
»»break_reasonBreak reasonenum_int{}
»»latitudeBreakpoint latitudefloat{"max":"90","min":"-90","unit":"degree / °"}
»»longitudeBreakpoint longitudefloat{"max":"180","min":"-180","unit":"degree / °"}
»»heightBreakpoint altitude relative to the Earth's ellipsoid surfacefloat{"unit":"meter / m"}
»»attitude_headBreakpoint yaw anglefloatYaw 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_idCurrently working wayline IDintThis includes the transitional phase of entering the flight path. For example, 0 indicates that the spacecraft is entering or already executing the first route.
statusTask stateenum_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"}
progressProgressstruct
»current_stepExecute Stepenum_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"}
»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,
				"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:

ColumnNameTypeconstraintDescription
flight_idsMission IDarray{"size": }The task ID set that currently satisfies the task readiness conditions
»[array_item]Elements in arraytext

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:

ColumnNameTypeconstraintDescription
planned_path_pointsPlanned trajectory point listarray{}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 arraystruct{}{"size": ""}
»»latitudeTrajectory 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.
»»longitudeTrajectory 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.
»»heightTrajectory point heightfloat{"unit":"meter / m","step":0.1}ellipsoidal height
last_point_typeType of the last point of trajectoryenum_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_idMission IDtextCurrently 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:

ColumnNameTypeconstraintDescription
flight_idMission 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-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 configurationopen in new window 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:

ColumnNameTypeconstraintDescription
flight_idMission IDtext
execute_timeExecution start timeint{"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_typeMission typeenum_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_typeWayline typeenum_int{"0":"Normal waypoint wayline"}
fileWayline file objectstruct
»urlFile URLtext
»fingerprintFile signaturetextFile content MD5 signature
ready_conditionsNotification of task readinessstructOptional 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_capacityBattery capacityintThe aircraft battery percentage threshold of the executable task. The aircraft battery must be greater than the battery_capacity when the task starts.
»begin_timeStart time of the mission executable periodint{"length":13}Start millisecond timestamp of the mission executable period. The mission execution time should be later than the begin_time
»end_timeEnd time of the mission executable periodint{"length":13}End millisecond timestamp of the mission executable period. The mission execution time should be earlier than the end_time.
executable_conditionsMission executable conditionstructOptional field. Pre-check conditions added for task execution on the device side. If any condition is not satisfied, execution will fail.
»storage_capacityStorage capacityintThe 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_pointWayline breakpoint informationstructOptional field for resuming interrupted wayline task. If specified, the wayline task will start executing from the breakpoint position indicated by the field.
»indexBreakpoint indexint
»stateBreakpoint stateenum_int{"0":"On the wayline segment","1":"On the waypoint"}
»progressCurrent wayline segment processfloat{"max":"1.0","min":"0"}
»wayline_idWayline IDint
rth_altitudeReturn-to-home altitudeint{"max":1500,"min":20,"unit":"meter / m"}
rth_modeRTH height modeenum_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_actionRemote controller out of control actionenum_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_lostWayline out of control actionenum_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_missionWhether execute mission in simulatorstructOptional field. Used to indoor debugging the simulated mission.
»is_enableWhether enable a simulated missionenum_int{"0":"Disable","1":"Enable"}
»latitudeLatitudedouble{"max":"90.0","min":"-90.0"}
»longitudeLongitudedouble{"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:

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-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:

ColumnNameTypeconstraintDescription
flight_idMission IDtext

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:

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-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:

ColumnNameTypeconstraintDescription
flight_idsMission IDarray{"size": }
»[array_item]Elements in arraytext

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

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-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:

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-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:

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-0 means error
outputOutputstruct
»statusMission stateenum_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:

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-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:

ColumnNameTypeconstraintDescription
flight_idMission 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-0 means 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.