Waypoint Mission
Waypoint planning is a control feature that enables the UAV to fly along a predefined route, achieving autonomous flight. Developers can call Autel PSDK interfaces to control the UAV to fly to a specified location at a designated altitude and perform corresponding actions. Depending on actual needs, the UAV can also be instructed to repeat specific missions multiple times, enabling automated patrol and other functions.
Waypoints
When creating a waypoint mission, developers must specify the number of waypoints and their corresponding types.
Number of Waypoints
To execute a waypoint mission, developers are required to use a .kmz
file to define the waypoints the UAV needs to reach. Autel PSDK supports a maximum of 65,535 waypoints in a single mission and requires a minimum of 2 waypoints.
Waypoint Types
Waypoint type refers to how the UAV approaches a waypoint during a mission. The supported types include curved flight, linear flight, and coordinated turn.
- Curved Flight
- The UAV performs the mission with continuous curvature and does not pause at the specified waypoint.
- The UAV performs the mission with continuous curvature and pauses at the waypoint.
- The UAV performs the mission with discontinuous curvature and pauses at the waypoint.
- The UAV performs the mission with continuous curvature and does not pause at the specified waypoint.
- Straight-Line Flight
- Straight-line entry
- Straight-line exit
- Straight-line entry
- Coordinated Turn: The UAV begins turning before reaching the waypoint
Actions
When using waypoint missions, developers or users can assign specific actions for the UAV to perform at designated waypoints, such as taking photos, recording videos, or hovering.
Action Management:
- Supports camera focus actions.
- Supports incremental control of gimbal angles.
Action Triggers
To trigger specific UAV actions during the execution of a waypoint mission, conditions for triggering the actions must be defined:
- Timed trigger
- Distance-based trigger
- Waypoint trigger: The UAV triggers the action at the end of the Nth waypoint during waypoint flight
Speed Control
The PSDK provides a speed control feature that allows developers to assign different speeds to specific waypoints (multiple speeds can be set for the same waypoint). It also supports querying or modifying the global cruise speed during the execution of a waypoint flight mission.
RC Link Loss Action
Added support for configuring the UAV to continue executing the waypoint mission after losing connection with the remote controller.
Note:
- When using an application developed with the PSDK to control the UAV, the user can use the remote controller to adjust flight parameters such as speed, altitude, and heading.
- The UAV can only execute one automated flight mission at a time. When a new mission is uploaded, the existing one will be overwritten.
- In a waypoint mission, , waypoints and UAV actions are not necessarily related. Developers can independently add waypoints and configure flight actions as needed.
Workflow
The waypoint mission is executed by the UAV according to the following process:
- Upload overall mission information
A waypoint mission includes: mission ID, number of waypoints, post-mission action, maximum flight speed and cruising speed, waypoint altitude type, signal loss behavior, safety takeoff altitude, etc.
- Upload waypoint information
- Basic parameters: waypoint coordinates (longitude, latitude, and ellipsoidal height, or altitude above takeoff level), heading type, and flight speed.
- Optional parameters: heading angle, turning mode, point of interest, per-waypoint cruise speed.
Note: Optional waypoint parameters can only be set after all basic parameters have been configured.
- Set action information (optional) Set the action ID, trigger, and actuator.
- Upload the waypoint mission information for the UAV
- Control the UAV to execute the waypoint mission Once the waypoints and corresponding action information have been uploaded, the developer can use the designated interfaces to control the mission — such as starting, stopping, or pausing the mission.
Using Waypoint Missions
1. Waypoint Mission Initialization
Before executing a waypoint mission, initialization must be performed.
uavStat = UAV_Waypoint_Init();
if (uavStat != 0) {
LOG_ERROR("Waypoint init error.");
return uavStat;
}
2. Register Callback Function
- If you need to monitor the status of the waypoint mission, call this interface to register a callback function before uploading the
.kmz
file
uavStat = UAV_Waypoint_RegisterMissionStateCallback(WaypointMissionStateHandler);
if (uavStat != 0) {
LOG_ERROR("UAV_Waypoint_RegisterMissionStateCallback error.");
return uavStat;
}
- If you need to monitor the status of waypoint actions, call this interface to register the callback function before uploading the
.kmz
file
uavStat = UAV_Waypoint_RegisterActionStateCallback(WaypointActionStateHandler);
if (uavStat != 0) {
LOG_ERROR("UAV_Waypoint_RegisterActionStateCallback error.");
return uavStat;
}
3. Upload Waypoint Mission
Upload the waypoint mission .kmz
file.
uavStat = UAV_Waypoint_UploadFile_kmz(kmz_file.c_str());
if (uavStat != 0) {
LOG_ERROR("UploadFile kmz error.");
return uavStat;
}
4. Control the UAV to Execute the Waypoint Mission
Select the appropriate enumeration value for the action to be executed based on the actual scenario.
typedef enum {
UAV_WAYPOINT_ACTION_START = 0, /*!< waypoint mission start action */
UAV_WAYPOINT_ACTION_STOP, /*!< waypoint mission stop action */
UAV_WAYPOINT_ACTION_PAUSE, /*!< waypoint mission pause action */
UAV_WAYPOINT_ACTION_RESUME, /*!< waypoint mission resume action */
}E_UAV_WAYPOINT_ACTION;
uavStat = UAV_Waypoint_Action(UAV_WAYPOINT_ACTION_START, 3000);
if (uavStat != 0) {
LOG_ERROR("Waypoint Action start error.");
return uavStat;
}