RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_local_position_ned_cov.h
1#pragma once
2// MESSAGE LOCAL_POSITION_NED_COV PACKING
3
4#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64
5
6MAVPACKED(
7typedef struct __mavlink_local_position_ned_cov_t {
8 uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/
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.*/
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
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
95 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
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
126 msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV;
127 return mavlink_finalize_message(msg, system_id, component_id, 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);
128}
129
150static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
151 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
155 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
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
186 msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV;
187 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 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);
188}
189
198static 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)
199{
200 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);
201}
202
212static 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)
213{
214 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);
215}
216
234#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
235
236static 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)
237{
238#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
239 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
240 _mav_put_uint64_t(buf, 0, time_usec);
241 _mav_put_float(buf, 8, x);
242 _mav_put_float(buf, 12, y);
243 _mav_put_float(buf, 16, z);
244 _mav_put_float(buf, 20, vx);
245 _mav_put_float(buf, 24, vy);
246 _mav_put_float(buf, 28, vz);
247 _mav_put_float(buf, 32, ax);
248 _mav_put_float(buf, 36, ay);
249 _mav_put_float(buf, 40, az);
250 _mav_put_uint8_t(buf, 224, estimator_type);
251 _mav_put_float_array(buf, 44, covariance, 45);
252 _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);
253#else
254 mavlink_local_position_ned_cov_t packet;
255 packet.time_usec = time_usec;
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;
265 packet.estimator_type = estimator_type;
266 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
267 _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);
268#endif
269}
270
276static 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)
277{
278#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
279 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);
280#else
281 _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);
282#endif
283}
284
285#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
286/*
287 This varient of _send() can be used to save stack space by re-using
288 memory from the receive buffer. The caller provides a
289 mavlink_message_t which is the size of a full mavlink message. This
290 is usually the receive buffer for the channel, and allows a reply to an
291 incoming message with minimum stack space usage.
292 */
293static 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)
294{
295#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
296 char *buf = (char *)msgbuf;
297 _mav_put_uint64_t(buf, 0, time_usec);
298 _mav_put_float(buf, 8, x);
299 _mav_put_float(buf, 12, y);
300 _mav_put_float(buf, 16, z);
301 _mav_put_float(buf, 20, vx);
302 _mav_put_float(buf, 24, vy);
303 _mav_put_float(buf, 28, vz);
304 _mav_put_float(buf, 32, ax);
305 _mav_put_float(buf, 36, ay);
306 _mav_put_float(buf, 40, az);
307 _mav_put_uint8_t(buf, 224, estimator_type);
308 _mav_put_float_array(buf, 44, covariance, 45);
309 _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);
310#else
311 mavlink_local_position_ned_cov_t *packet = (mavlink_local_position_ned_cov_t *)msgbuf;
312 packet->time_usec = time_usec;
313 packet->x = x;
314 packet->y = y;
315 packet->z = z;
316 packet->vx = vx;
317 packet->vy = vy;
318 packet->vz = vz;
319 packet->ax = ax;
320 packet->ay = ay;
321 packet->az = az;
322 packet->estimator_type = estimator_type;
323 mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45);
324 _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);
325#endif
326}
327#endif
328
329#endif
330
331// MESSAGE LOCAL_POSITION_NED_COV UNPACKING
332
333
339static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_usec(const mavlink_message_t* msg)
340{
341 return _MAV_RETURN_uint64_t(msg, 0);
342}
343
349static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg)
350{
351 return _MAV_RETURN_uint8_t(msg, 224);
352}
353
359static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg)
360{
361 return _MAV_RETURN_float(msg, 8);
362}
363
369static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg)
370{
371 return _MAV_RETURN_float(msg, 12);
372}
373
379static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg)
380{
381 return _MAV_RETURN_float(msg, 16);
382}
383
389static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg)
390{
391 return _MAV_RETURN_float(msg, 20);
392}
393
399static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg)
400{
401 return _MAV_RETURN_float(msg, 24);
402}
403
409static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg)
410{
411 return _MAV_RETURN_float(msg, 28);
412}
413
419static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg)
420{
421 return _MAV_RETURN_float(msg, 32);
422}
423
429static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg)
430{
431 return _MAV_RETURN_float(msg, 36);
432}
433
439static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg)
440{
441 return _MAV_RETURN_float(msg, 40);
442}
443
449static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
450{
451 return _MAV_RETURN_float_array(msg, covariance, 45, 44);
452}
453
460static inline void mavlink_msg_local_position_ned_cov_decode(const mavlink_message_t* msg, mavlink_local_position_ned_cov_t* local_position_ned_cov)
461{
462#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
463 local_position_ned_cov->time_usec = mavlink_msg_local_position_ned_cov_get_time_usec(msg);
464 local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg);
465 local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg);
466 local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg);
467 local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg);
468 local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg);
469 local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg);
470 local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg);
471 local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg);
472 local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg);
473 mavlink_msg_local_position_ned_cov_get_covariance(msg, local_position_ned_cov->covariance);
474 local_position_ned_cov->estimator_type = mavlink_msg_local_position_ned_cov_get_estimator_type(msg);
475#else
476 uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN;
477 memset(local_position_ned_cov, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
478 memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), len);
479#endif
480}