[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / MAVLink / common / mavlink_msg_global_position_int_cov.h
blob0d33faf58b572845dd902c058c9a22b2bc2d0ef7
1 #pragma once
2 // MESSAGE GLOBAL_POSITION_INT_COV PACKING
4 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63
6 MAVPACKED(
7 typedef struct __mavlink_global_position_int_cov_t {
8 uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/
9 int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
10 int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
11 int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), above MSL*/
12 int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/
13 float vx; /*< Ground X Speed (Latitude), expressed as m/s*/
14 float vy; /*< Ground Y Speed (Longitude), expressed as m/s*/
15 float vz; /*< Ground Z Speed (Altitude), expressed as m/s*/
16 float covariance[36]; /*< Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)*/
17 uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
18 }) mavlink_global_position_int_cov_t;
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
25 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC 119
26 #define MAVLINK_MSG_ID_63_CRC 119
28 #define MAVLINK_MSG_GLOBAL_POSITION_INT_COV_FIELD_COVARIANCE_LEN 36
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 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \
37 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \
38 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \
39 { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
40 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) }, \
41 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \
42 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \
43 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
44 { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
45 } \
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 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \
53 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \
54 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \
55 { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
56 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) }, \
57 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \
58 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \
59 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
60 { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
61 } \
63 #endif
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
71 * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
72 * @param estimator_type Class id of the estimator this estimate originated from.
73 * @param lat Latitude, expressed as degrees * 1E7
74 * @param lon Longitude, expressed as degrees * 1E7
75 * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
76 * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
77 * @param vx Ground X Speed (Latitude), expressed as m/s
78 * @param vy Ground Y Speed (Longitude), expressed as m/s
79 * @param vz Ground Z Speed (Altitude), expressed as m/s
80 * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
81 * @return length of the message in bytes (excluding serial stream start sign)
83 static 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)
86 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
87 char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
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
114 msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
115 return mavlink_finalize_message(msg, system_id, component_id, 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);
119 * @brief Pack a global_position_int_cov 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_usec Timestamp (microseconds since system boot or since UNIX epoch)
125 * @param estimator_type Class id of the estimator this estimate originated from.
126 * @param lat Latitude, expressed as degrees * 1E7
127 * @param lon Longitude, expressed as degrees * 1E7
128 * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
129 * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
130 * @param vx Ground X Speed (Latitude), expressed as m/s
131 * @param vy Ground Y Speed (Longitude), expressed as m/s
132 * @param vz Ground Z Speed (Altitude), expressed as m/s
133 * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
134 * @return length of the message in bytes (excluding serial stream start sign)
136 static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
137 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)
140 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
141 char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
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
168 msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
169 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 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);
173 * @brief Encode a global_position_int_cov struct
175 * @param system_id ID of this system
176 * @param component_id ID of this component (e.g. 200 for IMU)
177 * @param msg The MAVLink message to compress the data into
178 * @param global_position_int_cov C-struct to read the message contents from
180 static 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)
182 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);
186 * @brief Encode a global_position_int_cov struct on a channel
188 * @param system_id ID of this system
189 * @param component_id ID of this component (e.g. 200 for IMU)
190 * @param chan The MAVLink channel this message will be sent over
191 * @param msg The MAVLink message to compress the data into
192 * @param global_position_int_cov C-struct to read the message contents from
194 static 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)
196 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);
200 * @brief Send a global_position_int_cov message
201 * @param chan MAVLink channel to send the message
203 * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
204 * @param estimator_type Class id of the estimator this estimate originated from.
205 * @param lat Latitude, expressed as degrees * 1E7
206 * @param lon Longitude, expressed as degrees * 1E7
207 * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
208 * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
209 * @param vx Ground X Speed (Latitude), expressed as m/s
210 * @param vy Ground Y Speed (Longitude), expressed as m/s
211 * @param vz Ground Z Speed (Altitude), expressed as m/s
212 * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
214 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
216 static 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)
218 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
219 char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
220 _mav_put_uint64_t(buf, 0, time_usec);
221 _mav_put_int32_t(buf, 8, lat);
222 _mav_put_int32_t(buf, 12, lon);
223 _mav_put_int32_t(buf, 16, alt);
224 _mav_put_int32_t(buf, 20, relative_alt);
225 _mav_put_float(buf, 24, vx);
226 _mav_put_float(buf, 28, vy);
227 _mav_put_float(buf, 32, vz);
228 _mav_put_uint8_t(buf, 180, estimator_type);
229 _mav_put_float_array(buf, 36, covariance, 36);
230 _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);
231 #else
232 mavlink_global_position_int_cov_t packet;
233 packet.time_usec = time_usec;
234 packet.lat = lat;
235 packet.lon = lon;
236 packet.alt = alt;
237 packet.relative_alt = relative_alt;
238 packet.vx = vx;
239 packet.vy = vy;
240 packet.vz = vz;
241 packet.estimator_type = estimator_type;
242 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
243 _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);
244 #endif
248 * @brief Send a global_position_int_cov message
249 * @param chan MAVLink channel to send the message
250 * @param struct The MAVLink struct to serialize
252 static 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)
254 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
255 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);
256 #else
257 _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);
258 #endif
261 #if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
263 This varient of _send() can be used to save stack space by re-using
264 memory from the receive buffer. The caller provides a
265 mavlink_message_t which is the size of a full mavlink message. This
266 is usually the receive buffer for the channel, and allows a reply to an
267 incoming message with minimum stack space usage.
269 static 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)
271 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
272 char *buf = (char *)msgbuf;
273 _mav_put_uint64_t(buf, 0, time_usec);
274 _mav_put_int32_t(buf, 8, lat);
275 _mav_put_int32_t(buf, 12, lon);
276 _mav_put_int32_t(buf, 16, alt);
277 _mav_put_int32_t(buf, 20, relative_alt);
278 _mav_put_float(buf, 24, vx);
279 _mav_put_float(buf, 28, vy);
280 _mav_put_float(buf, 32, vz);
281 _mav_put_uint8_t(buf, 180, estimator_type);
282 _mav_put_float_array(buf, 36, covariance, 36);
283 _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);
284 #else
285 mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf;
286 packet->time_usec = time_usec;
287 packet->lat = lat;
288 packet->lon = lon;
289 packet->alt = alt;
290 packet->relative_alt = relative_alt;
291 packet->vx = vx;
292 packet->vy = vy;
293 packet->vz = vz;
294 packet->estimator_type = estimator_type;
295 mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36);
296 _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);
297 #endif
299 #endif
301 #endif
303 // MESSAGE GLOBAL_POSITION_INT_COV UNPACKING
307 * @brief Get field time_usec from global_position_int_cov message
309 * @return Timestamp (microseconds since system boot or since UNIX epoch)
311 static inline uint64_t mavlink_msg_global_position_int_cov_get_time_usec(const mavlink_message_t* msg)
313 return _MAV_RETURN_uint64_t(msg, 0);
317 * @brief Get field estimator_type from global_position_int_cov message
319 * @return Class id of the estimator this estimate originated from.
321 static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg)
323 return _MAV_RETURN_uint8_t(msg, 180);
327 * @brief Get field lat from global_position_int_cov message
329 * @return Latitude, expressed as degrees * 1E7
331 static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg)
333 return _MAV_RETURN_int32_t(msg, 8);
337 * @brief Get field lon from global_position_int_cov message
339 * @return Longitude, expressed as degrees * 1E7
341 static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg)
343 return _MAV_RETURN_int32_t(msg, 12);
347 * @brief Get field alt from global_position_int_cov message
349 * @return Altitude in meters, expressed as * 1000 (millimeters), above MSL
351 static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg)
353 return _MAV_RETURN_int32_t(msg, 16);
357 * @brief Get field relative_alt from global_position_int_cov message
359 * @return Altitude above ground in meters, expressed as * 1000 (millimeters)
361 static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg)
363 return _MAV_RETURN_int32_t(msg, 20);
367 * @brief Get field vx from global_position_int_cov message
369 * @return Ground X Speed (Latitude), expressed as m/s
371 static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg)
373 return _MAV_RETURN_float(msg, 24);
377 * @brief Get field vy from global_position_int_cov message
379 * @return Ground Y Speed (Longitude), expressed as m/s
381 static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg)
383 return _MAV_RETURN_float(msg, 28);
387 * @brief Get field vz from global_position_int_cov message
389 * @return Ground Z Speed (Altitude), expressed as m/s
391 static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg)
393 return _MAV_RETURN_float(msg, 32);
397 * @brief Get field covariance from global_position_int_cov message
399 * @return Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
401 static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
403 return _MAV_RETURN_float_array(msg, covariance, 36, 36);
407 * @brief Decode a global_position_int_cov message into a struct
409 * @param msg The message to decode
410 * @param global_position_int_cov C-struct to decode the message contents into
412 static inline void mavlink_msg_global_position_int_cov_decode(const mavlink_message_t* msg, mavlink_global_position_int_cov_t* global_position_int_cov)
414 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
415 global_position_int_cov->time_usec = mavlink_msg_global_position_int_cov_get_time_usec(msg);
416 global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg);
417 global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg);
418 global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg);
419 global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg);
420 global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg);
421 global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg);
422 global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg);
423 mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance);
424 global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg);
425 #else
426 uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN;
427 memset(global_position_int_cov, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
428 memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), len);
429 #endif