Precision Positioning
The header file for precision positioning-related functions is uav_positioning.h
. This document describes the key information and usage of the structures and function prototypes defined in the uav_positioning.h
file.
Note: Payload devices developed using the PSDK can use
uav_positioning.h
Content
Macro Definitions, Enums, and Structures
- typedef enum E_UAVPositioningProperty
- typedef struct T_UAVPositioningEventInfo
- typedef struct T_UAV_PositioningPositionDeviation
- typedef struct T_UAVPositioningPositionInfo
Function Prototype
- function uav_positioning_init
- function uav_positioning_deinit
- function UAV_Positioning_GetCurrentPositioning_Sync
Macro Definitions, Enums, and Structures
typedef enum E_UAVPositioningProperty
typedef enum {
UAV_POSITIONING_PROPERTY_NOT_AVAILABLE = 0, /*!< Position solution is not available. */
UAV_POSITIONING_PROPERTY_FIX_POSITION = 1, /*!< Position solution is available. */
}E_UAVPositioningProperty;
typedef struct T_UAVPositioningEventInfo
typedef struct {
/*! Index of event set in which positioning event is located. If not needed, fill in 0. */
uint16_t eventIndex;
/*! Timestamp in aircraft time system when the positioning event occur. Users should transfer time in local time
* system to time in aircraft time system from time synchronization module. */
T_UAVTimeSyncAircraftTime timestamp;
}T_UAVPositioningEventInfo;
typedef struct T_UAV_PositioningPositionDeviation
typedef struct {
float longitude; /*!< Longitude in degrees. */
float latitude; /*!< Latitude in degrees. */
float altitude; /*!< Altitude in meters. */
}T_UAV_PositioningPositionDeviation;
typedef struct T_UAVPositioningPositionInfo
typedef struct {
E_UAVPositioningProperty property;
T_UAVAttitude3d uavAttitude; /*!< Specifies UAV attitude, unit: degree. */
T_UAV_PositioningPosition position;
T_UAV_PositioningPositionDeviation positionDeviation; /*!< Specifies position deviation, unit: meter. */
}T_UAVPositioningPositionInfo;
Function Prototype
function UAV_Positioning_Init
Precision positioning initialization request
Note: Users need to register a GPIO callback function manually to control GPIO for triggering RTK events.
extern T_UAVReturnCode UAV_Positioning_Init(T_UAVRtkGpioSetCallback gpioCallback, const std::string rtkDevPath);
function UAV_Positioning_Deinit
Precision positioning deinitialization request
extern void UAV_Positioning_Deinit(void);
function UAV_Positioning_GetCurrentPositioning_Sync
Call this interface to obtain precise positioning information and other related data for a target point. For details, refer to: T_UAVPositioningPositionInfo
.
Note:
- Developers can obtain positioning information triggered by multiple positioning events simultaneously, such as retrieving positioning data during synchronized zoom actions of multiple camera payload devices on the UAV.
- When a positioning event occurs, this interface will retrieve precise positioning information in a blocking manner.
- Before obtaining precise positioning data, developers must register a callback function to get the latest PPS timestamp of the UAV. For details, see:
UAV_TimeSync_RegGetNewestPpsTriggerTimeCallback()
.- When acquiring precise positioning data, the target point for positioning defaults to the center of the main gimbal interface.
- Developers can calculate the precise coordinates of the point of interest using the center of the main gimbal, the distance between the main gimbal and the RTK main antenna, UAV attitude angles, and gimbal structure data.
- The execution time of this interface may exceed 600 ms.
- All requested timestamps must fall between 2 seconds and 1 second before the latest synchronized timestamp.
extern T_UAVReturnCode UAV_Positioning_GetCurrentPositioning_Sync(T_UAVPositioningPositionInfo *positionInfo);
- ParameterpositionInfo: Pointer to the position information
- Return code The corresponding return code is output based on the program execution. For details, please refer to: UAV Error Codes.