The waypoint mission handler has uploaded the the mission's summary (information except waypoints).
int uploadedWaypointIndex
The index of the last uploaded waypoint. Information for each waypoint is uploaded one by one in ascending order. If no waypoint has been uploaded, the value will be -1.
int totalWaypointCount
The total count of waypoints in the waypoint mission.
int errorCode
The encountered error during upload if there is any. Otherwise, it is null.
The index of the last downloaded waypoint. Information for each waypoint is downloaded one by one in ascending order. If no waypoint has been downloaded, the value will be -1.
int totalWaypointCount
The total count of waypoints in the waypoint mission.
int errorCode
The encountered error during download if there is any. Otherwise, it is null.
Index of the waypoint for the next mission to which the aircraft will proceed.
int totalWaypointCount
The total count of waypoints in the waypoint mission.
bool isWaypointReached
true when the aircraft reaches a waypoint. After the waypoint actions and heading change is complete, the targetWaypointIndex will increment and this property will become false.
bool isExecutionFinish
If the waypoint mission is finished.
WaypointMissionExecuteState state
The current state of the waypoint mission handler.
int errorCode
The encountered error during the execution if there is any. Otherwise, it is null.
In the waypoint mission, the aircraft will travel between waypoints, execute actions at waypoints, and adjust heading and altitude between waypoints. Waypoints are physical locations to which the aircraft will fly. Creating a series of waypoints, in effect, will program a flight route for the aircraft to follow. Actions can also be added to waypoints, which will be carried out when the aircraft reaches the waypoint. The aircraft travels between waypoints automatically at a base speed. However, the user can change the speed by using the pitch joystick. If the stick is pushed up, the speed will increase. If the stick is pushed down, the speed will slow down. The stick can be pushed down to stop the aircraft and further pushed to start making the aircraft travel back along the path it came. When the aircraft is travelling through waypoints in the reverse order, it will not execute waypoint actions at each waypoint. If the stick is released, the aircraft will again travel through the waypoints in the original order, and continue to execute waypoint actions (even if executed previously). If the aircraft is pulled back along the waypoint mission all the way to the first waypoint, then it will hover in place until the stick is released enough for it to again progress through the mission from start to finish.
Struct Members:
int waypointCount
Number of waypoints in the waypoint mission. Note there are some cases when the waypoint count will be different to the waypoint array length from waypoints. This is usually the case when the waypoint mission is still being downloaded from the aircraft and the mission object hasn't existed previously (e.g. when the mobile device is connected to an aircraft with a previously uploaded mission). In these cases, isComplete will return null.
double maxFlightSpeed
While the aircraft is travelling between waypoints, you can offset its speed by using the throttle joystick on the remote controller. maxFlightSpeed is this offset when the joystick is pushed to maximum deflection. For example, If maxFlightSpeed is 10 m/s, then pushing the throttle joystick all the way up will add 10 m/s to the aircraft speed, while pushing down will subtract 10 m/s from the aircraft speed. If the remote controller stick is not at maximum deflection, then the offset speed will be interpolated between [0, maxFlightSpeed] with a resolution of 1000 steps. If the offset speed is negative, then the aircraft will fly backwards to previous waypoints. When it reaches the first waypoint, it will then hover in place until a positive speed is applied. maxFlightSpeed has a range of [2,15] m/s.
double autoFlightSpeed
The base automatic speed of the aircraft as it moves between waypoints with range [-15, 15] m/s. The aircraft's actual speed is a combination of the base automatic speed, and the speed control given by the throttle joystick on the remote controller. If autoFlightSpeed > 0: Actual speed is autoFlightSpeed + Joystick Speed (with combined max of double maxFlightSpeed) If autoFlightSpeed = 0: Actual speed is controlled only by the remote controller joystick. If autoFlightSpeed < 0 and the aircraft is at the first waypoint, the aircraft will hover in place until the speed is made positive by the remote controller joystick.
WaypointMissionFinishedAction finishedAction
Action the aircraft will take when the waypoint mission is complete.
WaypointMissionHeadingMode headingMode
Heading of the aircraft as it moves between waypoints. Default is AUTO.
WaypointMissionFlightPathMode flightPathMode
The path the aircraft follows between waypoints. The aircraft can either fly directly between waypoints in a straight line, or turn near a waypoint in the curve where the waypoint location defines a part of the curve.
TRUE if the gimbal pitch rotation can be controlled during the waypoint mission. When TRUE, double gimbalPitch in Waypoint is used to control gimbal pitch.
int repeatTimes
Mission execution can be repeated more than once. A value of 0 means the mission only executes once, and does not repeat. A value of 1 means the mission will execute a total of two times.
This enum will determine the goto point mode while the drone executes the flight.
Enum Members:
SAFELY
Go to the waypoint safely. The aircraft will rise to the same altitude of the waypoint if the current altitude is lower then the waypoint altitude. It then goes to the waypoint coordinate from the current altitude, and proceeds to the altitude of the waypoint.
POINT_TO_POINT
Go to the waypoint from the current aircraft point to the waypoint directly.
Aircraft has reached a waypoint, has rotated to the new heading and is now processing actions. This state will be called before the waypoint actions starts executing and will occur for each waypoint action.
DOING_ACTION
Aircraft is at a waypoint and is executing an action.
FINISHED_ACTION
Aircraft is at a waypoint and has finished executing the current waypoint action. This state occurs once for each waypoint action.
Loads a waypoint mission into the device memory. A mission can be loaded only when the WaypointMissionState is one of the following:READY_TO_UPLOAD or READY_TO_EXECUTE. Calling LoadMission when the current state is READY_TO_EXECUTE will change the state to READY_TO_UPLOAD.
Gets the currently loaded mission of the manager. There are two ways to load a mission. 1. A mission can be loaded by user through loadMission. 2. If the aircraft is already executing a waypoint mission when SDK is re-connected, the manager will download part of the mission's information from the aircraft and load it automatically. In that case, the loaded mission will only contain the summary of the executing mission but information for each waypoint is absent. User can call DownloadMission to get all the information for the loaded mission. The loadedMission will be reset to null when the execution of the loadedMission is stopped, finished or interrupted.
Starts to upload the GetLoadedMission to the aircraft. It can only be called when the GetCurrentState is READY_TO_UPLOAD. If a timeout error occurs during the previous upload, the upload operation will resume from the previous break-point. After a mission is uploaded successfully, the GetCurrentState will become READY_TO_EXECUTE.The upload progress will be notify by UploadStateChanged .
If app is restart and waypoint mission is executing,you need to download mission from aircraft. The operation will download information of each waypoint from aircraft and save it to GetLoadedMission. If a download operation is started, the manager will download the information of waypoints missing in GetLoadedMission one-by-one in ascending order. It can only be called when the GetCurrentState is one of the following: - EXECUTING - EXECUTE_PAUSED,The download progress will be notify by DownloadStateChanged .