Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_global_position_int_cov.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE GLOBAL_POSITION_INT_COV PACKING
3
4#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63
5
6
8 uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 int32_t lat; /*< [degE7] Latitude*/
10 int32_t lon; /*< [degE7] Longitude*/
11 int32_t alt; /*< [mm] Altitude in meters above MSL*/
12 int32_t relative_alt; /*< [mm] Altitude above ground*/
13 float vx; /*< [m/s] Ground X Speed (Latitude)*/
14 float vy; /*< [m/s] Ground Y Speed (Longitude)*/
15 float vz; /*< [m/s] Ground Z Speed (Altitude)*/
16 float covariance[36]; /*< Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.*/
17 uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
18} mavlink_global_position_int_cov_t;
19
20#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN 181
21#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN 181
22#define MAVLINK_MSG_ID_63_LEN 181
23#define MAVLINK_MSG_ID_63_MIN_LEN 181
24
25#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC 119
26#define MAVLINK_MSG_ID_63_CRC 119
27
28#define MAVLINK_MSG_GLOBAL_POSITION_INT_COV_FIELD_COVARIANCE_LEN 36
29
30#if MAVLINK_COMMAND_24BIT
31#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV {
32 63,
33 "GLOBAL_POSITION_INT_COV",
34 10,
35 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) },
36 { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) },
37 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) },
38 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) },
39 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) },
40 { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) },
41 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) },
42 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) },
43 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) },
44 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) },
45 } \
46}
47#else
48#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV {
49 "GLOBAL_POSITION_INT_COV",
50 10,
51 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) },
52 { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) },
53 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) },
54 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) },
55 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) },
56 { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) },
57 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) },
58 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) },
59 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) },
60 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) },
61 } \
62}
63#endif
64
65/**
66 * @brief Pack a global_position_int_cov message
67 * @param system_id ID of this system
68 * @param component_id ID of this component (e.g. 200 for IMU)
69 * @param msg The MAVLink message to compress the data into
70 *
71 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
72 * @param estimator_type Class id of the estimator this estimate originated from.
73 * @param lat [degE7] Latitude
74 * @param lon [degE7] Longitude
75 * @param alt [mm] Altitude in meters above MSL
76 * @param relative_alt [mm] Altitude above ground
77 * @param vx [m/s] Ground X Speed (Latitude)
78 * @param vy [m/s] Ground Y Speed (Longitude)
79 * @param vz [m/s] Ground Z Speed (Altitude)
80 * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
81 * @return length of the message in bytes (excluding serial stream start sign)
82 */
83static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
84 uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
85{
86#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
88 _mav_put_uint64_t(buf, 0, time_usec);
89 _mav_put_int32_t(buf, 8, lat);
90 _mav_put_int32_t(buf, 12, lon);
91 _mav_put_int32_t(buf, 16, alt);
92 _mav_put_int32_t(buf, 20, relative_alt);
93 _mav_put_float(buf, 24, vx);
94 _mav_put_float(buf, 28, vy);
95 _mav_put_float(buf, 32, vz);
96 _mav_put_uint8_t(buf, 180, estimator_type);
97 _mav_put_float_array(buf, 36, covariance, 36);
98 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
99#else
100 mavlink_global_position_int_cov_t packet;
101 packet.time_usec = time_usec;
102 packet.lat = lat;
103 packet.lon = lon;
104 packet.alt = alt;
105 packet.relative_alt = relative_alt;
106 packet.vx = vx;
107 packet.vy = vy;
108 packet.vz = vz;
109 packet.estimator_type = estimator_type;
110 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
111 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
112#endif
113
116}
117
118/**
119 * @brief Pack a global_position_int_cov message
120 * @param system_id ID of this system
121 * @param component_id ID of this component (e.g. 200 for IMU)
122 * @param status MAVLink status structure
123 * @param msg The MAVLink message to compress the data into
124 *
125 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
126 * @param estimator_type Class id of the estimator this estimate originated from.
127 * @param lat [degE7] Latitude
128 * @param lon [degE7] Longitude
129 * @param alt [mm] Altitude in meters above MSL
130 * @param relative_alt [mm] Altitude above ground
131 * @param vx [m/s] Ground X Speed (Latitude)
132 * @param vy [m/s] Ground Y Speed (Longitude)
133 * @param vz [m/s] Ground Z Speed (Altitude)
134 * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
135 * @return length of the message in bytes (excluding serial stream start sign)
136 */
137static inline uint16_t mavlink_msg_global_position_int_cov_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
138 uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
139{
140#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
142 _mav_put_uint64_t(buf, 0, time_usec);
143 _mav_put_int32_t(buf, 8, lat);
144 _mav_put_int32_t(buf, 12, lon);
145 _mav_put_int32_t(buf, 16, alt);
146 _mav_put_int32_t(buf, 20, relative_alt);
147 _mav_put_float(buf, 24, vx);
148 _mav_put_float(buf, 28, vy);
149 _mav_put_float(buf, 32, vz);
150 _mav_put_uint8_t(buf, 180, estimator_type);
151 _mav_put_float_array(buf, 36, covariance, 36);
152 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
153#else
154 mavlink_global_position_int_cov_t packet;
155 packet.time_usec = time_usec;
156 packet.lat = lat;
157 packet.lon = lon;
158 packet.alt = alt;
159 packet.relative_alt = relative_alt;
160 packet.vx = vx;
161 packet.vy = vy;
162 packet.vz = vz;
163 packet.estimator_type = estimator_type;
164 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
165 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
166#endif
167
169#if MAVLINK_CRC_EXTRA
170 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
171#else
172 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
173#endif
174}
175
176/**
177 * @brief Pack a global_position_int_cov message on a channel
178 * @param system_id ID of this system
179 * @param component_id ID of this component (e.g. 200 for IMU)
180 * @param chan The MAVLink channel this message will be sent over
181 * @param msg The MAVLink message to compress the data into
182 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
183 * @param estimator_type Class id of the estimator this estimate originated from.
184 * @param lat [degE7] Latitude
185 * @param lon [degE7] Longitude
186 * @param alt [mm] Altitude in meters above MSL
187 * @param relative_alt [mm] Altitude above ground
188 * @param vx [m/s] Ground X Speed (Latitude)
189 * @param vy [m/s] Ground Y Speed (Longitude)
190 * @param vz [m/s] Ground Z Speed (Altitude)
191 * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
192 * @return length of the message in bytes (excluding serial stream start sign)
193 */
194static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
195 mavlink_message_t* msg,
196 uint64_t time_usec,uint8_t estimator_type,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,float vx,float vy,float vz,const float *covariance)
197{
198#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
200 _mav_put_uint64_t(buf, 0, time_usec);
201 _mav_put_int32_t(buf, 8, lat);
202 _mav_put_int32_t(buf, 12, lon);
203 _mav_put_int32_t(buf, 16, alt);
204 _mav_put_int32_t(buf, 20, relative_alt);
205 _mav_put_float(buf, 24, vx);
206 _mav_put_float(buf, 28, vy);
207 _mav_put_float(buf, 32, vz);
208 _mav_put_uint8_t(buf, 180, estimator_type);
209 _mav_put_float_array(buf, 36, covariance, 36);
210 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
211#else
212 mavlink_global_position_int_cov_t packet;
213 packet.time_usec = time_usec;
214 packet.lat = lat;
215 packet.lon = lon;
216 packet.alt = alt;
217 packet.relative_alt = relative_alt;
218 packet.vx = vx;
219 packet.vy = vy;
220 packet.vz = vz;
221 packet.estimator_type = estimator_type;
222 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
223 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
224#endif
225
228}
229
230/**
231 * @brief Encode a global_position_int_cov struct
232 *
233 * @param system_id ID of this system
234 * @param component_id ID of this component (e.g. 200 for IMU)
235 * @param msg The MAVLink message to compress the data into
236 * @param global_position_int_cov C-struct to read the message contents from
237 */
238static inline uint16_t mavlink_msg_global_position_int_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
239{
240 return mavlink_msg_global_position_int_cov_pack(system_id, component_id, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
241}
242
243/**
244 * @brief Encode a global_position_int_cov struct on a channel
245 *
246 * @param system_id ID of this system
247 * @param component_id ID of this component (e.g. 200 for IMU)
248 * @param chan The MAVLink channel this message will be sent over
249 * @param msg The MAVLink message to compress the data into
250 * @param global_position_int_cov C-struct to read the message contents from
251 */
252static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
253{
254 return mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, chan, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
255}
256
257/**
258 * @brief Encode a global_position_int_cov struct with provided status structure
259 *
260 * @param system_id ID of this system
261 * @param component_id ID of this component (e.g. 200 for IMU)
262 * @param status MAVLink status structure
263 * @param msg The MAVLink message to compress the data into
264 * @param global_position_int_cov C-struct to read the message contents from
265 */
266static inline uint16_t mavlink_msg_global_position_int_cov_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
267{
268 return mavlink_msg_global_position_int_cov_pack_status(system_id, component_id, _status, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
269}
270
271/**
272 * @brief Send a global_position_int_cov message
273 * @param chan MAVLink channel to send the message
274 *
275 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
276 * @param estimator_type Class id of the estimator this estimate originated from.
277 * @param lat [degE7] Latitude
278 * @param lon [degE7] Longitude
279 * @param alt [mm] Altitude in meters above MSL
280 * @param relative_alt [mm] Altitude above ground
281 * @param vx [m/s] Ground X Speed (Latitude)
282 * @param vy [m/s] Ground Y Speed (Longitude)
283 * @param vz [m/s] Ground Z Speed (Altitude)
284 * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
285 */
286#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
287
288static inline void mavlink_msg_global_position_int_cov_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
289{
290#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
291 char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
292 _mav_put_uint64_t(buf, 0, time_usec);
293 _mav_put_int32_t(buf, 8, lat);
294 _mav_put_int32_t(buf, 12, lon);
295 _mav_put_int32_t(buf, 16, alt);
296 _mav_put_int32_t(buf, 20, relative_alt);
297 _mav_put_float(buf, 24, vx);
298 _mav_put_float(buf, 28, vy);
299 _mav_put_float(buf, 32, vz);
300 _mav_put_uint8_t(buf, 180, estimator_type);
301 _mav_put_float_array(buf, 36, covariance, 36);
302 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
303#else
304 mavlink_global_position_int_cov_t packet;
305 packet.time_usec = time_usec;
306 packet.lat = lat;
307 packet.lon = lon;
308 packet.alt = alt;
309 packet.relative_alt = relative_alt;
310 packet.vx = vx;
311 packet.vy = vy;
312 packet.vz = vz;
313 packet.estimator_type = estimator_type;
314 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
315 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
316#endif
317}
318
319/**
320 * @brief Send a global_position_int_cov message
321 * @param chan MAVLink channel to send the message
322 * @param struct The MAVLink struct to serialize
323 */
324static inline void mavlink_msg_global_position_int_cov_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_cov_t* global_position_int_cov)
325{
326#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
327 mavlink_msg_global_position_int_cov_send(chan, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
328#else
329 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)global_position_int_cov, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
330#endif
331}
332
333#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
334/*
335 This variant of _send() can be used to save stack space by reusing
336 memory from the receive buffer. The caller provides a
337 mavlink_message_t which is the size of a full mavlink message. This
338 is usually the receive buffer for the channel, and allows a reply to an
339 incoming message with minimum stack space usage.
340 */
341static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
342{
343#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
344 char *buf = (char *)msgbuf;
345 _mav_put_uint64_t(buf, 0, time_usec);
346 _mav_put_int32_t(buf, 8, lat);
347 _mav_put_int32_t(buf, 12, lon);
348 _mav_put_int32_t(buf, 16, alt);
349 _mav_put_int32_t(buf, 20, relative_alt);
350 _mav_put_float(buf, 24, vx);
351 _mav_put_float(buf, 28, vy);
352 _mav_put_float(buf, 32, vz);
353 _mav_put_uint8_t(buf, 180, estimator_type);
354 _mav_put_float_array(buf, 36, covariance, 36);
355 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
356#else
357 mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf;
358 packet->time_usec = time_usec;
359 packet->lat = lat;
360 packet->lon = lon;
361 packet->alt = alt;
362 packet->relative_alt = relative_alt;
363 packet->vx = vx;
364 packet->vy = vy;
365 packet->vz = vz;
366 packet->estimator_type = estimator_type;
367 mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36);
368 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
369#endif
370}
371#endif
372
373#endif
374
375// MESSAGE GLOBAL_POSITION_INT_COV UNPACKING
376
377
378/**
379 * @brief Get field time_usec from global_position_int_cov message
380 *
381 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
382 */
383static inline uint64_t mavlink_msg_global_position_int_cov_get_time_usec(const mavlink_message_t* msg)
384{
385 return _MAV_RETURN_uint64_t(msg, 0);
386}
387
388/**
389 * @brief Get field estimator_type from global_position_int_cov message
390 *
391 * @return Class id of the estimator this estimate originated from.
392 */
393static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg)
394{
395 return _MAV_RETURN_uint8_t(msg, 180);
396}
397
398/**
399 * @brief Get field lat from global_position_int_cov message
400 *
401 * @return [degE7] Latitude
402 */
403static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg)
404{
405 return _MAV_RETURN_int32_t(msg, 8);
406}
407
408/**
409 * @brief Get field lon from global_position_int_cov message
410 *
411 * @return [degE7] Longitude
412 */
413static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg)
414{
415 return _MAV_RETURN_int32_t(msg, 12);
416}
417
418/**
419 * @brief Get field alt from global_position_int_cov message
420 *
421 * @return [mm] Altitude in meters above MSL
422 */
423static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg)
424{
425 return _MAV_RETURN_int32_t(msg, 16);
426}
427
428/**
429 * @brief Get field relative_alt from global_position_int_cov message
430 *
431 * @return [mm] Altitude above ground
432 */
433static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg)
434{
435 return _MAV_RETURN_int32_t(msg, 20);
436}
437
438/**
439 * @brief Get field vx from global_position_int_cov message
440 *
441 * @return [m/s] Ground X Speed (Latitude)
442 */
443static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg)
444{
445 return _MAV_RETURN_float(msg, 24);
446}
447
448/**
449 * @brief Get field vy from global_position_int_cov message
450 *
451 * @return [m/s] Ground Y Speed (Longitude)
452 */
453static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg)
454{
455 return _MAV_RETURN_float(msg, 28);
456}
457
458/**
459 * @brief Get field vz from global_position_int_cov message
460 *
461 * @return [m/s] Ground Z Speed (Altitude)
462 */
463static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg)
464{
465 return _MAV_RETURN_float(msg, 32);
466}
467
468/**
469 * @brief Get field covariance from global_position_int_cov message
470 *
471 * @return Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
472 */
473static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
474{
475 return _MAV_RETURN_float_array(msg, covariance, 36, 36);
476}
477
478/**
479 * @brief Decode a global_position_int_cov message into a struct
480 *
481 * @param msg The message to decode
482 * @param global_position_int_cov C-struct to decode the message contents into
483 */
484static inline void mavlink_msg_global_position_int_cov_decode(const mavlink_message_t* msg, mavlink_global_position_int_cov_t* global_position_int_cov)
485{
486#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
487 global_position_int_cov->time_usec = mavlink_msg_global_position_int_cov_get_time_usec(msg);
488 global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg);
489 global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg);
490 global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg);
491 global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg);
492 global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg);
493 global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg);
494 global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg);
495 mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance);
496 global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg);
497#else
498 uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN;
499 memset(global_position_int_cov, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
500 memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), len);
501#endif
502}