mavlink_msg_local_position_ned_cov.h
Go to the documentation of this file.
1 // MESSAGE LOCAL_POSITION_NED_COV PACKING
2 
3 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64
4 
6 {
7  uint64_t time_utc; /*< Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.*/
8  uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp*/
9  float x; /*< X Position*/
10  float y; /*< Y Position*/
11  float z; /*< Z Position*/
12  float vx; /*< X Speed (m/s)*/
13  float vy; /*< Y Speed (m/s)*/
14  float vz; /*< Z Speed (m/s)*/
15  float ax; /*< X Acceleration (m/s^2)*/
16  float ay; /*< Y Acceleration (m/s^2)*/
17  float az; /*< Z Acceleration (m/s^2)*/
18  float covariance[45]; /*< Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)*/
19  uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
21 
22 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN 229
23 #define MAVLINK_MSG_ID_64_LEN 229
24 
25 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC 59
26 #define MAVLINK_MSG_ID_64_CRC 59
27 
28 #define MAVLINK_MSG_LOCAL_POSITION_NED_COV_FIELD_COVARIANCE_LEN 45
29 
30 #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \
31  "LOCAL_POSITION_NED_COV", \
32  13, \
33  { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_utc) }, \
34  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_local_position_ned_cov_t, time_boot_ms) }, \
35  { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, x) }, \
36  { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, y) }, \
37  { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, z) }, \
38  { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vx) }, \
39  { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vy) }, \
40  { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, vz) }, \
41  { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ax) }, \
42  { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, ay) }, \
43  { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_local_position_ned_cov_t, az) }, \
44  { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 48, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \
45  { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \
46  } \
47 }
48 
49 
71 static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72  uint32_t time_boot_ms, uint64_t time_utc, 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)
73 {
74 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
76  _mav_put_uint64_t(buf, 0, time_utc);
77  _mav_put_uint32_t(buf, 8, time_boot_ms);
78  _mav_put_float(buf, 12, x);
79  _mav_put_float(buf, 16, y);
80  _mav_put_float(buf, 20, z);
81  _mav_put_float(buf, 24, vx);
82  _mav_put_float(buf, 28, vy);
83  _mav_put_float(buf, 32, vz);
84  _mav_put_float(buf, 36, ax);
85  _mav_put_float(buf, 40, ay);
86  _mav_put_float(buf, 44, az);
87  _mav_put_uint8_t(buf, 228, estimator_type);
88  _mav_put_float_array(buf, 48, covariance, 45);
90 #else
92  packet.time_utc = time_utc;
93  packet.time_boot_ms = time_boot_ms;
94  packet.x = x;
95  packet.y = y;
96  packet.z = z;
97  packet.vx = vx;
98  packet.vy = vy;
99  packet.vz = vz;
100  packet.ax = ax;
101  packet.ay = ay;
102  packet.az = az;
104  mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
106 #endif
107 
109 #if MAVLINK_CRC_EXTRA
111 #else
112  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
113 #endif
114 }
115 
137 static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
138  mavlink_message_t* msg,
139  uint32_t time_boot_ms,uint64_t time_utc,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)
140 {
141 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
143  _mav_put_uint64_t(buf, 0, time_utc);
144  _mav_put_uint32_t(buf, 8, time_boot_ms);
145  _mav_put_float(buf, 12, x);
146  _mav_put_float(buf, 16, y);
147  _mav_put_float(buf, 20, z);
148  _mav_put_float(buf, 24, vx);
149  _mav_put_float(buf, 28, vy);
150  _mav_put_float(buf, 32, vz);
151  _mav_put_float(buf, 36, ax);
152  _mav_put_float(buf, 40, ay);
153  _mav_put_float(buf, 44, az);
154  _mav_put_uint8_t(buf, 228, estimator_type);
155  _mav_put_float_array(buf, 48, covariance, 45);
157 #else
159  packet.time_utc = time_utc;
160  packet.time_boot_ms = time_boot_ms;
161  packet.x = x;
162  packet.y = y;
163  packet.z = z;
164  packet.vx = vx;
165  packet.vy = vy;
166  packet.vz = vz;
167  packet.ax = ax;
168  packet.ay = ay;
169  packet.az = az;
171  mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
173 #endif
174 
176 #if MAVLINK_CRC_EXTRA
178 #else
179  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
180 #endif
181 }
182 
191 static 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)
192 {
193  return mavlink_msg_local_position_ned_cov_pack(system_id, component_id, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, 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);
194 }
195 
205 static 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)
206 {
207  return mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, chan, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, 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);
208 }
209 
228 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
229 
230 static inline void mavlink_msg_local_position_ned_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, 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)
231 {
232 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
234  _mav_put_uint64_t(buf, 0, time_utc);
236  _mav_put_float(buf, 12, x);
237  _mav_put_float(buf, 16, y);
238  _mav_put_float(buf, 20, z);
239  _mav_put_float(buf, 24, vx);
240  _mav_put_float(buf, 28, vy);
241  _mav_put_float(buf, 32, vz);
242  _mav_put_float(buf, 36, ax);
243  _mav_put_float(buf, 40, ay);
244  _mav_put_float(buf, 44, az);
245  _mav_put_uint8_t(buf, 228, estimator_type);
246  _mav_put_float_array(buf, 48, covariance, 45);
247 #if MAVLINK_CRC_EXTRA
249 #else
250  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
251 #endif
252 #else
254  packet.time_utc = time_utc;
255  packet.time_boot_ms = time_boot_ms;
256  packet.x = x;
257  packet.y = y;
258  packet.z = z;
259  packet.vx = vx;
260  packet.vy = vy;
261  packet.vz = vz;
262  packet.ax = ax;
263  packet.ay = ay;
264  packet.az = az;
266  mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
267 #if MAVLINK_CRC_EXTRA
269 #else
270  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
271 #endif
272 #endif
273 }
274 
275 #if MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
276 /*
277  This varient of _send() can be used to save stack space by re-using
278  memory from the receive buffer. The caller provides a
279  mavlink_message_t which is the size of a full mavlink message. This
280  is usually the receive buffer for the channel, and allows a reply to an
281  incoming message with minimum stack space usage.
282  */
283 static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, 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)
284 {
285 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
286  char *buf = (char *)msgbuf;
287  _mav_put_uint64_t(buf, 0, time_utc);
289  _mav_put_float(buf, 12, x);
290  _mav_put_float(buf, 16, y);
291  _mav_put_float(buf, 20, z);
292  _mav_put_float(buf, 24, vx);
293  _mav_put_float(buf, 28, vy);
294  _mav_put_float(buf, 32, vz);
295  _mav_put_float(buf, 36, ax);
296  _mav_put_float(buf, 40, ay);
297  _mav_put_float(buf, 44, az);
298  _mav_put_uint8_t(buf, 228, estimator_type);
299  _mav_put_float_array(buf, 48, covariance, 45);
300 #if MAVLINK_CRC_EXTRA
302 #else
303  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
304 #endif
305 #else
307  packet->time_utc = time_utc;
308  packet->time_boot_ms = time_boot_ms;
309  packet->x = x;
310  packet->y = y;
311  packet->z = z;
312  packet->vx = vx;
313  packet->vy = vy;
314  packet->vz = vz;
315  packet->ax = ax;
316  packet->ay = ay;
317  packet->az = az;
318  packet->estimator_type = estimator_type;
319  mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45);
320 #if MAVLINK_CRC_EXTRA
322 #else
323  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
324 #endif
325 #endif
326 }
327 #endif
328 
329 #endif
330 
331 // MESSAGE LOCAL_POSITION_NED_COV UNPACKING
332 
333 
339 static inline uint32_t mavlink_msg_local_position_ned_cov_get_time_boot_ms(const mavlink_message_t* msg)
340 {
341  return _MAV_RETURN_uint32_t(msg, 8);
342 }
343 
349 static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_utc(const mavlink_message_t* msg)
350 {
351  return _MAV_RETURN_uint64_t(msg, 0);
352 }
353 
359 static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg)
360 {
361  return _MAV_RETURN_uint8_t(msg, 228);
362 }
363 
369 static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg)
370 {
371  return _MAV_RETURN_float(msg, 12);
372 }
373 
379 static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg)
380 {
381  return _MAV_RETURN_float(msg, 16);
382 }
383 
389 static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg)
390 {
391  return _MAV_RETURN_float(msg, 20);
392 }
393 
399 static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg)
400 {
401  return _MAV_RETURN_float(msg, 24);
402 }
403 
409 static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg)
410 {
411  return _MAV_RETURN_float(msg, 28);
412 }
413 
419 static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg)
420 {
421  return _MAV_RETURN_float(msg, 32);
422 }
423 
429 static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg)
430 {
431  return _MAV_RETURN_float(msg, 36);
432 }
433 
439 static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg)
440 {
441  return _MAV_RETURN_float(msg, 40);
442 }
443 
449 static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg)
450 {
451  return _MAV_RETURN_float(msg, 44);
452 }
453 
459 static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
460 {
461  return _MAV_RETURN_float_array(msg, covariance, 45, 48);
462 }
463 
470 static inline void mavlink_msg_local_position_ned_cov_decode(const mavlink_message_t* msg, mavlink_local_position_ned_cov_t* local_position_ned_cov)
471 {
472 #if MAVLINK_NEED_BYTE_SWAP
473  local_position_ned_cov->time_utc = mavlink_msg_local_position_ned_cov_get_time_utc(msg);
475  local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg);
476  local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg);
477  local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg);
478  local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg);
479  local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg);
480  local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg);
481  local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg);
482  local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg);
483  local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg);
486 #else
487  memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
488 #endif
489 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:151
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:244
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:140
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:149
static void mav_array_memcpy(void *dest, const void *src, size_t n)
Definition: protocol.h:176
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:147


rosflight
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 20:00:13