Positioning
This is the header file for "psdk_positioning.c", defining the structure and (exported) function prototypes.
Catalog
Structure
T_PsdkPositioningEventInfo
T_PsdkPositioningPosition
T_PsdkPositioningPositionStandardDeviation
T_PsdkPositioningPositionInfoFunction
PsdkPositioning_Init
PsdkPositioning_SetTaskIndex
PsdkPositioning_GetPositionInformationSync
Structure
typedef struct T_PsdkPositioningEventInfo
Data structure that describes a positioning event
typedef struct {
uint16_t eventSetIndex; Index of event set in which positioning event is located.
The item will be written to mark file in aircraft for some post-precess work. If not needed, fill in 0.
uint8_t targetPointIndex; Index of target point in payload whose
position user is requesting. The item will be written to mark file in aircraft for some post-precess work. If not needed, fill in 0.
T_PsdkTimeSyncAircraftTime eventTime; Timestamp in aircraft time system
when the positioning event occur. Users should transfer time in local time system to time in aircraft time system by PsdkTimeSync_TransferToAircraftTime() interface in time synchronization module.
} T_PsdkPositioningEventInfo;
typedef struct T_PsdkPositioningPosition
Data structure that describes position of a point
typedef struct {
psdk_f64_t longitude; Specifies longitude, unit: degree.
psdk_f64_t latitude; Specifies latitude, unit: degree.
psdk_f64_t height; Specifies height above sea level, unit: m.
} T_PsdkPositioningPosition;
typedef struct T_PsdkPositioningPositionStandardDeviation
Position value standard deviation
typedef struct {
psdk_f32_t longitude; Specifies longitude standard deviation, unit: degree.
psdk_f32_t latitude; Specifies latitude standard deviation, unit: degree.
psdk_f32_t height; Specifies height standard deviation, unit: m.
} T_PsdkPositioningPositionStandardDeviation;
typedef struct T_PsdkPositioningPositionInfo
Position of target point and other details returned by interface of requesting position.
typedef struct {
E_PsdkDataSubscriptionPositionSolutionProperty positionSolutionProperty; Property of position solution.
T_PsdkAttitude3d uavAttitude; Specifies UAV attitude, unit: degree.
T_PsdkVector3d offsetBetweenMainAntennaAndTargetPoint; Specifies position offset from RTK main
antenna to target points in NED coordinate system, unit: mm.
T_PsdkPositioningPosition targetPointPosition; Specifies position of target points in GROUND coordinate system.
T_PsdkPositioningPositionStandardDeviation targetPointPositionStandardDeviation;
Specifies position standard deviation of target points.
} T_PsdkPositioningPositionInfo;
Function
function PsdkPositioning_Init
Function:Initialise positioning module in blocking mode | product:all |
User should call this function before all other positioning operations, just like setting task index, register callback function and requesting positions.
NOTE
- Max execution time of this function is slightly larger than 500ms.
- This function has to be called in user task, rather than main() function, and after scheduler being started.
T_PsdkReturnCode PsdkPositioning_Init(void);
Return
The details for the return code please refer to:PsdkErrorCode
function PsdkPositioning_SetTaskIndex
Function:Set task index | product:all |
A task may include aerial surveying and mapping of an area. The default task index is 0.
void PsdkPositioning_SetTaskIndex(uint8_t index);
index:task index
function PsdkPositioning_GetPositionInformationSync
Function:Get the position | product: Matrice 200 RTK V2, Matrice 300 RTK |
The interface is used to get the position of target points and other information (refer to ::T_PsdkPositioningPositionInfo)
NOTE
- Users can request positions for multiple events (event set) conveniently, such as sync exposure of multiple cameras.
- User must register callback function used to get the newest PPS triggered timestamp (refer to PsdkPositioning_RegGetNewestPpsTriggerTimeCallback()) before requesting position.
- Users can use position information of gimbal interface center, position offset between gimbal interface center and RTK main antenna, UAV attitude, gimbal structure parameters ,and gimbal attitude to calculate the position of interest points in the payload.
- Max execution time of this function is slightly larger than 600ms.
- All requested timestamp have to be between the time point 2 seconds earlier than the newest synchronized timestamp and the time point 1 seconds earlier than the newest synchronized timestamp.
T_PsdkReturnCode PsdkPositioning_GetPositionInformationSync(uint8_t eventCount, T_PsdkPositioningEventInfo *eventInfo,
T_PsdkPositioningPositionInfo *positionInfo);
eventCount:count of positioning event set specified by eventInfo parameter. Please ensure the count is less than 5.
eventInfo:pointer to positioning event information array
positionInfo:the position of target points
Return
The details for the return code please refer to:PsdkErrorCode