Merge pull request #10476 from radiolinkW/RADIOLINKF722
[inav.git] / lib / main / MAVLink / common / mavlink_msg_global_position_int_cov.h
blob3cb44be787c388b1ab4bdedc0be4e5577c5adadf
1 #pragma once
2 // MESSAGE GLOBAL_POSITION_INT_COV PACKING
4 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63
7 typedef struct __mavlink_global_position_int_cov_t {
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;
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 { "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 } \
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 } \
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 [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)
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 [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.
125 * @param estimator_type Class id of the estimator this estimate originated from.
126 * @param lat [degE7] Latitude
127 * @param lon [degE7] Longitude
128 * @param alt [mm] Altitude in meters above MSL
129 * @param relative_alt [mm] Altitude above ground
130 * @param vx [m/s] Ground X Speed (Latitude)
131 * @param vy [m/s] Ground Y Speed (Longitude)
132 * @param vz [m/s] Ground Z Speed (Altitude)
133 * @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.
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 [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.
204 * @param estimator_type Class id of the estimator this estimate originated from.
205 * @param lat [degE7] Latitude
206 * @param lon [degE7] Longitude
207 * @param alt [mm] Altitude in meters above MSL
208 * @param relative_alt [mm] Altitude above ground
209 * @param vx [m/s] Ground X Speed (Latitude)
210 * @param vy [m/s] Ground Y Speed (Longitude)
211 * @param vz [m/s] Ground Z Speed (Altitude)
212 * @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.
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 [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.
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 [degE7] Latitude
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 [degE7] Longitude
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 [mm] Altitude in meters 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 [mm] Altitude above ground
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 [m/s] Ground X Speed (Latitude)
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 [m/s] Ground Y Speed (Longitude)
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 [m/s] Ground Z Speed (Altitude)
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 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.
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