1 // MESSAGE GPS_RTK PACKING
3 #define MAVLINK_MSG_ID_GPS_RTK 127
5 typedef struct __mavlink_gps_rtk_t
7 uint32_t time_last_baseline_ms
; ///< Time since boot of last baseline message received in ms.
8 uint32_t tow
; ///< GPS Time of Week of last baseline
9 int32_t baseline_a_mm
; ///< Current baseline in ECEF x or NED north component in mm.
10 int32_t baseline_b_mm
; ///< Current baseline in ECEF y or NED east component in mm.
11 int32_t baseline_c_mm
; ///< Current baseline in ECEF z or NED down component in mm.
12 uint32_t accuracy
; ///< Current estimate of baseline accuracy.
13 int32_t iar_num_hypotheses
; ///< Current number of integer ambiguity hypotheses.
14 uint16_t wn
; ///< GPS Week Number of last baseline
15 uint8_t rtk_receiver_id
; ///< Identification of connected RTK receiver.
16 uint8_t rtk_health
; ///< GPS-specific health report for RTK data.
17 uint8_t rtk_rate
; ///< Rate of baseline messages being received by GPS, in HZ
18 uint8_t nsats
; ///< Current number of sats used for RTK calculation.
19 uint8_t baseline_coords_type
; ///< Coordinate system of baseline. 0 == ECEF, 1 == NED
22 #define MAVLINK_MSG_ID_GPS_RTK_LEN 35
23 #define MAVLINK_MSG_ID_127_LEN 35
25 #define MAVLINK_MSG_ID_GPS_RTK_CRC 25
26 #define MAVLINK_MSG_ID_127_CRC 25
30 #define MAVLINK_MESSAGE_INFO_GPS_RTK { \
33 { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
34 { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
35 { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
36 { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
37 { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
38 { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
39 { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
40 { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
41 { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
42 { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
43 { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
44 { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
45 { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
51 * @brief Pack a gps_rtk message
52 * @param system_id ID of this system
53 * @param component_id ID of this component (e.g. 200 for IMU)
54 * @param msg The MAVLink message to compress the data into
56 * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
57 * @param rtk_receiver_id Identification of connected RTK receiver.
58 * @param wn GPS Week Number of last baseline
59 * @param tow GPS Time of Week of last baseline
60 * @param rtk_health GPS-specific health report for RTK data.
61 * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
62 * @param nsats Current number of sats used for RTK calculation.
63 * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
64 * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
65 * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
66 * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
67 * @param accuracy Current estimate of baseline accuracy.
68 * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
69 * @return length of the message in bytes (excluding serial stream start sign)
71 static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
72 uint32_t time_last_baseline_ms
, uint8_t rtk_receiver_id
, uint16_t wn
, uint32_t tow
, uint8_t rtk_health
, uint8_t rtk_rate
, uint8_t nsats
, uint8_t baseline_coords_type
, int32_t baseline_a_mm
, int32_t baseline_b_mm
, int32_t baseline_c_mm
, uint32_t accuracy
, int32_t iar_num_hypotheses
)
74 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
75 char buf
[MAVLINK_MSG_ID_GPS_RTK_LEN
];
76 _mav_put_uint32_t(buf
, 0, time_last_baseline_ms
);
77 _mav_put_uint32_t(buf
, 4, tow
);
78 _mav_put_int32_t(buf
, 8, baseline_a_mm
);
79 _mav_put_int32_t(buf
, 12, baseline_b_mm
);
80 _mav_put_int32_t(buf
, 16, baseline_c_mm
);
81 _mav_put_uint32_t(buf
, 20, accuracy
);
82 _mav_put_int32_t(buf
, 24, iar_num_hypotheses
);
83 _mav_put_uint16_t(buf
, 28, wn
);
84 _mav_put_uint8_t(buf
, 30, rtk_receiver_id
);
85 _mav_put_uint8_t(buf
, 31, rtk_health
);
86 _mav_put_uint8_t(buf
, 32, rtk_rate
);
87 _mav_put_uint8_t(buf
, 33, nsats
);
88 _mav_put_uint8_t(buf
, 34, baseline_coords_type
);
90 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
92 mavlink_gps_rtk_t packet
;
93 packet
.time_last_baseline_ms
= time_last_baseline_ms
;
95 packet
.baseline_a_mm
= baseline_a_mm
;
96 packet
.baseline_b_mm
= baseline_b_mm
;
97 packet
.baseline_c_mm
= baseline_c_mm
;
98 packet
.accuracy
= accuracy
;
99 packet
.iar_num_hypotheses
= iar_num_hypotheses
;
101 packet
.rtk_receiver_id
= rtk_receiver_id
;
102 packet
.rtk_health
= rtk_health
;
103 packet
.rtk_rate
= rtk_rate
;
104 packet
.nsats
= nsats
;
105 packet
.baseline_coords_type
= baseline_coords_type
;
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
110 msg
->msgid
= MAVLINK_MSG_ID_GPS_RTK
;
111 #if MAVLINK_CRC_EXTRA
112 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_GPS_RTK_LEN
, MAVLINK_MSG_ID_GPS_RTK_CRC
);
114 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
119 * @brief Pack a gps_rtk message on a channel
120 * @param system_id ID of this system
121 * @param component_id ID of this component (e.g. 200 for IMU)
122 * @param chan The MAVLink channel this message will be sent over
123 * @param msg The MAVLink message to compress the data into
124 * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
125 * @param rtk_receiver_id Identification of connected RTK receiver.
126 * @param wn GPS Week Number of last baseline
127 * @param tow GPS Time of Week of last baseline
128 * @param rtk_health GPS-specific health report for RTK data.
129 * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
130 * @param nsats Current number of sats used for RTK calculation.
131 * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
132 * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
133 * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
134 * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
135 * @param accuracy Current estimate of baseline accuracy.
136 * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
137 * @return length of the message in bytes (excluding serial stream start sign)
139 static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
140 mavlink_message_t
* msg
,
141 uint32_t time_last_baseline_ms
,uint8_t rtk_receiver_id
,uint16_t wn
,uint32_t tow
,uint8_t rtk_health
,uint8_t rtk_rate
,uint8_t nsats
,uint8_t baseline_coords_type
,int32_t baseline_a_mm
,int32_t baseline_b_mm
,int32_t baseline_c_mm
,uint32_t accuracy
,int32_t iar_num_hypotheses
)
143 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
144 char buf
[MAVLINK_MSG_ID_GPS_RTK_LEN
];
145 _mav_put_uint32_t(buf
, 0, time_last_baseline_ms
);
146 _mav_put_uint32_t(buf
, 4, tow
);
147 _mav_put_int32_t(buf
, 8, baseline_a_mm
);
148 _mav_put_int32_t(buf
, 12, baseline_b_mm
);
149 _mav_put_int32_t(buf
, 16, baseline_c_mm
);
150 _mav_put_uint32_t(buf
, 20, accuracy
);
151 _mav_put_int32_t(buf
, 24, iar_num_hypotheses
);
152 _mav_put_uint16_t(buf
, 28, wn
);
153 _mav_put_uint8_t(buf
, 30, rtk_receiver_id
);
154 _mav_put_uint8_t(buf
, 31, rtk_health
);
155 _mav_put_uint8_t(buf
, 32, rtk_rate
);
156 _mav_put_uint8_t(buf
, 33, nsats
);
157 _mav_put_uint8_t(buf
, 34, baseline_coords_type
);
159 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
161 mavlink_gps_rtk_t packet
;
162 packet
.time_last_baseline_ms
= time_last_baseline_ms
;
164 packet
.baseline_a_mm
= baseline_a_mm
;
165 packet
.baseline_b_mm
= baseline_b_mm
;
166 packet
.baseline_c_mm
= baseline_c_mm
;
167 packet
.accuracy
= accuracy
;
168 packet
.iar_num_hypotheses
= iar_num_hypotheses
;
170 packet
.rtk_receiver_id
= rtk_receiver_id
;
171 packet
.rtk_health
= rtk_health
;
172 packet
.rtk_rate
= rtk_rate
;
173 packet
.nsats
= nsats
;
174 packet
.baseline_coords_type
= baseline_coords_type
;
176 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
179 msg
->msgid
= MAVLINK_MSG_ID_GPS_RTK
;
180 #if MAVLINK_CRC_EXTRA
181 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_GPS_RTK_LEN
, MAVLINK_MSG_ID_GPS_RTK_CRC
);
183 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
188 * @brief Encode a gps_rtk struct
190 * @param system_id ID of this system
191 * @param component_id ID of this component (e.g. 200 for IMU)
192 * @param msg The MAVLink message to compress the data into
193 * @param gps_rtk C-struct to read the message contents from
195 static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_gps_rtk_t
* gps_rtk
)
197 return mavlink_msg_gps_rtk_pack(system_id
, component_id
, msg
, gps_rtk
->time_last_baseline_ms
, gps_rtk
->rtk_receiver_id
, gps_rtk
->wn
, gps_rtk
->tow
, gps_rtk
->rtk_health
, gps_rtk
->rtk_rate
, gps_rtk
->nsats
, gps_rtk
->baseline_coords_type
, gps_rtk
->baseline_a_mm
, gps_rtk
->baseline_b_mm
, gps_rtk
->baseline_c_mm
, gps_rtk
->accuracy
, gps_rtk
->iar_num_hypotheses
);
201 * @brief Encode a gps_rtk struct on a channel
203 * @param system_id ID of this system
204 * @param component_id ID of this component (e.g. 200 for IMU)
205 * @param chan The MAVLink channel this message will be sent over
206 * @param msg The MAVLink message to compress the data into
207 * @param gps_rtk C-struct to read the message contents from
209 static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_gps_rtk_t
* gps_rtk
)
211 return mavlink_msg_gps_rtk_pack_chan(system_id
, component_id
, chan
, msg
, gps_rtk
->time_last_baseline_ms
, gps_rtk
->rtk_receiver_id
, gps_rtk
->wn
, gps_rtk
->tow
, gps_rtk
->rtk_health
, gps_rtk
->rtk_rate
, gps_rtk
->nsats
, gps_rtk
->baseline_coords_type
, gps_rtk
->baseline_a_mm
, gps_rtk
->baseline_b_mm
, gps_rtk
->baseline_c_mm
, gps_rtk
->accuracy
, gps_rtk
->iar_num_hypotheses
);
215 * @brief Send a gps_rtk message
216 * @param chan MAVLink channel to send the message
218 * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
219 * @param rtk_receiver_id Identification of connected RTK receiver.
220 * @param wn GPS Week Number of last baseline
221 * @param tow GPS Time of Week of last baseline
222 * @param rtk_health GPS-specific health report for RTK data.
223 * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
224 * @param nsats Current number of sats used for RTK calculation.
225 * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
226 * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
227 * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
228 * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
229 * @param accuracy Current estimate of baseline accuracy.
230 * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
232 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
234 static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan
, uint32_t time_last_baseline_ms
, uint8_t rtk_receiver_id
, uint16_t wn
, uint32_t tow
, uint8_t rtk_health
, uint8_t rtk_rate
, uint8_t nsats
, uint8_t baseline_coords_type
, int32_t baseline_a_mm
, int32_t baseline_b_mm
, int32_t baseline_c_mm
, uint32_t accuracy
, int32_t iar_num_hypotheses
)
236 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
237 char buf
[MAVLINK_MSG_ID_GPS_RTK_LEN
];
238 _mav_put_uint32_t(buf
, 0, time_last_baseline_ms
);
239 _mav_put_uint32_t(buf
, 4, tow
);
240 _mav_put_int32_t(buf
, 8, baseline_a_mm
);
241 _mav_put_int32_t(buf
, 12, baseline_b_mm
);
242 _mav_put_int32_t(buf
, 16, baseline_c_mm
);
243 _mav_put_uint32_t(buf
, 20, accuracy
);
244 _mav_put_int32_t(buf
, 24, iar_num_hypotheses
);
245 _mav_put_uint16_t(buf
, 28, wn
);
246 _mav_put_uint8_t(buf
, 30, rtk_receiver_id
);
247 _mav_put_uint8_t(buf
, 31, rtk_health
);
248 _mav_put_uint8_t(buf
, 32, rtk_rate
);
249 _mav_put_uint8_t(buf
, 33, nsats
);
250 _mav_put_uint8_t(buf
, 34, baseline_coords_type
);
252 #if MAVLINK_CRC_EXTRA
253 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, buf
, MAVLINK_MSG_ID_GPS_RTK_LEN
, MAVLINK_MSG_ID_GPS_RTK_CRC
);
255 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, buf
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
258 mavlink_gps_rtk_t packet
;
259 packet
.time_last_baseline_ms
= time_last_baseline_ms
;
261 packet
.baseline_a_mm
= baseline_a_mm
;
262 packet
.baseline_b_mm
= baseline_b_mm
;
263 packet
.baseline_c_mm
= baseline_c_mm
;
264 packet
.accuracy
= accuracy
;
265 packet
.iar_num_hypotheses
= iar_num_hypotheses
;
267 packet
.rtk_receiver_id
= rtk_receiver_id
;
268 packet
.rtk_health
= rtk_health
;
269 packet
.rtk_rate
= rtk_rate
;
270 packet
.nsats
= nsats
;
271 packet
.baseline_coords_type
= baseline_coords_type
;
273 #if MAVLINK_CRC_EXTRA
274 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, (const char *)&packet
, MAVLINK_MSG_ID_GPS_RTK_LEN
, MAVLINK_MSG_ID_GPS_RTK_CRC
);
276 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, (const char *)&packet
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
281 #if MAVLINK_MSG_ID_GPS_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
283 This varient of _send() can be used to save stack space by re-using
284 memory from the receive buffer. The caller provides a
285 mavlink_message_t which is the size of a full mavlink message. This
286 is usually the receive buffer for the channel, and allows a reply to an
287 incoming message with minimum stack space usage.
289 static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint32_t time_last_baseline_ms
, uint8_t rtk_receiver_id
, uint16_t wn
, uint32_t tow
, uint8_t rtk_health
, uint8_t rtk_rate
, uint8_t nsats
, uint8_t baseline_coords_type
, int32_t baseline_a_mm
, int32_t baseline_b_mm
, int32_t baseline_c_mm
, uint32_t accuracy
, int32_t iar_num_hypotheses
)
291 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
292 char *buf
= (char *)msgbuf
;
293 _mav_put_uint32_t(buf
, 0, time_last_baseline_ms
);
294 _mav_put_uint32_t(buf
, 4, tow
);
295 _mav_put_int32_t(buf
, 8, baseline_a_mm
);
296 _mav_put_int32_t(buf
, 12, baseline_b_mm
);
297 _mav_put_int32_t(buf
, 16, baseline_c_mm
);
298 _mav_put_uint32_t(buf
, 20, accuracy
);
299 _mav_put_int32_t(buf
, 24, iar_num_hypotheses
);
300 _mav_put_uint16_t(buf
, 28, wn
);
301 _mav_put_uint8_t(buf
, 30, rtk_receiver_id
);
302 _mav_put_uint8_t(buf
, 31, rtk_health
);
303 _mav_put_uint8_t(buf
, 32, rtk_rate
);
304 _mav_put_uint8_t(buf
, 33, nsats
);
305 _mav_put_uint8_t(buf
, 34, baseline_coords_type
);
307 #if MAVLINK_CRC_EXTRA
308 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, buf
, MAVLINK_MSG_ID_GPS_RTK_LEN
, MAVLINK_MSG_ID_GPS_RTK_CRC
);
310 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, buf
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
313 mavlink_gps_rtk_t
*packet
= (mavlink_gps_rtk_t
*)msgbuf
;
314 packet
->time_last_baseline_ms
= time_last_baseline_ms
;
316 packet
->baseline_a_mm
= baseline_a_mm
;
317 packet
->baseline_b_mm
= baseline_b_mm
;
318 packet
->baseline_c_mm
= baseline_c_mm
;
319 packet
->accuracy
= accuracy
;
320 packet
->iar_num_hypotheses
= iar_num_hypotheses
;
322 packet
->rtk_receiver_id
= rtk_receiver_id
;
323 packet
->rtk_health
= rtk_health
;
324 packet
->rtk_rate
= rtk_rate
;
325 packet
->nsats
= nsats
;
326 packet
->baseline_coords_type
= baseline_coords_type
;
328 #if MAVLINK_CRC_EXTRA
329 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, (const char *)packet
, MAVLINK_MSG_ID_GPS_RTK_LEN
, MAVLINK_MSG_ID_GPS_RTK_CRC
);
331 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_GPS_RTK
, (const char *)packet
, MAVLINK_MSG_ID_GPS_RTK_LEN
);
339 // MESSAGE GPS_RTK UNPACKING
343 * @brief Get field time_last_baseline_ms from gps_rtk message
345 * @return Time since boot of last baseline message received in ms.
347 static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t
* msg
)
349 return _MAV_RETURN_uint32_t(msg
, 0);
353 * @brief Get field rtk_receiver_id from gps_rtk message
355 * @return Identification of connected RTK receiver.
357 static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t
* msg
)
359 return _MAV_RETURN_uint8_t(msg
, 30);
363 * @brief Get field wn from gps_rtk message
365 * @return GPS Week Number of last baseline
367 static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t
* msg
)
369 return _MAV_RETURN_uint16_t(msg
, 28);
373 * @brief Get field tow from gps_rtk message
375 * @return GPS Time of Week of last baseline
377 static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t
* msg
)
379 return _MAV_RETURN_uint32_t(msg
, 4);
383 * @brief Get field rtk_health from gps_rtk message
385 * @return GPS-specific health report for RTK data.
387 static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t
* msg
)
389 return _MAV_RETURN_uint8_t(msg
, 31);
393 * @brief Get field rtk_rate from gps_rtk message
395 * @return Rate of baseline messages being received by GPS, in HZ
397 static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t
* msg
)
399 return _MAV_RETURN_uint8_t(msg
, 32);
403 * @brief Get field nsats from gps_rtk message
405 * @return Current number of sats used for RTK calculation.
407 static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t
* msg
)
409 return _MAV_RETURN_uint8_t(msg
, 33);
413 * @brief Get field baseline_coords_type from gps_rtk message
415 * @return Coordinate system of baseline. 0 == ECEF, 1 == NED
417 static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t
* msg
)
419 return _MAV_RETURN_uint8_t(msg
, 34);
423 * @brief Get field baseline_a_mm from gps_rtk message
425 * @return Current baseline in ECEF x or NED north component in mm.
427 static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t
* msg
)
429 return _MAV_RETURN_int32_t(msg
, 8);
433 * @brief Get field baseline_b_mm from gps_rtk message
435 * @return Current baseline in ECEF y or NED east component in mm.
437 static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t
* msg
)
439 return _MAV_RETURN_int32_t(msg
, 12);
443 * @brief Get field baseline_c_mm from gps_rtk message
445 * @return Current baseline in ECEF z or NED down component in mm.
447 static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t
* msg
)
449 return _MAV_RETURN_int32_t(msg
, 16);
453 * @brief Get field accuracy from gps_rtk message
455 * @return Current estimate of baseline accuracy.
457 static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t
* msg
)
459 return _MAV_RETURN_uint32_t(msg
, 20);
463 * @brief Get field iar_num_hypotheses from gps_rtk message
465 * @return Current number of integer ambiguity hypotheses.
467 static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t
* msg
)
469 return _MAV_RETURN_int32_t(msg
, 24);
473 * @brief Decode a gps_rtk message into a struct
475 * @param msg The message to decode
476 * @param gps_rtk C-struct to decode the message contents into
478 static inline void mavlink_msg_gps_rtk_decode(const mavlink_message_t
* msg
, mavlink_gps_rtk_t
* gps_rtk
)
480 #if MAVLINK_NEED_BYTE_SWAP
481 gps_rtk
->time_last_baseline_ms
= mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg
);
482 gps_rtk
->tow
= mavlink_msg_gps_rtk_get_tow(msg
);
483 gps_rtk
->baseline_a_mm
= mavlink_msg_gps_rtk_get_baseline_a_mm(msg
);
484 gps_rtk
->baseline_b_mm
= mavlink_msg_gps_rtk_get_baseline_b_mm(msg
);
485 gps_rtk
->baseline_c_mm
= mavlink_msg_gps_rtk_get_baseline_c_mm(msg
);
486 gps_rtk
->accuracy
= mavlink_msg_gps_rtk_get_accuracy(msg
);
487 gps_rtk
->iar_num_hypotheses
= mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg
);
488 gps_rtk
->wn
= mavlink_msg_gps_rtk_get_wn(msg
);
489 gps_rtk
->rtk_receiver_id
= mavlink_msg_gps_rtk_get_rtk_receiver_id(msg
);
490 gps_rtk
->rtk_health
= mavlink_msg_gps_rtk_get_rtk_health(msg
);
491 gps_rtk
->rtk_rate
= mavlink_msg_gps_rtk_get_rtk_rate(msg
);
492 gps_rtk
->nsats
= mavlink_msg_gps_rtk_get_nsats(msg
);
493 gps_rtk
->baseline_coords_type
= mavlink_msg_gps_rtk_get_baseline_coords_type(msg
);
495 memcpy(gps_rtk
, _MAV_PAYLOAD(msg
), MAVLINK_MSG_ID_GPS_RTK_LEN
);