mavlink_msg_estimator_status.h
Go to the documentation of this file.
1 // MESSAGE ESTIMATOR_STATUS PACKING
2 
3 #define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230
4 
6 {
7  uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
8  float vel_ratio; /*< Velocity innovation test ratio*/
9  float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/
10  float pos_vert_ratio; /*< Vertical position innovation test ratio*/
11  float mag_ratio; /*< Magnetometer innovation test ratio*/
12  float hagl_ratio; /*< Height above terrain innovation test ratio*/
13  float tas_ratio; /*< True airspeed innovation test ratio*/
14  float pos_horiz_accuracy; /*< Horizontal position 1-STD accuracy relative to the EKF local origin (m)*/
15  float pos_vert_accuracy; /*< Vertical position 1-STD accuracy relative to the EKF local origin (m)*/
16  uint16_t flags; /*< Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.*/
18 
19 #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42
20 #define MAVLINK_MSG_ID_230_LEN 42
21 
22 #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163
23 #define MAVLINK_MSG_ID_230_CRC 163
24 
25 
26 
27 #define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
28  "ESTIMATOR_STATUS", \
29  10, \
30  { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
31  { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
32  { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
33  { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
34  { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
35  { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
36  { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
37  { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
38  { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
39  { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
40  } \
41 }
42 
43 
62 static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
63  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)
64 {
65 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
67  _mav_put_uint64_t(buf, 0, time_usec);
68  _mav_put_float(buf, 8, vel_ratio);
69  _mav_put_float(buf, 12, pos_horiz_ratio);
70  _mav_put_float(buf, 16, pos_vert_ratio);
71  _mav_put_float(buf, 20, mag_ratio);
72  _mav_put_float(buf, 24, hagl_ratio);
73  _mav_put_float(buf, 28, tas_ratio);
74  _mav_put_float(buf, 32, pos_horiz_accuracy);
75  _mav_put_float(buf, 36, pos_vert_accuracy);
76  _mav_put_uint16_t(buf, 40, flags);
77 
79 #else
81  packet.time_usec = time_usec;
82  packet.vel_ratio = vel_ratio;
85  packet.mag_ratio = mag_ratio;
86  packet.hagl_ratio = hagl_ratio;
87  packet.tas_ratio = tas_ratio;
90  packet.flags = flags;
91 
93 #endif
94 
96 #if MAVLINK_CRC_EXTRA
98 #else
99  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
100 #endif
101 }
102 
121 static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
122  mavlink_message_t* msg,
123  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)
124 {
125 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
127  _mav_put_uint64_t(buf, 0, time_usec);
128  _mav_put_float(buf, 8, vel_ratio);
129  _mav_put_float(buf, 12, pos_horiz_ratio);
130  _mav_put_float(buf, 16, pos_vert_ratio);
131  _mav_put_float(buf, 20, mag_ratio);
132  _mav_put_float(buf, 24, hagl_ratio);
133  _mav_put_float(buf, 28, tas_ratio);
134  _mav_put_float(buf, 32, pos_horiz_accuracy);
135  _mav_put_float(buf, 36, pos_vert_accuracy);
136  _mav_put_uint16_t(buf, 40, flags);
137 
139 #else
141  packet.time_usec = time_usec;
142  packet.vel_ratio = vel_ratio;
145  packet.mag_ratio = mag_ratio;
146  packet.hagl_ratio = hagl_ratio;
147  packet.tas_ratio = tas_ratio;
150  packet.flags = flags;
151 
153 #endif
154 
155  msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
156 #if MAVLINK_CRC_EXTRA
158 #else
159  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
160 #endif
161 }
162 
171 static 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)
172 {
173  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);
174 }
175 
185 static 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)
186 {
187  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);
188 }
189 
205 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
206 
207 static 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)
208 {
209 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
211  _mav_put_uint64_t(buf, 0, time_usec);
212  _mav_put_float(buf, 8, vel_ratio);
214  _mav_put_float(buf, 16, pos_vert_ratio);
215  _mav_put_float(buf, 20, mag_ratio);
216  _mav_put_float(buf, 24, hagl_ratio);
217  _mav_put_float(buf, 28, tas_ratio);
219  _mav_put_float(buf, 36, pos_vert_accuracy);
220  _mav_put_uint16_t(buf, 40, flags);
221 
222 #if MAVLINK_CRC_EXTRA
224 #else
225  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
226 #endif
227 #else
229  packet.time_usec = time_usec;
230  packet.vel_ratio = vel_ratio;
233  packet.mag_ratio = mag_ratio;
234  packet.hagl_ratio = hagl_ratio;
235  packet.tas_ratio = tas_ratio;
238  packet.flags = flags;
239 
240 #if MAVLINK_CRC_EXTRA
241  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
242 #else
243  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
244 #endif
245 #endif
246 }
247 
248 #if MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
249 /*
250  This varient of _send() can be used to save stack space by re-using
251  memory from the receive buffer. The caller provides a
252  mavlink_message_t which is the size of a full mavlink message. This
253  is usually the receive buffer for the channel, and allows a reply to an
254  incoming message with minimum stack space usage.
255  */
256 static 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)
257 {
258 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
259  char *buf = (char *)msgbuf;
260  _mav_put_uint64_t(buf, 0, time_usec);
261  _mav_put_float(buf, 8, vel_ratio);
263  _mav_put_float(buf, 16, pos_vert_ratio);
264  _mav_put_float(buf, 20, mag_ratio);
265  _mav_put_float(buf, 24, hagl_ratio);
266  _mav_put_float(buf, 28, tas_ratio);
268  _mav_put_float(buf, 36, pos_vert_accuracy);
269  _mav_put_uint16_t(buf, 40, flags);
270 
271 #if MAVLINK_CRC_EXTRA
273 #else
274  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
275 #endif
276 #else
278  packet->time_usec = time_usec;
279  packet->vel_ratio = vel_ratio;
281  packet->pos_vert_ratio = pos_vert_ratio;
282  packet->mag_ratio = mag_ratio;
283  packet->hagl_ratio = hagl_ratio;
284  packet->tas_ratio = tas_ratio;
287  packet->flags = flags;
288 
289 #if MAVLINK_CRC_EXTRA
290  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
291 #else
292  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
293 #endif
294 #endif
295 }
296 #endif
297 
298 #endif
299 
300 // MESSAGE ESTIMATOR_STATUS UNPACKING
301 
302 
308 static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg)
309 {
310  return _MAV_RETURN_uint64_t(msg, 0);
311 }
312 
318 static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg)
319 {
320  return _MAV_RETURN_uint16_t(msg, 40);
321 }
322 
328 static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg)
329 {
330  return _MAV_RETURN_float(msg, 8);
331 }
332 
338 static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg)
339 {
340  return _MAV_RETURN_float(msg, 12);
341 }
342 
348 static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg)
349 {
350  return _MAV_RETURN_float(msg, 16);
351 }
352 
358 static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg)
359 {
360  return _MAV_RETURN_float(msg, 20);
361 }
362 
368 static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg)
369 {
370  return _MAV_RETURN_float(msg, 24);
371 }
372 
378 static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg)
379 {
380  return _MAV_RETURN_float(msg, 28);
381 }
382 
388 static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg)
389 {
390  return _MAV_RETURN_float(msg, 32);
391 }
392 
398 static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg)
399 {
400  return _MAV_RETURN_float(msg, 36);
401 }
402 
409 static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status)
410 {
411 #if MAVLINK_NEED_BYTE_SWAP
412  estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg);
413  estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg);
416  estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg);
418  estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg);
421  estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg);
422 #else
423  memcpy(estimator_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
424 #endif
425 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:151
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:149
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:145


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:46