Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_local_position_ned_cov.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE LOCAL_POSITION_NED_COV PACKING
3
4#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64
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 float x; /*< [m] X Position*/
10 float y; /*< [m] Y Position*/
11 float z; /*< [m] Z Position*/
12 float vx; /*< [m/s] X Speed*/
13 float vy; /*< [m/s] Y Speed*/
14 float vz; /*< [m/s] Z Speed*/
15 float ax; /*< [m/s/s] X Acceleration*/
16 float ay; /*< [m/s/s] Y Acceleration*/
17 float az; /*< [m/s/s] Z Acceleration*/
18 float covariance[45]; /*< Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.*/
19 uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
20} mavlink_local_position_ned_cov_t;
21
22#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN 225
23#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN 225
24#define MAVLINK_MSG_ID_64_LEN 225
25#define MAVLINK_MSG_ID_64_MIN_LEN 225
26
27#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC 191
28#define MAVLINK_MSG_ID_64_CRC 191
29
30#define MAVLINK_MSG_LOCAL_POSITION_NED_COV_FIELD_COVARIANCE_LEN 45
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV {
34 64,
35 "LOCAL_POSITION_NED_COV",
36 12,
37 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_usec) },
38 { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) },
39 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_cov_t, x) },
40 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, y) },
41 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, z) },
42 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, vx) },
43 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vy) },
44 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vz) },
45 { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, ax) },
46 { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ay) },
47 { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, az) },
48 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 44, offsetof(mavlink_local_position_ned_cov_t, covariance) },
49 } \
50}
51#else
52#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV {
53 "LOCAL_POSITION_NED_COV",
54 12,
55 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_usec) },
56 { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) },
57 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_cov_t, x) },
58 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, y) },
59 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, z) },
60 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, vx) },
61 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vy) },
62 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vz) },
63 { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, ax) },
64 { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ay) },
65 { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, az) },
66 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 44, offsetof(mavlink_local_position_ned_cov_t, covariance) },
67 } \
68}
69#endif
70
71/**
72 * @brief Pack a local_position_ned_cov message
73 * @param system_id ID of this system
74 * @param component_id ID of this component (e.g. 200 for IMU)
75 * @param msg The MAVLink message to compress the data into
76 *
77 * @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.
78 * @param estimator_type Class id of the estimator this estimate originated from.
79 * @param x [m] X Position
80 * @param y [m] Y Position
81 * @param z [m] Z Position
82 * @param vx [m/s] X Speed
83 * @param vy [m/s] Y Speed
84 * @param vz [m/s] Z Speed
85 * @param ax [m/s/s] X Acceleration
86 * @param ay [m/s/s] Y Acceleration
87 * @param az [m/s/s] Z Acceleration
88 * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
89 * @return length of the message in bytes (excluding serial stream start sign)
90 */
91static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
93{
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
96 _mav_put_uint64_t(buf, 0, time_usec);
97 _mav_put_float(buf, 8, x);
98 _mav_put_float(buf, 12, y);
99 _mav_put_float(buf, 16, z);
100 _mav_put_float(buf, 20, vx);
101 _mav_put_float(buf, 24, vy);
102 _mav_put_float(buf, 28, vz);
103 _mav_put_float(buf, 32, ax);
104 _mav_put_float(buf, 36, ay);
105 _mav_put_float(buf, 40, az);
106 _mav_put_uint8_t(buf, 224, estimator_type);
107 _mav_put_float_array(buf, 44, covariance, 45);
108 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
109#else
110 mavlink_local_position_ned_cov_t packet;
111 packet.time_usec = time_usec;
112 packet.x = x;
113 packet.y = y;
114 packet.z = z;
115 packet.vx = vx;
116 packet.vy = vy;
117 packet.vz = vz;
118 packet.ax = ax;
119 packet.ay = ay;
120 packet.az = az;
121 packet.estimator_type = estimator_type;
122 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
124#endif
125
128}
129
130/**
131 * @brief Pack a local_position_ned_cov message
132 * @param system_id ID of this system
133 * @param component_id ID of this component (e.g. 200 for IMU)
134 * @param status MAVLink status structure
135 * @param msg The MAVLink message to compress the data into
136 *
137 * @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.
138 * @param estimator_type Class id of the estimator this estimate originated from.
139 * @param x [m] X Position
140 * @param y [m] Y Position
141 * @param z [m] Z Position
142 * @param vx [m/s] X Speed
143 * @param vy [m/s] Y Speed
144 * @param vz [m/s] Z Speed
145 * @param ax [m/s/s] X Acceleration
146 * @param ay [m/s/s] Y Acceleration
147 * @param az [m/s/s] Z Acceleration
148 * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
149 * @return length of the message in bytes (excluding serial stream start sign)
150 */
151static inline uint16_t mavlink_msg_local_position_ned_cov_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
152 uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
153{
154#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
156 _mav_put_uint64_t(buf, 0, time_usec);
157 _mav_put_float(buf, 8, x);
158 _mav_put_float(buf, 12, y);
159 _mav_put_float(buf, 16, z);
160 _mav_put_float(buf, 20, vx);
161 _mav_put_float(buf, 24, vy);
162 _mav_put_float(buf, 28, vz);
163 _mav_put_float(buf, 32, ax);
164 _mav_put_float(buf, 36, ay);
165 _mav_put_float(buf, 40, az);
166 _mav_put_uint8_t(buf, 224, estimator_type);
167 _mav_put_float_array(buf, 44, covariance, 45);
168 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
169#else
170 mavlink_local_position_ned_cov_t packet;
171 packet.time_usec = time_usec;
172 packet.x = x;
173 packet.y = y;
174 packet.z = z;
175 packet.vx = vx;
176 packet.vy = vy;
177 packet.vz = vz;
178 packet.ax = ax;
179 packet.ay = ay;
180 packet.az = az;
181 packet.estimator_type = estimator_type;
182 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
183 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
184#endif
185
187#if MAVLINK_CRC_EXTRA
188 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
189#else
190 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
191#endif
192}
193
194/**
195 * @brief Pack a local_position_ned_cov message on a channel
196 * @param system_id ID of this system
197 * @param component_id ID of this component (e.g. 200 for IMU)
198 * @param chan The MAVLink channel this message will be sent over
199 * @param msg The MAVLink message to compress the data into
200 * @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.
201 * @param estimator_type Class id of the estimator this estimate originated from.
202 * @param x [m] X Position
203 * @param y [m] Y Position
204 * @param z [m] Z Position
205 * @param vx [m/s] X Speed
206 * @param vy [m/s] Y Speed
207 * @param vz [m/s] Z Speed
208 * @param ax [m/s/s] X Acceleration
209 * @param ay [m/s/s] Y Acceleration
210 * @param az [m/s/s] Z Acceleration
211 * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
212 * @return length of the message in bytes (excluding serial stream start sign)
213 */
214static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
215 mavlink_message_t* msg,
216 uint64_t time_usec,uint8_t estimator_type,float x,float y,float z,float vx,float vy,float vz,float ax,float ay,float az,const float *covariance)
217{
218#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
220 _mav_put_uint64_t(buf, 0, time_usec);
221 _mav_put_float(buf, 8, x);
222 _mav_put_float(buf, 12, y);
223 _mav_put_float(buf, 16, z);
224 _mav_put_float(buf, 20, vx);
225 _mav_put_float(buf, 24, vy);
226 _mav_put_float(buf, 28, vz);
227 _mav_put_float(buf, 32, ax);
228 _mav_put_float(buf, 36, ay);
229 _mav_put_float(buf, 40, az);
230 _mav_put_uint8_t(buf, 224, estimator_type);
231 _mav_put_float_array(buf, 44, covariance, 45);
232 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
233#else
234 mavlink_local_position_ned_cov_t packet;
235 packet.time_usec = time_usec;
236 packet.x = x;
237 packet.y = y;
238 packet.z = z;
239 packet.vx = vx;
240 packet.vy = vy;
241 packet.vz = vz;
242 packet.ax = ax;
243 packet.ay = ay;
244 packet.az = az;
245 packet.estimator_type = estimator_type;
246 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
247 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
248#endif
249
252}
253
254/**
255 * @brief Encode a local_position_ned_cov struct
256 *
257 * @param system_id ID of this system
258 * @param component_id ID of this component (e.g. 200 for IMU)
259 * @param msg The MAVLink message to compress the data into
260 * @param local_position_ned_cov C-struct to read the message contents from
261 */
262static inline uint16_t mavlink_msg_local_position_ned_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
263{
264 return mavlink_msg_local_position_ned_cov_pack(system_id, component_id, msg, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
265}
266
267/**
268 * @brief Encode a local_position_ned_cov struct on a channel
269 *
270 * @param system_id ID of this system
271 * @param component_id ID of this component (e.g. 200 for IMU)
272 * @param chan The MAVLink channel this message will be sent over
273 * @param msg The MAVLink message to compress the data into
274 * @param local_position_ned_cov C-struct to read the message contents from
275 */
276static inline uint16_t mavlink_msg_local_position_ned_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
277{
278 return mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, chan, msg, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
279}
280
281/**
282 * @brief Encode a local_position_ned_cov struct with provided status structure
283 *
284 * @param system_id ID of this system
285 * @param component_id ID of this component (e.g. 200 for IMU)
286 * @param status MAVLink status structure
287 * @param msg The MAVLink message to compress the data into
288 * @param local_position_ned_cov C-struct to read the message contents from
289 */
290static inline uint16_t mavlink_msg_local_position_ned_cov_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
291{
292 return mavlink_msg_local_position_ned_cov_pack_status(system_id, component_id, _status, msg, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
293}
294
295/**
296 * @brief Send a local_position_ned_cov message
297 * @param chan MAVLink channel to send the message
298 *
299 * @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.
300 * @param estimator_type Class id of the estimator this estimate originated from.
301 * @param x [m] X Position
302 * @param y [m] Y Position
303 * @param z [m] Z Position
304 * @param vx [m/s] X Speed
305 * @param vy [m/s] Y Speed
306 * @param vz [m/s] Z Speed
307 * @param ax [m/s/s] X Acceleration
308 * @param ay [m/s/s] Y Acceleration
309 * @param az [m/s/s] Z Acceleration
310 * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
311 */
312#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
313
314static inline void mavlink_msg_local_position_ned_cov_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
315{
316#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
317 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
318 _mav_put_uint64_t(buf, 0, time_usec);
319 _mav_put_float(buf, 8, x);
320 _mav_put_float(buf, 12, y);
321 _mav_put_float(buf, 16, z);
322 _mav_put_float(buf, 20, vx);
323 _mav_put_float(buf, 24, vy);
324 _mav_put_float(buf, 28, vz);
325 _mav_put_float(buf, 32, ax);
326 _mav_put_float(buf, 36, ay);
327 _mav_put_float(buf, 40, az);
328 _mav_put_uint8_t(buf, 224, estimator_type);
329 _mav_put_float_array(buf, 44, covariance, 45);
330 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
331#else
332 mavlink_local_position_ned_cov_t packet;
333 packet.time_usec = time_usec;
334 packet.x = x;
335 packet.y = y;
336 packet.z = z;
337 packet.vx = vx;
338 packet.vy = vy;
339 packet.vz = vz;
340 packet.ax = ax;
341 packet.ay = ay;
342 packet.az = az;
343 packet.estimator_type = estimator_type;
344 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
345 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
346#endif
347}
348
349/**
350 * @brief Send a local_position_ned_cov message
351 * @param chan MAVLink channel to send the message
352 * @param struct The MAVLink struct to serialize
353 */
354static inline void mavlink_msg_local_position_ned_cov_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
355{
356#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
357 mavlink_msg_local_position_ned_cov_send(chan, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
358#else
359 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)local_position_ned_cov, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
360#endif
361}
362
363#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
364/*
365 This variant of _send() can be used to save stack space by reusing
366 memory from the receive buffer. The caller provides a
367 mavlink_message_t which is the size of a full mavlink message. This
368 is usually the receive buffer for the channel, and allows a reply to an
369 incoming message with minimum stack space usage.
370 */
371static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
372{
373#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
374 char *buf = (char *)msgbuf;
375 _mav_put_uint64_t(buf, 0, time_usec);
376 _mav_put_float(buf, 8, x);
377 _mav_put_float(buf, 12, y);
378 _mav_put_float(buf, 16, z);
379 _mav_put_float(buf, 20, vx);
380 _mav_put_float(buf, 24, vy);
381 _mav_put_float(buf, 28, vz);
382 _mav_put_float(buf, 32, ax);
383 _mav_put_float(buf, 36, ay);
384 _mav_put_float(buf, 40, az);
385 _mav_put_uint8_t(buf, 224, estimator_type);
386 _mav_put_float_array(buf, 44, covariance, 45);
387 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
388#else
389 mavlink_local_position_ned_cov_t *packet = (mavlink_local_position_ned_cov_t *)msgbuf;
390 packet->time_usec = time_usec;
391 packet->x = x;
392 packet->y = y;
393 packet->z = z;
394 packet->vx = vx;
395 packet->vy = vy;
396 packet->vz = vz;
397 packet->ax = ax;
398 packet->ay = ay;
399 packet->az = az;
400 packet->estimator_type = estimator_type;
401 mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45);
402 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
403#endif
404}
405#endif
406
407#endif
408
409// MESSAGE LOCAL_POSITION_NED_COV UNPACKING
410
411
412/**
413 * @brief Get field time_usec from local_position_ned_cov message
414 *
415 * @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.
416 */
417static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_usec(const mavlink_message_t* msg)
418{
419 return _MAV_RETURN_uint64_t(msg, 0);
420}
421
422/**
423 * @brief Get field estimator_type from local_position_ned_cov message
424 *
425 * @return Class id of the estimator this estimate originated from.
426 */
427static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_uint8_t(msg, 224);
430}
431
432/**
433 * @brief Get field x from local_position_ned_cov message
434 *
435 * @return [m] X Position
436 */
437static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_float(msg, 8);
440}
441
442/**
443 * @brief Get field y from local_position_ned_cov message
444 *
445 * @return [m] Y Position
446 */
447static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg)
448{
449 return _MAV_RETURN_float(msg, 12);
450}
451
452/**
453 * @brief Get field z from local_position_ned_cov message
454 *
455 * @return [m] Z Position
456 */
457static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg)
458{
459 return _MAV_RETURN_float(msg, 16);
460}
461
462/**
463 * @brief Get field vx from local_position_ned_cov message
464 *
465 * @return [m/s] X Speed
466 */
467static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg)
468{
469 return _MAV_RETURN_float(msg, 20);
470}
471
472/**
473 * @brief Get field vy from local_position_ned_cov message
474 *
475 * @return [m/s] Y Speed
476 */
477static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg)
478{
479 return _MAV_RETURN_float(msg, 24);
480}
481
482/**
483 * @brief Get field vz from local_position_ned_cov message
484 *
485 * @return [m/s] Z Speed
486 */
487static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg)
488{
489 return _MAV_RETURN_float(msg, 28);
490}
491
492/**
493 * @brief Get field ax from local_position_ned_cov message
494 *
495 * @return [m/s/s] X Acceleration
496 */
497static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg)
498{
499 return _MAV_RETURN_float(msg, 32);
500}
501
502/**
503 * @brief Get field ay from local_position_ned_cov message
504 *
505 * @return [m/s/s] Y Acceleration
506 */
507static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg)
508{
509 return _MAV_RETURN_float(msg, 36);
510}
511
512/**
513 * @brief Get field az from local_position_ned_cov message
514 *
515 * @return [m/s/s] Z Acceleration
516 */
517static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg)
518{
519 return _MAV_RETURN_float(msg, 40);
520}
521
522/**
523 * @brief Get field covariance from local_position_ned_cov message
524 *
525 * @return Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
526 */
527static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
528{
529 return _MAV_RETURN_float_array(msg, covariance, 45, 44);
530}
531
532/**
533 * @brief Decode a local_position_ned_cov message into a struct
534 *
535 * @param msg The message to decode
536 * @param local_position_ned_cov C-struct to decode the message contents into
537 */
538static inline void mavlink_msg_local_position_ned_cov_decode(const mavlink_message_t* msg, mavlink_local_position_ned_cov_t* local_position_ned_cov)
539{
540#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
541 local_position_ned_cov->time_usec = mavlink_msg_local_position_ned_cov_get_time_usec(msg);
542 local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg);
543 local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg);
544 local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg);
545 local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg);
546 local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg);
547 local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg);
548 local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg);
549 local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg);
550 local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg);
551 mavlink_msg_local_position_ned_cov_get_covariance(msg, local_position_ned_cov->covariance);
552 local_position_ned_cov->estimator_type = mavlink_msg_local_position_ned_cov_get_estimator_type(msg);
553#else
554 uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN;
555 memset(local_position_ned_cov, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
556 memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), len);
557#endif
558}