Positioning
The header file for precise positioning related functions is dji_positioning.h
. This document describes the key information and usage of the structure and function prototypes in the dji_positioning.h
file.
Catalog
Struct
T_DjiPositioningEventInfo
T_DjiPositioningPosition
T_DjiPositioningPositionStandardDeviation
T_DjiPositioningPositionInfoFunction
DjiPositioning_Init
DjiPositioning_SetTaskIndex
DjiPositioning_GetPositionInformationSync
Struct
typedef struct T_DjiPositioningEventInfo
typedef struct {
/*! 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. */
uint16_t eventSetIndex;
/*! 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. */
uint8_t targetPointIndex;
/*! 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 DjiTimeSync_TransferToAircraftTime() interface in time
* synchronization module. */
T_DjiTimeSyncAircraftTime eventTime;
} T_DjiPositioningEventInfo;
typedef struct T_DjiPositioningPosition
typedef struct {
dji_f64_t longitude; /*!< Specifies longitude, unit: degree. */
dji_f64_t latitude; /*!< Specifies latitude, unit: degree. */
dji_f64_t height; /*!< Specifies height above sea level, unit: m. */
} T_DjiPositioningPosition;
typedef struct T_DjiPositioningPositionStandardDeviation
typedef struct {
dji_f32_t longitude; /*!< Specifies longitude standard deviation, unit: degree. */
dji_f32_t latitude; /*!< Specifies latitude standard deviation, unit: degree. */
dji_f32_t height; /*!< Specifies height standard deviation, unit: m. */
} T_DjiPositioningPositionStandardDeviation;
typedef struct T_DjiPositioningPositionInfo
typedef struct {
E_DjiFcSubscriptionPositionSolutionProperty positionSolutionProperty; /*!< Property of position solution. */
T_DjiAttitude3d uavAttitude; /*!< Specifies UAV attitude, unit: degree. */
T_DjiVector3d offsetBetweenMainAntennaAndTargetPoint; /*!< Specifies position offset from RTK main antenna to target points in NED coordinate system, unit: mm. */
T_DjiPositioningPosition targetPointPosition; /*!< Specifies position of target points in GROUND coordinate system. */
T_DjiPositioningPositionStandardDeviation targetPointPositionStandardDeviation; /*!< Specifies position standard deviation of target points. */
} T_DjiPositioningPositionInfo;
Function
function DjiPositioning_Init
Function:Initialise positioning module in blocking mode | product:all |
T_DjiReturnCode DjiPositioning_Init(void);
Return
The details for the return code please refer to: DjiErrorCode
function DjiPositioning_SetTaskIndex
Function:Set task index | product:Matrice 300 RTK |
void DjiPositioning_SetTaskIndex(uint8_t index);
index:task index.
function DjiPositioning_GetPositionInformationSync
Function:Get precise positioning information | product:all |
The interface is used to get the position of target points and other information (refer to ::T_DjiPositioningPositionInfo) based on the timestamp in aircraft time system when some events (positioning events) are triggered. The function uses blocking mode.
T_DjiReturnCode DjiPositioning_GetPositionInformationSync(uint8_t eventCount, T_DjiPositioningEventInfo *eventInfo,
T_DjiPositioningPositionInfo *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. In Matrice 210 RTK V2 and Matrice 300 RTK aircraft system, it is the position of the main gimbal interface always.
Return
The details for the return code please refer to: DjiErrorCode