Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_vicon_position_estimate.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE VICON_POSITION_ESTIMATE PACKING
3
4#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 104
5
6
8 uint64_t usec; /*< [us] Timestamp (UNIX time or time since system boot)*/
9 float x; /*< [m] Global X position*/
10 float y; /*< [m] Global Y position*/
11 float z; /*< [m] Global Z position*/
12 float roll; /*< [rad] Roll angle*/
13 float pitch; /*< [rad] Pitch angle*/
14 float yaw; /*< [rad] Yaw angle*/
15 float covariance[21]; /*< Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.*/
16} mavlink_vicon_position_estimate_t;
17
18#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 116
19#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN 32
20#define MAVLINK_MSG_ID_104_LEN 116
21#define MAVLINK_MSG_ID_104_MIN_LEN 32
22
23#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC 56
24#define MAVLINK_MSG_ID_104_CRC 56
25
26#define MAVLINK_MSG_VICON_POSITION_ESTIMATE_FIELD_COVARIANCE_LEN 21
27
28#if MAVLINK_COMMAND_24BIT
29#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE {
30 104,
31 "VICON_POSITION_ESTIMATE",
32 8,
33 { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) },
34 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) },
35 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) },
36 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) },
37 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) },
38 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) },
39 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) },
40 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_vicon_position_estimate_t, covariance) },
41 } \
42}
43#else
44#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE {
45 "VICON_POSITION_ESTIMATE",
46 8,
47 { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) },
48 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) },
49 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) },
50 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) },
51 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) },
52 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) },
53 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) },
54 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_vicon_position_estimate_t, covariance) },
55 } \
56}
57#endif
58
59/**
60 * @brief Pack a vicon_position_estimate message
61 * @param system_id ID of this system
62 * @param component_id ID of this component (e.g. 200 for IMU)
63 * @param msg The MAVLink message to compress the data into
64 *
65 * @param usec [us] Timestamp (UNIX time or time since system boot)
66 * @param x [m] Global X position
67 * @param y [m] Global Y position
68 * @param z [m] Global Z position
69 * @param roll [rad] Roll angle
70 * @param pitch [rad] Pitch angle
71 * @param yaw [rad] Yaw angle
72 * @param covariance Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
73 * @return length of the message in bytes (excluding serial stream start sign)
74 */
75static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
76 uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
77{
78#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
80 _mav_put_uint64_t(buf, 0, usec);
81 _mav_put_float(buf, 8, x);
82 _mav_put_float(buf, 12, y);
83 _mav_put_float(buf, 16, z);
84 _mav_put_float(buf, 20, roll);
85 _mav_put_float(buf, 24, pitch);
86 _mav_put_float(buf, 28, yaw);
87 _mav_put_float_array(buf, 32, covariance, 21);
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
89#else
90 mavlink_vicon_position_estimate_t packet;
91 packet.usec = usec;
92 packet.x = x;
93 packet.y = y;
94 packet.z = z;
95 packet.roll = roll;
96 packet.pitch = pitch;
97 packet.yaw = yaw;
98 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
100#endif
101
104}
105
106/**
107 * @brief Pack a vicon_position_estimate message
108 * @param system_id ID of this system
109 * @param component_id ID of this component (e.g. 200 for IMU)
110 * @param status MAVLink status structure
111 * @param msg The MAVLink message to compress the data into
112 *
113 * @param usec [us] Timestamp (UNIX time or time since system boot)
114 * @param x [m] Global X position
115 * @param y [m] Global Y position
116 * @param z [m] Global Z position
117 * @param roll [rad] Roll angle
118 * @param pitch [rad] Pitch angle
119 * @param yaw [rad] Yaw angle
120 * @param covariance Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
121 * @return length of the message in bytes (excluding serial stream start sign)
122 */
123static inline uint16_t mavlink_msg_vicon_position_estimate_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
124 uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
125{
126#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
128 _mav_put_uint64_t(buf, 0, usec);
129 _mav_put_float(buf, 8, x);
130 _mav_put_float(buf, 12, y);
131 _mav_put_float(buf, 16, z);
132 _mav_put_float(buf, 20, roll);
133 _mav_put_float(buf, 24, pitch);
134 _mav_put_float(buf, 28, yaw);
135 _mav_put_float_array(buf, 32, covariance, 21);
136 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
137#else
138 mavlink_vicon_position_estimate_t packet;
139 packet.usec = usec;
140 packet.x = x;
141 packet.y = y;
142 packet.z = z;
143 packet.roll = roll;
144 packet.pitch = pitch;
145 packet.yaw = yaw;
146 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
147 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
148#endif
149
151#if MAVLINK_CRC_EXTRA
152 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
153#else
154 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
155#endif
156}
157
158/**
159 * @brief Pack a vicon_position_estimate message on a channel
160 * @param system_id ID of this system
161 * @param component_id ID of this component (e.g. 200 for IMU)
162 * @param chan The MAVLink channel this message will be sent over
163 * @param msg The MAVLink message to compress the data into
164 * @param usec [us] Timestamp (UNIX time or time since system boot)
165 * @param x [m] Global X position
166 * @param y [m] Global Y position
167 * @param z [m] Global Z position
168 * @param roll [rad] Roll angle
169 * @param pitch [rad] Pitch angle
170 * @param yaw [rad] Yaw angle
171 * @param covariance Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
172 * @return length of the message in bytes (excluding serial stream start sign)
173 */
174static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
175 mavlink_message_t* msg,
176 uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw,const float *covariance)
177{
178#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
180 _mav_put_uint64_t(buf, 0, usec);
181 _mav_put_float(buf, 8, x);
182 _mav_put_float(buf, 12, y);
183 _mav_put_float(buf, 16, z);
184 _mav_put_float(buf, 20, roll);
185 _mav_put_float(buf, 24, pitch);
186 _mav_put_float(buf, 28, yaw);
187 _mav_put_float_array(buf, 32, covariance, 21);
188 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
189#else
190 mavlink_vicon_position_estimate_t packet;
191 packet.usec = usec;
192 packet.x = x;
193 packet.y = y;
194 packet.z = z;
195 packet.roll = roll;
196 packet.pitch = pitch;
197 packet.yaw = yaw;
198 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
199 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
200#endif
201
204}
205
206/**
207 * @brief Encode a vicon_position_estimate struct
208 *
209 * @param system_id ID of this system
210 * @param component_id ID of this component (e.g. 200 for IMU)
211 * @param msg The MAVLink message to compress the data into
212 * @param vicon_position_estimate C-struct to read the message contents from
213 */
214static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
215{
216 return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw, vicon_position_estimate->covariance);
217}
218
219/**
220 * @brief Encode a vicon_position_estimate struct on a channel
221 *
222 * @param system_id ID of this system
223 * @param component_id ID of this component (e.g. 200 for IMU)
224 * @param chan The MAVLink channel this message will be sent over
225 * @param msg The MAVLink message to compress the data into
226 * @param vicon_position_estimate C-struct to read the message contents from
227 */
228static inline uint16_t mavlink_msg_vicon_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
229{
230 return mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, chan, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw, vicon_position_estimate->covariance);
231}
232
233/**
234 * @brief Encode a vicon_position_estimate struct with provided status structure
235 *
236 * @param system_id ID of this system
237 * @param component_id ID of this component (e.g. 200 for IMU)
238 * @param status MAVLink status structure
239 * @param msg The MAVLink message to compress the data into
240 * @param vicon_position_estimate C-struct to read the message contents from
241 */
242static inline uint16_t mavlink_msg_vicon_position_estimate_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
243{
244 return mavlink_msg_vicon_position_estimate_pack_status(system_id, component_id, _status, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw, vicon_position_estimate->covariance);
245}
246
247/**
248 * @brief Send a vicon_position_estimate message
249 * @param chan MAVLink channel to send the message
250 *
251 * @param usec [us] Timestamp (UNIX time or time since system boot)
252 * @param x [m] Global X position
253 * @param y [m] Global Y position
254 * @param z [m] Global Z position
255 * @param roll [rad] Roll angle
256 * @param pitch [rad] Pitch angle
257 * @param yaw [rad] Yaw angle
258 * @param covariance Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
259 */
260#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
261
262static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
263{
264#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
265 char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN];
266 _mav_put_uint64_t(buf, 0, usec);
267 _mav_put_float(buf, 8, x);
268 _mav_put_float(buf, 12, y);
269 _mav_put_float(buf, 16, z);
270 _mav_put_float(buf, 20, roll);
271 _mav_put_float(buf, 24, pitch);
272 _mav_put_float(buf, 28, yaw);
273 _mav_put_float_array(buf, 32, covariance, 21);
274 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
275#else
276 mavlink_vicon_position_estimate_t packet;
277 packet.usec = usec;
278 packet.x = x;
279 packet.y = y;
280 packet.z = z;
281 packet.roll = roll;
282 packet.pitch = pitch;
283 packet.yaw = yaw;
284 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
286#endif
287}
288
289/**
290 * @brief Send a vicon_position_estimate message
291 * @param chan MAVLink channel to send the message
292 * @param struct The MAVLink struct to serialize
293 */
294static inline void mavlink_msg_vicon_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
295{
296#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
297 mavlink_msg_vicon_position_estimate_send(chan, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw, vicon_position_estimate->covariance);
298#else
299 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)vicon_position_estimate, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
300#endif
301}
302
303#if MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
304/*
305 This variant of _send() can be used to save stack space by reusing
306 memory from the receive buffer. The caller provides a
307 mavlink_message_t which is the size of a full mavlink message. This
308 is usually the receive buffer for the channel, and allows a reply to an
309 incoming message with minimum stack space usage.
310 */
311static inline void mavlink_msg_vicon_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
312{
313#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
314 char *buf = (char *)msgbuf;
315 _mav_put_uint64_t(buf, 0, usec);
316 _mav_put_float(buf, 8, x);
317 _mav_put_float(buf, 12, y);
318 _mav_put_float(buf, 16, z);
319 _mav_put_float(buf, 20, roll);
320 _mav_put_float(buf, 24, pitch);
321 _mav_put_float(buf, 28, yaw);
322 _mav_put_float_array(buf, 32, covariance, 21);
323 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
324#else
325 mavlink_vicon_position_estimate_t *packet = (mavlink_vicon_position_estimate_t *)msgbuf;
326 packet->usec = usec;
327 packet->x = x;
328 packet->y = y;
329 packet->z = z;
330 packet->roll = roll;
331 packet->pitch = pitch;
332 packet->yaw = yaw;
333 mav_array_memcpy(packet->covariance, covariance, sizeof(float)*21);
334 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
335#endif
336}
337#endif
338
339#endif
340
341// MESSAGE VICON_POSITION_ESTIMATE UNPACKING
342
343
344/**
345 * @brief Get field usec from vicon_position_estimate message
346 *
347 * @return [us] Timestamp (UNIX time or time since system boot)
348 */
349static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg)
350{
351 return _MAV_RETURN_uint64_t(msg, 0);
352}
353
354/**
355 * @brief Get field x from vicon_position_estimate message
356 *
357 * @return [m] Global X position
358 */
359static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_message_t* msg)
360{
361 return _MAV_RETURN_float(msg, 8);
362}
363
364/**
365 * @brief Get field y from vicon_position_estimate message
366 *
367 * @return [m] Global Y position
368 */
369static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_message_t* msg)
370{
371 return _MAV_RETURN_float(msg, 12);
372}
373
374/**
375 * @brief Get field z from vicon_position_estimate message
376 *
377 * @return [m] Global Z position
378 */
379static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_message_t* msg)
380{
381 return _MAV_RETURN_float(msg, 16);
382}
383
384/**
385 * @brief Get field roll from vicon_position_estimate message
386 *
387 * @return [rad] Roll angle
388 */
389static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_message_t* msg)
390{
391 return _MAV_RETURN_float(msg, 20);
392}
393
394/**
395 * @brief Get field pitch from vicon_position_estimate message
396 *
397 * @return [rad] Pitch angle
398 */
399static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_message_t* msg)
400{
401 return _MAV_RETURN_float(msg, 24);
402}
403
404/**
405 * @brief Get field yaw from vicon_position_estimate message
406 *
407 * @return [rad] Yaw angle
408 */
409static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_message_t* msg)
410{
411 return _MAV_RETURN_float(msg, 28);
412}
413
414/**
415 * @brief Get field covariance from vicon_position_estimate message
416 *
417 * @return Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
418 */
419static inline uint16_t mavlink_msg_vicon_position_estimate_get_covariance(const mavlink_message_t* msg, float *covariance)
420{
421 return _MAV_RETURN_float_array(msg, covariance, 21, 32);
422}
423
424/**
425 * @brief Decode a vicon_position_estimate message into a struct
426 *
427 * @param msg The message to decode
428 * @param vicon_position_estimate C-struct to decode the message contents into
429 */
430static inline void mavlink_msg_vicon_position_estimate_decode(const mavlink_message_t* msg, mavlink_vicon_position_estimate_t* vicon_position_estimate)
431{
432#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
433 vicon_position_estimate->usec = mavlink_msg_vicon_position_estimate_get_usec(msg);
434 vicon_position_estimate->x = mavlink_msg_vicon_position_estimate_get_x(msg);
435 vicon_position_estimate->y = mavlink_msg_vicon_position_estimate_get_y(msg);
436 vicon_position_estimate->z = mavlink_msg_vicon_position_estimate_get_z(msg);
437 vicon_position_estimate->roll = mavlink_msg_vicon_position_estimate_get_roll(msg);
438 vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg);
439 vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg);
440 mavlink_msg_vicon_position_estimate_get_covariance(msg, vicon_position_estimate->covariance);
441#else
442 uint8_t len = msg->len < MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN;
443 memset(vicon_position_estimate, 0, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
444 memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), len);
445#endif
446}