DJI Payload SDK  1.5.3
psdk_cmdset_positioning.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file psdk_cmdset_positioning.h
4  * @version V1.5.0
5  * @date 2019/07/31
6  * @brief This file defines positioning command set.
7  *
8  * @copyright (c) 2017-2018 DJI. All rights reserved.
9  *
10  * All information contained herein is, and remains, the property of DJI.
11  * The intellectual and technical concepts contained herein are proprietary
12  * to DJI and may be covered by U.S. and foreign patents, patents in process,
13  * and protected by trade secret or copyright law. Dissemination of this
14  * information, including but not limited to data and other proprietary
15  * material(s) incorporated within the information, in any form, is strictly
16  * prohibited without the express written consent of DJI.
17  *
18  * If you receive this source code without DJI’s authorization, you may not
19  * further disseminate the information, and you must immediately remove the
20  * source code and notify DJI of its removal. DJI reserves the right to pursue
21  * legal actions against you for any loss(es) or damage(s) caused by your
22  * failure to do so.
23  *
24  ******************************************************************************
25  */
26 
27 /* Define to prevent recursive inclusion -------------------------------------*/
28 #ifndef PSDK_CMDSET_POSITIONING_H
29 #define PSDK_CMDSET_POSITIONING_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /* Includes ------------------------------------------------------------------*/
36 #include <psdk_typedef.h>
37 #include <psdk_core.h>
38 
39 /** @addtogroup PSDK
40  * @{
41  */
42 
43 /** @addtogroup PSDK_Positioning
44  * @{
45  */
46 
47 /* Exported constants --------------------------------------------------------*/
48 
49 /** @defgroup P_Positioning_Exported_Constants Exported Constants
50  * @{
51  */
52 
53 /**
54  * @brief Max count of target points.
55  */
56 #define POSITIONING_TARGET_POINT_MAX_COUNT 5
57 
58 /**
59  * @}
60  */
61 
62 /* Exported macros -----------------------------------------------------------*/
63 /* Exported types ------------------------------------------------------------*/
64 /** @defgroup P_Positioning_Exported_Types Exported Types
65  * @{
66  */
67 
68 /** @defgroup P_Positioning_Command_Related Command Related
69  * @{
70  */
71 
72 /**
73  * @brief Positioning Command Set Command ID
74  */
75 typedef enum {
76  PSDK_POSITIONING_CMD_ID_GET_POS = 0x01, /*!< get position command */
78 
79 /**
80  * @}
81  */
82 
83 /** @defgroup P_Positioning_Related Positioning Related
84  * @{
85  */
86 
87 /**
88  * @brief RTK position solution property.
89  */
90 typedef enum {
91  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_NOT_AVAILABLE = 0, /*!< Position solution is not available. */
92  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_FIX_POSITION = 1, /*!< Position has been fixed by the FIX POSITION command. */
93  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_FIX_HEIGHT_AUTO = 2, /*!< Position has been fixed by the FIX HEIGHT/AUTO command. */
94  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_INSTANTANEOUS_DOPPLER_COMPUTE_VELOCITY = 8, /*!< Velocity computed using instantaneous Doppler. */
95  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_SINGLE_PNT_SOLUTION = 16, /*!< Single point position solution. */
97  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_SBAS_CORRECTION_CALCULATED = 18, /*!< Solution calculated using corrections from an SBAS. */
98  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_KALMAN_FILTER_WITHOUT_OBSERVATION_PROPAGATED = 19, /*!< Propagated by a Kalman filter without new observations. */
99  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_OMNISTAR_VBS_POSITION = 20, /*!< OmniSTAR VBS position (L1 sub-metre). */
100  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_FLOAT_L1_AMBIGUITY = 32, /*!< Floating L1 ambiguity solution. */
101  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_FLOAT_IONOSPHERIC_FREE_AMBIGUITY = 33, /*!< Floating ionospheric-free ambiguity solution. */
102  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_FLOAT_SOLUTION = 34, /*!< Float position solution. */
103  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_L1_AMBIGUITY_INT = 48, /*!< Integer L1 ambiguity solution. */
104  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_WIDE_LANE_AMBIGUITY_INT = 49, /*!< Integer wide-lane ambiguity solution. */
105  PSDK_POSITIONING_POSITION_SOLUTION_PROPERTY_NARROW_INT_SOLUTION = 50, /*!< Narrow fixed point position solution. */
107 
108 /**
109  * @}
110  */
111 
112 /** @addtogroup P_Positioning_Command_Related
113  * @{
114  */
115 
116 #pragma pack(1)
117 
118 /**
119  * @brief Time.
120  */
121 typedef struct {
122  uint16_t year; /*!< Specifies year. */
123  uint8_t month; /*!< Specifies month. */
124  uint8_t day; /*!< Specifies day. */
125  uint8_t hour; /*!< Specifies hour. */
126  uint8_t minute; /*!< Specifies minute. */
127  uint8_t second; /*!< Specifies second. */
129 
130 /**
131  * @brief Detail information of events what trigger position requesting.
132  */
133 typedef struct {
134  uint16_t eventId : 13; /*!< Specifies event index. */
135  uint16_t targetPointId : 3; /*!< Specifies index of target point of payload. */
136  uint32_t timeOffsetUs; /*!< Specifies time offset between base timestamp and time of event, unit: us, range from 0 to 2000000. */
138 
139 /**
140  * @brief Attitude.
141  */
142 typedef struct {
143  int16_t pitchAttiAngle; /*!< Specifies attitude angle in pitch axis, range from -180 to 180, unit: degree. */
144  int16_t rollAttiAngle; /*!< Specifies attitude angle in roll axis, range from -180 to 180, unit: degree. */
145  int16_t yawAttiAngle; /*!< Specifies attitude angle in yaw axis, range from -180 to 180, unit: degree. */
147 
148 /**
149  * @brief Position offset.
150  */
151 typedef struct {
152  int16_t northOffset; /*!< Specifies position offset in N direction of NED coordinate system, unit: mm. */
153  int16_t earthOffset; /*!< Specifies position offset in E direction of NED coordinate system, unit: mm. */
154  int16_t downOffset; /*!< Specifies position offset in D direction of NED coordinate system, unit: mm. */
156 
157 /**
158  * @brief Position information.
159  */
160 typedef struct {
161  psdk_f64_t longitude; /*!< Specifies longitude, unit: degree. */
162  psdk_f64_t latitude; /*!< Specifies latitude, unit: degree. */
163  psdk_f64_t height; /*!< Specifies height above sea level, unit: m. */
165 
166 /**
167  * @brief Position value standard deviation.
168  */
169 typedef struct {
170  psdk_f32_t longitudeStandardDeviation; /*!< Specifies longitude standard deviation. */
171  psdk_f32_t latitudeStandardDeviation; /*!< Specifies latitude standard deviation. */
172  psdk_f32_t heightStandardDeviation; /*!< Specifies height standard deviation. */
174 
175 /**
176  * @brief Detail position information.
177  */
178 typedef struct {
179  T_PsdkPositioningEventDetailInfo eventDetailInfo; /*!< Specifies detail information of events what trigger position requesting. */
180  uint8_t positionSolutionProperty; /*!< Specifies RTK positioning solution property, and this parameter can be any value of ::E_PsdkPositioningPositionSolutionProperty. */
181  T_PsdkPositioningAtti uavAtti; /*!< Specifies UAV attitude. */
182  T_PsdkPositioningPositionOffset mainAntennaTargetPointPosOffset; /*!< Specifies position offset from RTK main antenna to target points in NED coordinate system. */
183  T_PsdkPositioningPosition targetPointPos; /*!< Specifies position of target points. */
184  T_PsdkPositioningPositionStandardDeviation targetPointPosStandardDeviation; /*!< Specifies position standard deviation of target points. */
186 
187 /**
188  * @brief Get position command req data structure..
189  */
190 typedef struct {
191  uint8_t targetPointCount; /*!< Specifies target point count. */
192  uint8_t taskId; /*!< Specifies task index. */
193  T_PsdkPositioningTime baseTimestamp; /*!< Specifies base timestamp. */
194  T_PsdkPositioningEventDetailInfo eventDetailInfo[POSITIONING_TARGET_POINT_MAX_COUNT]; /*!< Specifies detail event information. */
196 
197 /**
198 * @brief Get position command ack data structure..
199  */
200 typedef struct {
201  uint8_t ackCode; /*!< Specifies PSDK command ack code. This parameter can be any value of ::E_PsdkCmdAckCode. */
202  uint8_t targetPointCount; /*!< Specifies target point count. */
203  uint8_t taskId; /*!< Specifies task index. */
204  T_PsdkPositioningTime baseTimestamp; /*!< Specifies base timestamp. */
205  T_PsdkPositioningPositionDetailInfo posDetailInfo[POSITIONING_TARGET_POINT_MAX_COUNT]; /*!< Specifies detail position information. */
207 
208 #pragma pack()
209 
210 /**
211  * @}
212  */
213 
214 /**
215  * @}
216  */
217 
218 /* Exported variables --------------------------------------------------------*/
219 /* Exported functions --------------------------------------------------------*/
220 /* Private constants ---------------------------------------------------------*/
221 /* Private macros ------------------------------------------------------------*/
222 /* Private types -------------------------------------------------------------*/
223 /* Private variables ---------------------------------------------------------*/
224 /* Private functions ---------------------------------------------------------*/
225 
226 /**
227  * @}
228  */
229 
230 /**
231  * @}
232  */
233 
234 #ifdef __cplusplus
235 }
236 #endif
237 
238 #endif //PSDK_CMDSET_POSITIONING_H
239 
240 /****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
psdk_f32_t latitudeStandardDeviation
Definition: psdk_cmdset_positioning.h:171
int16_t rollAttiAngle
Definition: psdk_cmdset_positioning.h:144
uint8_t targetPointCount
Definition: psdk_cmdset_positioning.h:191
uint32_t timeOffsetUs
Definition: psdk_cmdset_positioning.h:136
Position value standard deviation.
Definition: psdk_cmdset_positioning.h:169
uint8_t second
Definition: psdk_cmdset_positioning.h:127
T_PsdkPositioningPositionStandardDeviation targetPointPosStandardDeviation
Definition: psdk_cmdset_positioning.h:184
Position offset.
Definition: psdk_cmdset_positioning.h:151
uint16_t eventId
Definition: psdk_cmdset_positioning.h:134
T_PsdkPositioningTime baseTimestamp
Definition: psdk_cmdset_positioning.h:204
Get position command req data structure..
Definition: psdk_cmdset_positioning.h:190
uint8_t minute
Definition: psdk_cmdset_positioning.h:126
psdk_f32_t longitudeStandardDeviation
Definition: psdk_cmdset_positioning.h:170
uint8_t positionSolutionProperty
Definition: psdk_cmdset_positioning.h:180
Detail information of events what trigger position requesting.
Definition: psdk_cmdset_positioning.h:133
Detail position information.
Definition: psdk_cmdset_positioning.h:178
uint8_t day
Definition: psdk_cmdset_positioning.h:124
T_PsdkPositioningPosition targetPointPos
Definition: psdk_cmdset_positioning.h:183
uint8_t ackCode
Definition: psdk_cmdset_positioning.h:201
uint16_t year
Definition: psdk_cmdset_positioning.h:122
psdk_f32_t heightStandardDeviation
Definition: psdk_cmdset_positioning.h:172
Get position command ack data structure..
Definition: psdk_cmdset_positioning.h:200
Position information.
Definition: psdk_cmdset_positioning.h:160
Time.
Definition: psdk_cmdset_positioning.h:121
#define POSITIONING_TARGET_POINT_MAX_COUNT
Max count of target points.
Definition: psdk_cmdset_positioning.h:56
uint8_t taskId
Definition: psdk_cmdset_positioning.h:192
PSDK core include file.
psdk_f64_t longitude
Definition: psdk_cmdset_positioning.h:161
uint8_t targetPointCount
Definition: psdk_cmdset_positioning.h:202
int16_t earthOffset
Definition: psdk_cmdset_positioning.h:153
uint8_t taskId
Definition: psdk_cmdset_positioning.h:203
T_PsdkPositioningAtti uavAtti
Definition: psdk_cmdset_positioning.h:181
int16_t downOffset
Definition: psdk_cmdset_positioning.h:154
uint16_t targetPointId
Definition: psdk_cmdset_positioning.h:135
uint8_t month
Definition: psdk_cmdset_positioning.h:123
int16_t northOffset
Definition: psdk_cmdset_positioning.h:152
int16_t pitchAttiAngle
Definition: psdk_cmdset_positioning.h:143
uint8_t hour
Definition: psdk_cmdset_positioning.h:125
T_PsdkPositioningPositionOffset mainAntennaTargetPointPosOffset
Definition: psdk_cmdset_positioning.h:182
T_PsdkPositioningEventDetailInfo eventDetailInfo
Definition: psdk_cmdset_positioning.h:179
psdk_f64_t height
Definition: psdk_cmdset_positioning.h:163
T_PsdkPositioningTime baseTimestamp
Definition: psdk_cmdset_positioning.h:193
psdk_f64_t latitude
Definition: psdk_cmdset_positioning.h:162
Attitude.
Definition: psdk_cmdset_positioning.h:142
int16_t yawAttiAngle
Definition: psdk_cmdset_positioning.h:145