Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_estimator_status.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE ESTIMATOR_STATUS PACKING
3
4#define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230
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 vel_ratio; /*< Velocity innovation test ratio*/
10 float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/
11 float pos_vert_ratio; /*< Vertical position innovation test ratio*/
12 float mag_ratio; /*< Magnetometer innovation test ratio*/
13 float hagl_ratio; /*< Height above terrain innovation test ratio*/
14 float tas_ratio; /*< True airspeed innovation test ratio*/
15 float pos_horiz_accuracy; /*< [m] Horizontal position 1-STD accuracy relative to the EKF local origin*/
16 float pos_vert_accuracy; /*< [m] Vertical position 1-STD accuracy relative to the EKF local origin*/
17 uint16_t flags; /*< Bitmap indicating which EKF outputs are valid.*/
18} mavlink_estimator_status_t;
19
20#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42
21#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42
22#define MAVLINK_MSG_ID_230_LEN 42
23#define MAVLINK_MSG_ID_230_MIN_LEN 42
24
25#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163
26#define MAVLINK_MSG_ID_230_CRC 163
27
28
29
30#if MAVLINK_COMMAND_24BIT
31#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS {
32 230,
33 "ESTIMATOR_STATUS",
34 10,
35 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) },
36 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) },
37 { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) },
38 { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) },
39 { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) },
40 { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) },
41 { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) },
42 { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) },
43 { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) },
44 { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) },
45 } \
46}
47#else
48#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS {
49 "ESTIMATOR_STATUS",
50 10,
51 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) },
52 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) },
53 { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) },
54 { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) },
55 { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) },
56 { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) },
57 { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) },
58 { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) },
59 { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) },
60 { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) },
61 } \
62}
63#endif
64
65/**
66 * @brief Pack a estimator_status 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 flags Bitmap indicating which EKF outputs are valid.
73 * @param vel_ratio Velocity innovation test ratio
74 * @param pos_horiz_ratio Horizontal position innovation test ratio
75 * @param pos_vert_ratio Vertical position innovation test ratio
76 * @param mag_ratio Magnetometer innovation test ratio
77 * @param hagl_ratio Height above terrain innovation test ratio
78 * @param tas_ratio True airspeed innovation test ratio
79 * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
80 * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
81 * @return length of the message in bytes (excluding serial stream start sign)
82 */
83static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
84 uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
85{
86#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
88 _mav_put_uint64_t(buf, 0, time_usec);
89 _mav_put_float(buf, 8, vel_ratio);
90 _mav_put_float(buf, 12, pos_horiz_ratio);
91 _mav_put_float(buf, 16, pos_vert_ratio);
92 _mav_put_float(buf, 20, mag_ratio);
93 _mav_put_float(buf, 24, hagl_ratio);
94 _mav_put_float(buf, 28, tas_ratio);
95 _mav_put_float(buf, 32, pos_horiz_accuracy);
96 _mav_put_float(buf, 36, pos_vert_accuracy);
97 _mav_put_uint16_t(buf, 40, flags);
98
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
100#else
101 mavlink_estimator_status_t packet;
102 packet.time_usec = time_usec;
103 packet.vel_ratio = vel_ratio;
104 packet.pos_horiz_ratio = pos_horiz_ratio;
105 packet.pos_vert_ratio = pos_vert_ratio;
106 packet.mag_ratio = mag_ratio;
107 packet.hagl_ratio = hagl_ratio;
108 packet.tas_ratio = tas_ratio;
109 packet.pos_horiz_accuracy = pos_horiz_accuracy;
110 packet.pos_vert_accuracy = pos_vert_accuracy;
111 packet.flags = flags;
112
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
114#endif
115
117 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
118}
119
120/**
121 * @brief Pack a estimator_status message
122 * @param system_id ID of this system
123 * @param component_id ID of this component (e.g. 200 for IMU)
124 * @param status MAVLink status structure
125 * @param msg The MAVLink message to compress the data into
126 *
127 * @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.
128 * @param flags Bitmap indicating which EKF outputs are valid.
129 * @param vel_ratio Velocity innovation test ratio
130 * @param pos_horiz_ratio Horizontal position innovation test ratio
131 * @param pos_vert_ratio Vertical position innovation test ratio
132 * @param mag_ratio Magnetometer innovation test ratio
133 * @param hagl_ratio Height above terrain innovation test ratio
134 * @param tas_ratio True airspeed innovation test ratio
135 * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
136 * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
137 * @return length of the message in bytes (excluding serial stream start sign)
138 */
139static inline uint16_t mavlink_msg_estimator_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
140 uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
141{
142#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
144 _mav_put_uint64_t(buf, 0, time_usec);
145 _mav_put_float(buf, 8, vel_ratio);
146 _mav_put_float(buf, 12, pos_horiz_ratio);
147 _mav_put_float(buf, 16, pos_vert_ratio);
148 _mav_put_float(buf, 20, mag_ratio);
149 _mav_put_float(buf, 24, hagl_ratio);
150 _mav_put_float(buf, 28, tas_ratio);
151 _mav_put_float(buf, 32, pos_horiz_accuracy);
152 _mav_put_float(buf, 36, pos_vert_accuracy);
153 _mav_put_uint16_t(buf, 40, flags);
154
155 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
156#else
157 mavlink_estimator_status_t packet;
158 packet.time_usec = time_usec;
159 packet.vel_ratio = vel_ratio;
160 packet.pos_horiz_ratio = pos_horiz_ratio;
161 packet.pos_vert_ratio = pos_vert_ratio;
162 packet.mag_ratio = mag_ratio;
163 packet.hagl_ratio = hagl_ratio;
164 packet.tas_ratio = tas_ratio;
165 packet.pos_horiz_accuracy = pos_horiz_accuracy;
166 packet.pos_vert_accuracy = pos_vert_accuracy;
167 packet.flags = flags;
168
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
170#endif
171
173#if MAVLINK_CRC_EXTRA
174 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
175#else
176 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
177#endif
178}
179
180/**
181 * @brief Pack a estimator_status message on a channel
182 * @param system_id ID of this system
183 * @param component_id ID of this component (e.g. 200 for IMU)
184 * @param chan The MAVLink channel this message will be sent over
185 * @param msg The MAVLink message to compress the data into
186 * @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.
187 * @param flags Bitmap indicating which EKF outputs are valid.
188 * @param vel_ratio Velocity innovation test ratio
189 * @param pos_horiz_ratio Horizontal position innovation test ratio
190 * @param pos_vert_ratio Vertical position innovation test ratio
191 * @param mag_ratio Magnetometer innovation test ratio
192 * @param hagl_ratio Height above terrain innovation test ratio
193 * @param tas_ratio True airspeed innovation test ratio
194 * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
195 * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
196 * @return length of the message in bytes (excluding serial stream start sign)
197 */
198static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
199 mavlink_message_t* msg,
200 uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy)
201{
202#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
204 _mav_put_uint64_t(buf, 0, time_usec);
205 _mav_put_float(buf, 8, vel_ratio);
206 _mav_put_float(buf, 12, pos_horiz_ratio);
207 _mav_put_float(buf, 16, pos_vert_ratio);
208 _mav_put_float(buf, 20, mag_ratio);
209 _mav_put_float(buf, 24, hagl_ratio);
210 _mav_put_float(buf, 28, tas_ratio);
211 _mav_put_float(buf, 32, pos_horiz_accuracy);
212 _mav_put_float(buf, 36, pos_vert_accuracy);
213 _mav_put_uint16_t(buf, 40, flags);
214
215 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
216#else
217 mavlink_estimator_status_t packet;
218 packet.time_usec = time_usec;
219 packet.vel_ratio = vel_ratio;
220 packet.pos_horiz_ratio = pos_horiz_ratio;
221 packet.pos_vert_ratio = pos_vert_ratio;
222 packet.mag_ratio = mag_ratio;
223 packet.hagl_ratio = hagl_ratio;
224 packet.tas_ratio = tas_ratio;
225 packet.pos_horiz_accuracy = pos_horiz_accuracy;
226 packet.pos_vert_accuracy = pos_vert_accuracy;
227 packet.flags = flags;
228
229 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
230#endif
231
233 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
234}
235
236/**
237 * @brief Encode a estimator_status struct
238 *
239 * @param system_id ID of this system
240 * @param component_id ID of this component (e.g. 200 for IMU)
241 * @param msg The MAVLink message to compress the data into
242 * @param estimator_status C-struct to read the message contents from
243 */
244static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
245{
246 return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
247}
248
249/**
250 * @brief Encode a estimator_status struct on a channel
251 *
252 * @param system_id ID of this system
253 * @param component_id ID of this component (e.g. 200 for IMU)
254 * @param chan The MAVLink channel this message will be sent over
255 * @param msg The MAVLink message to compress the data into
256 * @param estimator_status C-struct to read the message contents from
257 */
258static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
259{
260 return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
261}
262
263/**
264 * @brief Encode a estimator_status struct with provided status structure
265 *
266 * @param system_id ID of this system
267 * @param component_id ID of this component (e.g. 200 for IMU)
268 * @param status MAVLink status structure
269 * @param msg The MAVLink message to compress the data into
270 * @param estimator_status C-struct to read the message contents from
271 */
272static inline uint16_t mavlink_msg_estimator_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
273{
274 return mavlink_msg_estimator_status_pack_status(system_id, component_id, _status, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
275}
276
277/**
278 * @brief Send a estimator_status message
279 * @param chan MAVLink channel to send the message
280 *
281 * @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.
282 * @param flags Bitmap indicating which EKF outputs are valid.
283 * @param vel_ratio Velocity innovation test ratio
284 * @param pos_horiz_ratio Horizontal position innovation test ratio
285 * @param pos_vert_ratio Vertical position innovation test ratio
286 * @param mag_ratio Magnetometer innovation test ratio
287 * @param hagl_ratio Height above terrain innovation test ratio
288 * @param tas_ratio True airspeed innovation test ratio
289 * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
290 * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
291 */
292#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
293
294static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
295{
296#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
297 char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
298 _mav_put_uint64_t(buf, 0, time_usec);
299 _mav_put_float(buf, 8, vel_ratio);
300 _mav_put_float(buf, 12, pos_horiz_ratio);
301 _mav_put_float(buf, 16, pos_vert_ratio);
302 _mav_put_float(buf, 20, mag_ratio);
303 _mav_put_float(buf, 24, hagl_ratio);
304 _mav_put_float(buf, 28, tas_ratio);
305 _mav_put_float(buf, 32, pos_horiz_accuracy);
306 _mav_put_float(buf, 36, pos_vert_accuracy);
307 _mav_put_uint16_t(buf, 40, flags);
308
309 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
310#else
311 mavlink_estimator_status_t packet;
312 packet.time_usec = time_usec;
313 packet.vel_ratio = vel_ratio;
314 packet.pos_horiz_ratio = pos_horiz_ratio;
315 packet.pos_vert_ratio = pos_vert_ratio;
316 packet.mag_ratio = mag_ratio;
317 packet.hagl_ratio = hagl_ratio;
318 packet.tas_ratio = tas_ratio;
319 packet.pos_horiz_accuracy = pos_horiz_accuracy;
320 packet.pos_vert_accuracy = pos_vert_accuracy;
321 packet.flags = flags;
322
323 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
324#endif
325}
326
327/**
328 * @brief Send a estimator_status message
329 * @param chan MAVLink channel to send the message
330 * @param struct The MAVLink struct to serialize
331 */
332static inline void mavlink_msg_estimator_status_send_struct(mavlink_channel_t chan, const mavlink_estimator_status_t* estimator_status)
333{
334#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
335 mavlink_msg_estimator_status_send(chan, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
336#else
337 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)estimator_status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
338#endif
339}
340
341#if MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
342/*
343 This variant of _send() can be used to save stack space by reusing
344 memory from the receive buffer. The caller provides a
345 mavlink_message_t which is the size of a full mavlink message. This
346 is usually the receive buffer for the channel, and allows a reply to an
347 incoming message with minimum stack space usage.
348 */
349static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
350{
351#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
352 char *buf = (char *)msgbuf;
353 _mav_put_uint64_t(buf, 0, time_usec);
354 _mav_put_float(buf, 8, vel_ratio);
355 _mav_put_float(buf, 12, pos_horiz_ratio);
356 _mav_put_float(buf, 16, pos_vert_ratio);
357 _mav_put_float(buf, 20, mag_ratio);
358 _mav_put_float(buf, 24, hagl_ratio);
359 _mav_put_float(buf, 28, tas_ratio);
360 _mav_put_float(buf, 32, pos_horiz_accuracy);
361 _mav_put_float(buf, 36, pos_vert_accuracy);
362 _mav_put_uint16_t(buf, 40, flags);
363
364 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
365#else
366 mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf;
367 packet->time_usec = time_usec;
368 packet->vel_ratio = vel_ratio;
369 packet->pos_horiz_ratio = pos_horiz_ratio;
370 packet->pos_vert_ratio = pos_vert_ratio;
371 packet->mag_ratio = mag_ratio;
372 packet->hagl_ratio = hagl_ratio;
373 packet->tas_ratio = tas_ratio;
374 packet->pos_horiz_accuracy = pos_horiz_accuracy;
375 packet->pos_vert_accuracy = pos_vert_accuracy;
376 packet->flags = flags;
377
378 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
379#endif
380}
381#endif
382
383#endif
384
385// MESSAGE ESTIMATOR_STATUS UNPACKING
386
387
388/**
389 * @brief Get field time_usec from estimator_status message
390 *
391 * @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.
392 */
393static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg)
394{
395 return _MAV_RETURN_uint64_t(msg, 0);
396}
397
398/**
399 * @brief Get field flags from estimator_status message
400 *
401 * @return Bitmap indicating which EKF outputs are valid.
402 */
403static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg)
404{
405 return _MAV_RETURN_uint16_t(msg, 40);
406}
407
408/**
409 * @brief Get field vel_ratio from estimator_status message
410 *
411 * @return Velocity innovation test ratio
412 */
413static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg)
414{
415 return _MAV_RETURN_float(msg, 8);
416}
417
418/**
419 * @brief Get field pos_horiz_ratio from estimator_status message
420 *
421 * @return Horizontal position innovation test ratio
422 */
423static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg)
424{
425 return _MAV_RETURN_float(msg, 12);
426}
427
428/**
429 * @brief Get field pos_vert_ratio from estimator_status message
430 *
431 * @return Vertical position innovation test ratio
432 */
433static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg)
434{
435 return _MAV_RETURN_float(msg, 16);
436}
437
438/**
439 * @brief Get field mag_ratio from estimator_status message
440 *
441 * @return Magnetometer innovation test ratio
442 */
443static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg)
444{
445 return _MAV_RETURN_float(msg, 20);
446}
447
448/**
449 * @brief Get field hagl_ratio from estimator_status message
450 *
451 * @return Height above terrain innovation test ratio
452 */
453static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg)
454{
455 return _MAV_RETURN_float(msg, 24);
456}
457
458/**
459 * @brief Get field tas_ratio from estimator_status message
460 *
461 * @return True airspeed innovation test ratio
462 */
463static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg)
464{
465 return _MAV_RETURN_float(msg, 28);
466}
467
468/**
469 * @brief Get field pos_horiz_accuracy from estimator_status message
470 *
471 * @return [m] Horizontal position 1-STD accuracy relative to the EKF local origin
472 */
473static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg)
474{
475 return _MAV_RETURN_float(msg, 32);
476}
477
478/**
479 * @brief Get field pos_vert_accuracy from estimator_status message
480 *
481 * @return [m] Vertical position 1-STD accuracy relative to the EKF local origin
482 */
483static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg)
484{
485 return _MAV_RETURN_float(msg, 36);
486}
487
488/**
489 * @brief Decode a estimator_status message into a struct
490 *
491 * @param msg The message to decode
492 * @param estimator_status C-struct to decode the message contents into
493 */
494static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status)
495{
496#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
497 estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg);
498 estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg);
499 estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg);
500 estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg);
501 estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg);
502 estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg);
503 estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg);
504 estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg);
505 estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg);
506 estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg);
507#else
508 uint8_t len = msg->len < MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN;
509 memset(estimator_status, 0, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
510 memcpy(estimator_status, _MAV_PAYLOAD(msg), len);
511#endif
512}