before merging master
[inav.git] / lib / main / MAVLink / common / mavlink_msg_global_vision_position_estimate.h
blob94a3d05dd4c6992b47c7cef7e7e93638098762ac
1 #pragma once
2 // MESSAGE GLOBAL_VISION_POSITION_ESTIMATE PACKING
4 #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101
7 typedef struct __mavlink_global_vision_position_estimate_t {
8 uint64_t usec; /*< [us] Timestamp (UNIX time or 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 pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, 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 uint8_t reset_counter; /*< Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.*/
17 } mavlink_global_vision_position_estimate_t;
19 #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 117
20 #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN 32
21 #define MAVLINK_MSG_ID_101_LEN 117
22 #define MAVLINK_MSG_ID_101_MIN_LEN 32
24 #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102
25 #define MAVLINK_MSG_ID_101_CRC 102
27 #define MAVLINK_MSG_GLOBAL_VISION_POSITION_ESTIMATE_FIELD_COVARIANCE_LEN 21
29 #if MAVLINK_COMMAND_24BIT
30 #define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
31 101, \
32 "GLOBAL_VISION_POSITION_ESTIMATE", \
33 9, \
34 { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
35 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
36 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
37 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
38 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
39 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
40 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
41 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_global_vision_position_estimate_t, covariance) }, \
42 { "reset_counter", NULL, MAVLINK_TYPE_UINT8_T, 0, 116, offsetof(mavlink_global_vision_position_estimate_t, reset_counter) }, \
43 } \
45 #else
46 #define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
47 "GLOBAL_VISION_POSITION_ESTIMATE", \
48 9, \
49 { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
50 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
51 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
52 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
53 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
54 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
55 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
56 { "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_global_vision_position_estimate_t, covariance) }, \
57 { "reset_counter", NULL, MAVLINK_TYPE_UINT8_T, 0, 116, offsetof(mavlink_global_vision_position_estimate_t, reset_counter) }, \
58 } \
60 #endif
62 /**
63 * @brief Pack a global_vision_position_estimate message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
68 * @param usec [us] Timestamp (UNIX time or since system boot)
69 * @param x [m] Global X position
70 * @param y [m] Global Y position
71 * @param z [m] Global Z position
72 * @param roll [rad] Roll angle
73 * @param pitch [rad] Pitch angle
74 * @param yaw [rad] Yaw angle
75 * @param covariance Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, 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.
76 * @param reset_counter Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
77 * @return length of the message in bytes (excluding serial stream start sign)
79 static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance, uint8_t reset_counter)
82 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
83 char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
84 _mav_put_uint64_t(buf, 0, usec);
85 _mav_put_float(buf, 8, x);
86 _mav_put_float(buf, 12, y);
87 _mav_put_float(buf, 16, z);
88 _mav_put_float(buf, 20, roll);
89 _mav_put_float(buf, 24, pitch);
90 _mav_put_float(buf, 28, yaw);
91 _mav_put_uint8_t(buf, 116, reset_counter);
92 _mav_put_float_array(buf, 32, covariance, 21);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
94 #else
95 mavlink_global_vision_position_estimate_t packet;
96 packet.usec = usec;
97 packet.x = x;
98 packet.y = y;
99 packet.z = z;
100 packet.roll = roll;
101 packet.pitch = pitch;
102 packet.yaw = yaw;
103 packet.reset_counter = reset_counter;
104 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
105 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
106 #endif
108 msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
109 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
113 * @brief Pack a global_vision_position_estimate message on a channel
114 * @param system_id ID of this system
115 * @param component_id ID of this component (e.g. 200 for IMU)
116 * @param chan The MAVLink channel this message will be sent over
117 * @param msg The MAVLink message to compress the data into
118 * @param usec [us] Timestamp (UNIX time or since system boot)
119 * @param x [m] Global X position
120 * @param y [m] Global Y position
121 * @param z [m] Global Z position
122 * @param roll [rad] Roll angle
123 * @param pitch [rad] Pitch angle
124 * @param yaw [rad] Yaw angle
125 * @param covariance Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, 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.
126 * @param reset_counter Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
127 * @return length of the message in bytes (excluding serial stream start sign)
129 static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
130 mavlink_message_t* msg,
131 uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw,const float *covariance,uint8_t reset_counter)
133 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
135 _mav_put_uint64_t(buf, 0, usec);
136 _mav_put_float(buf, 8, x);
137 _mav_put_float(buf, 12, y);
138 _mav_put_float(buf, 16, z);
139 _mav_put_float(buf, 20, roll);
140 _mav_put_float(buf, 24, pitch);
141 _mav_put_float(buf, 28, yaw);
142 _mav_put_uint8_t(buf, 116, reset_counter);
143 _mav_put_float_array(buf, 32, covariance, 21);
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
145 #else
146 mavlink_global_vision_position_estimate_t packet;
147 packet.usec = usec;
148 packet.x = x;
149 packet.y = y;
150 packet.z = z;
151 packet.roll = roll;
152 packet.pitch = pitch;
153 packet.yaw = yaw;
154 packet.reset_counter = reset_counter;
155 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
156 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
157 #endif
159 msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
160 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
164 * @brief Encode a global_vision_position_estimate struct
166 * @param system_id ID of this system
167 * @param component_id ID of this component (e.g. 200 for IMU)
168 * @param msg The MAVLink message to compress the data into
169 * @param global_vision_position_estimate C-struct to read the message contents from
171 static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
173 return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw, global_vision_position_estimate->covariance, global_vision_position_estimate->reset_counter);
177 * @brief Encode a global_vision_position_estimate struct on a channel
179 * @param system_id ID of this system
180 * @param component_id ID of this component (e.g. 200 for IMU)
181 * @param chan The MAVLink channel this message will be sent over
182 * @param msg The MAVLink message to compress the data into
183 * @param global_vision_position_estimate C-struct to read the message contents from
185 static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
187 return mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw, global_vision_position_estimate->covariance, global_vision_position_estimate->reset_counter);
191 * @brief Send a global_vision_position_estimate message
192 * @param chan MAVLink channel to send the message
194 * @param usec [us] Timestamp (UNIX time or since system boot)
195 * @param x [m] Global X position
196 * @param y [m] Global Y position
197 * @param z [m] Global Z position
198 * @param roll [rad] Roll angle
199 * @param pitch [rad] Pitch angle
200 * @param yaw [rad] Yaw angle
201 * @param covariance Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, 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.
202 * @param reset_counter Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
204 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
206 static inline void mavlink_msg_global_vision_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, uint8_t reset_counter)
208 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
209 char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
210 _mav_put_uint64_t(buf, 0, usec);
211 _mav_put_float(buf, 8, x);
212 _mav_put_float(buf, 12, y);
213 _mav_put_float(buf, 16, z);
214 _mav_put_float(buf, 20, roll);
215 _mav_put_float(buf, 24, pitch);
216 _mav_put_float(buf, 28, yaw);
217 _mav_put_uint8_t(buf, 116, reset_counter);
218 _mav_put_float_array(buf, 32, covariance, 21);
219 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
220 #else
221 mavlink_global_vision_position_estimate_t packet;
222 packet.usec = usec;
223 packet.x = x;
224 packet.y = y;
225 packet.z = z;
226 packet.roll = roll;
227 packet.pitch = pitch;
228 packet.yaw = yaw;
229 packet.reset_counter = reset_counter;
230 mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
231 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
232 #endif
236 * @brief Send a global_vision_position_estimate message
237 * @param chan MAVLink channel to send the message
238 * @param struct The MAVLink struct to serialize
240 static inline void mavlink_msg_global_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
242 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 mavlink_msg_global_vision_position_estimate_send(chan, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw, global_vision_position_estimate->covariance, global_vision_position_estimate->reset_counter);
244 #else
245 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)global_vision_position_estimate, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
246 #endif
249 #if MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
251 This varient of _send() can be used to save stack space by re-using
252 memory from the receive buffer. The caller provides a
253 mavlink_message_t which is the size of a full mavlink message. This
254 is usually the receive buffer for the channel, and allows a reply to an
255 incoming message with minimum stack space usage.
257 static inline void mavlink_msg_global_vision_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, uint8_t reset_counter)
259 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
260 char *buf = (char *)msgbuf;
261 _mav_put_uint64_t(buf, 0, usec);
262 _mav_put_float(buf, 8, x);
263 _mav_put_float(buf, 12, y);
264 _mav_put_float(buf, 16, z);
265 _mav_put_float(buf, 20, roll);
266 _mav_put_float(buf, 24, pitch);
267 _mav_put_float(buf, 28, yaw);
268 _mav_put_uint8_t(buf, 116, reset_counter);
269 _mav_put_float_array(buf, 32, covariance, 21);
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
271 #else
272 mavlink_global_vision_position_estimate_t *packet = (mavlink_global_vision_position_estimate_t *)msgbuf;
273 packet->usec = usec;
274 packet->x = x;
275 packet->y = y;
276 packet->z = z;
277 packet->roll = roll;
278 packet->pitch = pitch;
279 packet->yaw = yaw;
280 packet->reset_counter = reset_counter;
281 mav_array_memcpy(packet->covariance, covariance, sizeof(float)*21);
282 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
283 #endif
285 #endif
287 #endif
289 // MESSAGE GLOBAL_VISION_POSITION_ESTIMATE UNPACKING
293 * @brief Get field usec from global_vision_position_estimate message
295 * @return [us] Timestamp (UNIX time or since system boot)
297 static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
299 return _MAV_RETURN_uint64_t(msg, 0);
303 * @brief Get field x from global_vision_position_estimate message
305 * @return [m] Global X position
307 static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg)
309 return _MAV_RETURN_float(msg, 8);
313 * @brief Get field y from global_vision_position_estimate message
315 * @return [m] Global Y position
317 static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg)
319 return _MAV_RETURN_float(msg, 12);
323 * @brief Get field z from global_vision_position_estimate message
325 * @return [m] Global Z position
327 static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg)
329 return _MAV_RETURN_float(msg, 16);
333 * @brief Get field roll from global_vision_position_estimate message
335 * @return [rad] Roll angle
337 static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg)
339 return _MAV_RETURN_float(msg, 20);
343 * @brief Get field pitch from global_vision_position_estimate message
345 * @return [rad] Pitch angle
347 static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
349 return _MAV_RETURN_float(msg, 24);
353 * @brief Get field yaw from global_vision_position_estimate message
355 * @return [rad] Yaw angle
357 static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
359 return _MAV_RETURN_float(msg, 28);
363 * @brief Get field covariance from global_vision_position_estimate message
365 * @return Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, 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.
367 static inline uint16_t mavlink_msg_global_vision_position_estimate_get_covariance(const mavlink_message_t* msg, float *covariance)
369 return _MAV_RETURN_float_array(msg, covariance, 21, 32);
373 * @brief Get field reset_counter from global_vision_position_estimate message
375 * @return Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
377 static inline uint8_t mavlink_msg_global_vision_position_estimate_get_reset_counter(const mavlink_message_t* msg)
379 return _MAV_RETURN_uint8_t(msg, 116);
383 * @brief Decode a global_vision_position_estimate message into a struct
385 * @param msg The message to decode
386 * @param global_vision_position_estimate C-struct to decode the message contents into
388 static inline void mavlink_msg_global_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
390 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
391 global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg);
392 global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg);
393 global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg);
394 global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg);
395 global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg);
396 global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg);
397 global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg);
398 mavlink_msg_global_vision_position_estimate_get_covariance(msg, global_vision_position_estimate->covariance);
399 global_vision_position_estimate->reset_counter = mavlink_msg_global_vision_position_estimate_get_reset_counter(msg);
400 #else
401 uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN;
402 memset(global_vision_position_estimate, 0, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
403 memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), len);
404 #endif