The class to manage the waypoint mission, it is used to upload, execute, pause and resume the mission and it also provides a listener to monitor the execution status of a waypoint mission. For waypoint editing functions, please refer to: IWPMZManager.
Add a listener of waypoint mission execution state. It can be used to listen the execution status of waypoint mission, such as uploading waypoint mission KMZ file, enter wayline flying, and wwaypoint mission finished, etc.
Add a listener of waylines execution information. The wayline information includes the currently executed wayline ID and the currently executed waypoint index.
Add a listener of waypoint action execution. Including waypoint action start execution information and finish execution information. Note: M300 RTK and M350 RTK only support 1 wayline ID. Note: For the V2 waypoint design scheme used by the M300 RTK and M350 RTK, the waypoint action callback information cannot be obtained when the waypoint executed by DJI Pilot is switched to the MSDK App. It is recommended to save the waypoint mission generated by DJI Pilot and then load the waypoint KMZ file in the MSDK App to execute the mission.
The waypoint mission is defined in a KMZ file, KMZ file is defined according to the DJI standard WPML. The WPML is defined according to XML and KML. For more details, please see: DJI WPML.
Users can generate a KMZ file according to the template provided by DJI Pilot 2. You can also define custom waylines.wpml according to DJI WPML standard and upload it after compressing it into a KMZ file.
The newly uploaded KMZ file will override the previously uploaded KMZ file if they have the same mission KMZ file name.
You can call this interface multiple times to upload multiple waypoint mission KMZ files. You can set mission KMZ file name to select the mission to startstartMission or stopstopMission.
One KMZ file includes one waypoint mission. One waypoint mission can contain multiple waylines.
Start the waypoint mission. Note: Please do not call KeyStartGoHome during the take-off phase of the waypoint mission:. If you need to stop the waypoint mission, you can call stopMission.
Returns a list of wayline IDs available in the specified mission file. After obtaining this wayline ID list, you can select the wayline ID to be executed and pass it as a parameter to startMission to execute the waypoint mission. Note: M300 RTK and M350 RTK only support 1 wayline ID.
Supported since MSDK 5.1.0
Input Parameters:
String missionFileName
The specified mission filename.
Return:
List<Integer>
Get a list of wayline IDs available in the specified mission file.
Start executing the waypoint mission of the specified Wayline IDs list. A list of available wayline IDs can be obtained through getAvailableWaylineIDs, after obtaining this wayline IDs list, you can select the wayline ID to be executed as a parameter and pass it to this interface, the aircraft will execute the waypoint mission in sequence in the order of the wayline IDs list. If the wayline IDs list parameter is empty or the length of the wayline IDs list is 0, the aircraft will execute all waylines in the waypoint mission. Note: 1. M300 RTK and M350 RTK only support 1 wayline ID. 2. Please do not call KeyStartGoHome during the take-off phase of the waypoint mission:. If you need to stop the waypoint mission, you can call stopMission.
Query the breakpoint information when the waypoint mission is paused. The breakpoint information includes the position of the aircraft where the waypoint mission is paused. After the breakpoint information is obtained, it can be passed as a parameter to startMission or resumeMission to execute the waypoint mission. The aircraft will fly to the incoming breakpoint position, and then execute the waypoint mission in sequence according to the waypoint order.
Note:
The M300 RTK and M350 RTK do not support the breakpoint function.
The breakpoint information can only be queried after calling the pause waypoint mission interface pauseMission.
Start executing the waypoint mission at the specified breakpoint. You can use queryBreakPointInfoFromAircraft to query the breakpoint information when the last waypoint mission was suspended. After the breakpoint information is obtained, it can be passed as a parameter to this interface, and the aircraft will fly to the incoming breakpoint position, and then execute waypoint mission in sequence according to the waypoint order. If you don't want to start the waypoint mission from the position of the aircraft when it was paused last time, you can also construct the breakpoint information by yourself and set any waypoint position to start the waypoint mission.
Note:
The M300 RTK and M350 RTK do not support this interface to execute the waypoint mission at the specified breakpoint. If you want to resume flying to the next waypoint after pausing, please set the breakpoint recovery type setRecoverActionType through resumeMission.
After suspending the waypoint mission, this interface can be called to re-execute the waypoint mission only after exiting the waypoint mission. Common application scenarios include: return and land after the flight mission is completed or the aircraft is powered on again.
If you want to start flying from the specified breakpoint without exiting the waypoint mission. You can call resumeMission to resume execution of the waypoint mission.
Resume execution of the waypoint mission from the specified breakpoint. You can query the breakpoint information when the waypoint mission is paused through queryBreakPointInfoFromAircraft. After the breakpoint information is obtained, it can be passed as a parameter to this interface, and the aircraft will fly to the incoming breakpoint position, and then execute waypoint mission in sequence according to the waypoint order. If you don't want to start the waypoint mission from the position of the aircraft when it was paused last time, you can also construct the breakpoint information by yourself and set any waypoint position to resume the waypoint mission.
Note:
M300 RTK and M350 RTK do not support querying the breakpoint information when the waypoint mission is paused through queryBreakPointInfoFromAircraft. Only support to construct the breakpoint information by yourself and setting breakpoint recovery type RecoverActionType through setRecoverActionType to resume waypint mission.