Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_sim_state.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE SIM_STATE PACKING
3
4#define MAVLINK_MSG_ID_SIM_STATE 108
5
6
7typedef struct __mavlink_sim_state_t {
8 float q1; /*< True attitude quaternion component 1, w (1 in null-rotation)*/
9 float q2; /*< True attitude quaternion component 2, x (0 in null-rotation)*/
10 float q3; /*< True attitude quaternion component 3, y (0 in null-rotation)*/
11 float q4; /*< True attitude quaternion component 4, z (0 in null-rotation)*/
12 float roll; /*< [rad] Attitude roll expressed as Euler angles, not recommended except for human-readable outputs*/
13 float pitch; /*< [rad] Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs*/
14 float yaw; /*< [rad] Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs*/
15 float xacc; /*< [m/s/s] X acceleration*/
16 float yacc; /*< [m/s/s] Y acceleration*/
17 float zacc; /*< [m/s/s] Z acceleration*/
18 float xgyro; /*< [rad/s] Angular speed around X axis*/
19 float ygyro; /*< [rad/s] Angular speed around Y axis*/
20 float zgyro; /*< [rad/s] Angular speed around Z axis*/
21 float lat; /*< [deg] Latitude (lower precision). Both this and the lat_int field should be set.*/
22 float lon; /*< [deg] Longitude (lower precision). Both this and the lon_int field should be set.*/
23 float alt; /*< [m] Altitude*/
24 float std_dev_horz; /*< Horizontal position standard deviation*/
25 float std_dev_vert; /*< Vertical position standard deviation*/
26 float vn; /*< [m/s] True velocity in north direction in earth-fixed NED frame*/
27 float ve; /*< [m/s] True velocity in east direction in earth-fixed NED frame*/
28 float vd; /*< [m/s] True velocity in down direction in earth-fixed NED frame*/
29 int32_t lat_int; /*< [degE7] Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).*/
30 int32_t lon_int; /*< [degE7] Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).*/
31} mavlink_sim_state_t;
32
33#define MAVLINK_MSG_ID_SIM_STATE_LEN 92
34#define MAVLINK_MSG_ID_SIM_STATE_MIN_LEN 84
35#define MAVLINK_MSG_ID_108_LEN 92
36#define MAVLINK_MSG_ID_108_MIN_LEN 84
37
38#define MAVLINK_MSG_ID_SIM_STATE_CRC 32
39#define MAVLINK_MSG_ID_108_CRC 32
40
41
42
43#if MAVLINK_COMMAND_24BIT
44#define MAVLINK_MESSAGE_INFO_SIM_STATE {
45 108,
46 "SIM_STATE",
47 23,
48 { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) },
49 { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) },
50 { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) },
51 { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) },
52 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) },
53 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) },
54 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) },
55 { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) },
56 { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) },
57 { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) },
58 { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) },
59 { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) },
60 { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) },
61 { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) },
62 { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) },
63 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) },
64 { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) },
65 { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) },
66 { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) },
67 { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) },
68 { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) },
69 { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 84, offsetof(mavlink_sim_state_t, lat_int) },
70 { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 88, offsetof(mavlink_sim_state_t, lon_int) },
71 } \
72}
73#else
74#define MAVLINK_MESSAGE_INFO_SIM_STATE {
75 "SIM_STATE",
76 23,
77 { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) },
78 { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) },
79 { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) },
80 { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) },
81 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) },
82 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) },
83 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) },
84 { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) },
85 { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) },
86 { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) },
87 { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) },
88 { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) },
89 { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) },
90 { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) },
91 { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) },
92 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) },
93 { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) },
94 { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) },
95 { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) },
96 { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) },
97 { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) },
98 { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 84, offsetof(mavlink_sim_state_t, lat_int) },
99 { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 88, offsetof(mavlink_sim_state_t, lon_int) },
100 } \
101}
102#endif
103
104/**
105 * @brief Pack a sim_state message
106 * @param system_id ID of this system
107 * @param component_id ID of this component (e.g. 200 for IMU)
108 * @param msg The MAVLink message to compress the data into
109 *
110 * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
111 * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
112 * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
113 * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
114 * @param roll [rad] Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
115 * @param pitch [rad] Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
116 * @param yaw [rad] Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
117 * @param xacc [m/s/s] X acceleration
118 * @param yacc [m/s/s] Y acceleration
119 * @param zacc [m/s/s] Z acceleration
120 * @param xgyro [rad/s] Angular speed around X axis
121 * @param ygyro [rad/s] Angular speed around Y axis
122 * @param zgyro [rad/s] Angular speed around Z axis
123 * @param lat [deg] Latitude (lower precision). Both this and the lat_int field should be set.
124 * @param lon [deg] Longitude (lower precision). Both this and the lon_int field should be set.
125 * @param alt [m] Altitude
126 * @param std_dev_horz Horizontal position standard deviation
127 * @param std_dev_vert Vertical position standard deviation
128 * @param vn [m/s] True velocity in north direction in earth-fixed NED frame
129 * @param ve [m/s] True velocity in east direction in earth-fixed NED frame
130 * @param vd [m/s] True velocity in down direction in earth-fixed NED frame
131 * @param lat_int [degE7] Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).
132 * @param lon_int [degE7] Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).
133 * @return length of the message in bytes (excluding serial stream start sign)
134 */
135static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
136 float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd, int32_t lat_int, int32_t lon_int)
137{
138#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
140 _mav_put_float(buf, 0, q1);
141 _mav_put_float(buf, 4, q2);
142 _mav_put_float(buf, 8, q3);
143 _mav_put_float(buf, 12, q4);
144 _mav_put_float(buf, 16, roll);
145 _mav_put_float(buf, 20, pitch);
146 _mav_put_float(buf, 24, yaw);
147 _mav_put_float(buf, 28, xacc);
148 _mav_put_float(buf, 32, yacc);
149 _mav_put_float(buf, 36, zacc);
150 _mav_put_float(buf, 40, xgyro);
151 _mav_put_float(buf, 44, ygyro);
152 _mav_put_float(buf, 48, zgyro);
153 _mav_put_float(buf, 52, lat);
154 _mav_put_float(buf, 56, lon);
155 _mav_put_float(buf, 60, alt);
156 _mav_put_float(buf, 64, std_dev_horz);
157 _mav_put_float(buf, 68, std_dev_vert);
158 _mav_put_float(buf, 72, vn);
159 _mav_put_float(buf, 76, ve);
160 _mav_put_float(buf, 80, vd);
161 _mav_put_int32_t(buf, 84, lat_int);
162 _mav_put_int32_t(buf, 88, lon_int);
163
164 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
165#else
166 mavlink_sim_state_t packet;
167 packet.q1 = q1;
168 packet.q2 = q2;
169 packet.q3 = q3;
170 packet.q4 = q4;
171 packet.roll = roll;
172 packet.pitch = pitch;
173 packet.yaw = yaw;
174 packet.xacc = xacc;
175 packet.yacc = yacc;
176 packet.zacc = zacc;
177 packet.xgyro = xgyro;
178 packet.ygyro = ygyro;
179 packet.zgyro = zgyro;
180 packet.lat = lat;
181 packet.lon = lon;
182 packet.alt = alt;
183 packet.std_dev_horz = std_dev_horz;
184 packet.std_dev_vert = std_dev_vert;
185 packet.vn = vn;
186 packet.ve = ve;
187 packet.vd = vd;
188 packet.lat_int = lat_int;
189 packet.lon_int = lon_int;
190
191 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
192#endif
193
194 msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
195 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
196}
197
198/**
199 * @brief Pack a sim_state message
200 * @param system_id ID of this system
201 * @param component_id ID of this component (e.g. 200 for IMU)
202 * @param status MAVLink status structure
203 * @param msg The MAVLink message to compress the data into
204 *
205 * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
206 * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
207 * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
208 * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
209 * @param roll [rad] Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
210 * @param pitch [rad] Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
211 * @param yaw [rad] Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
212 * @param xacc [m/s/s] X acceleration
213 * @param yacc [m/s/s] Y acceleration
214 * @param zacc [m/s/s] Z acceleration
215 * @param xgyro [rad/s] Angular speed around X axis
216 * @param ygyro [rad/s] Angular speed around Y axis
217 * @param zgyro [rad/s] Angular speed around Z axis
218 * @param lat [deg] Latitude (lower precision). Both this and the lat_int field should be set.
219 * @param lon [deg] Longitude (lower precision). Both this and the lon_int field should be set.
220 * @param alt [m] Altitude
221 * @param std_dev_horz Horizontal position standard deviation
222 * @param std_dev_vert Vertical position standard deviation
223 * @param vn [m/s] True velocity in north direction in earth-fixed NED frame
224 * @param ve [m/s] True velocity in east direction in earth-fixed NED frame
225 * @param vd [m/s] True velocity in down direction in earth-fixed NED frame
226 * @param lat_int [degE7] Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).
227 * @param lon_int [degE7] Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).
228 * @return length of the message in bytes (excluding serial stream start sign)
229 */
230static inline uint16_t mavlink_msg_sim_state_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
231 float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd, int32_t lat_int, int32_t lon_int)
232{
233#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
235 _mav_put_float(buf, 0, q1);
236 _mav_put_float(buf, 4, q2);
237 _mav_put_float(buf, 8, q3);
238 _mav_put_float(buf, 12, q4);
239 _mav_put_float(buf, 16, roll);
240 _mav_put_float(buf, 20, pitch);
241 _mav_put_float(buf, 24, yaw);
242 _mav_put_float(buf, 28, xacc);
243 _mav_put_float(buf, 32, yacc);
244 _mav_put_float(buf, 36, zacc);
245 _mav_put_float(buf, 40, xgyro);
246 _mav_put_float(buf, 44, ygyro);
247 _mav_put_float(buf, 48, zgyro);
248 _mav_put_float(buf, 52, lat);
249 _mav_put_float(buf, 56, lon);
250 _mav_put_float(buf, 60, alt);
251 _mav_put_float(buf, 64, std_dev_horz);
252 _mav_put_float(buf, 68, std_dev_vert);
253 _mav_put_float(buf, 72, vn);
254 _mav_put_float(buf, 76, ve);
255 _mav_put_float(buf, 80, vd);
256 _mav_put_int32_t(buf, 84, lat_int);
257 _mav_put_int32_t(buf, 88, lon_int);
258
259 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
260#else
261 mavlink_sim_state_t packet;
262 packet.q1 = q1;
263 packet.q2 = q2;
264 packet.q3 = q3;
265 packet.q4 = q4;
266 packet.roll = roll;
267 packet.pitch = pitch;
268 packet.yaw = yaw;
269 packet.xacc = xacc;
270 packet.yacc = yacc;
271 packet.zacc = zacc;
272 packet.xgyro = xgyro;
273 packet.ygyro = ygyro;
274 packet.zgyro = zgyro;
275 packet.lat = lat;
276 packet.lon = lon;
277 packet.alt = alt;
278 packet.std_dev_horz = std_dev_horz;
279 packet.std_dev_vert = std_dev_vert;
280 packet.vn = vn;
281 packet.ve = ve;
282 packet.vd = vd;
283 packet.lat_int = lat_int;
284 packet.lon_int = lon_int;
285
286 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
287#endif
288
289 msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
290#if MAVLINK_CRC_EXTRA
291 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
292#else
293 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN);
294#endif
295}
296
297/**
298 * @brief Pack a sim_state message on a channel
299 * @param system_id ID of this system
300 * @param component_id ID of this component (e.g. 200 for IMU)
301 * @param chan The MAVLink channel this message will be sent over
302 * @param msg The MAVLink message to compress the data into
303 * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
304 * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
305 * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
306 * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
307 * @param roll [rad] Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
308 * @param pitch [rad] Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
309 * @param yaw [rad] Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
310 * @param xacc [m/s/s] X acceleration
311 * @param yacc [m/s/s] Y acceleration
312 * @param zacc [m/s/s] Z acceleration
313 * @param xgyro [rad/s] Angular speed around X axis
314 * @param ygyro [rad/s] Angular speed around Y axis
315 * @param zgyro [rad/s] Angular speed around Z axis
316 * @param lat [deg] Latitude (lower precision). Both this and the lat_int field should be set.
317 * @param lon [deg] Longitude (lower precision). Both this and the lon_int field should be set.
318 * @param alt [m] Altitude
319 * @param std_dev_horz Horizontal position standard deviation
320 * @param std_dev_vert Vertical position standard deviation
321 * @param vn [m/s] True velocity in north direction in earth-fixed NED frame
322 * @param ve [m/s] True velocity in east direction in earth-fixed NED frame
323 * @param vd [m/s] True velocity in down direction in earth-fixed NED frame
324 * @param lat_int [degE7] Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).
325 * @param lon_int [degE7] Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).
326 * @return length of the message in bytes (excluding serial stream start sign)
327 */
328static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
329 mavlink_message_t* msg,
330 float q1,float q2,float q3,float q4,float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lon,float alt,float std_dev_horz,float std_dev_vert,float vn,float ve,float vd,int32_t lat_int,int32_t lon_int)
331{
332#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
334 _mav_put_float(buf, 0, q1);
335 _mav_put_float(buf, 4, q2);
336 _mav_put_float(buf, 8, q3);
337 _mav_put_float(buf, 12, q4);
338 _mav_put_float(buf, 16, roll);
339 _mav_put_float(buf, 20, pitch);
340 _mav_put_float(buf, 24, yaw);
341 _mav_put_float(buf, 28, xacc);
342 _mav_put_float(buf, 32, yacc);
343 _mav_put_float(buf, 36, zacc);
344 _mav_put_float(buf, 40, xgyro);
345 _mav_put_float(buf, 44, ygyro);
346 _mav_put_float(buf, 48, zgyro);
347 _mav_put_float(buf, 52, lat);
348 _mav_put_float(buf, 56, lon);
349 _mav_put_float(buf, 60, alt);
350 _mav_put_float(buf, 64, std_dev_horz);
351 _mav_put_float(buf, 68, std_dev_vert);
352 _mav_put_float(buf, 72, vn);
353 _mav_put_float(buf, 76, ve);
354 _mav_put_float(buf, 80, vd);
355 _mav_put_int32_t(buf, 84, lat_int);
356 _mav_put_int32_t(buf, 88, lon_int);
357
358 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
359#else
360 mavlink_sim_state_t packet;
361 packet.q1 = q1;
362 packet.q2 = q2;
363 packet.q3 = q3;
364 packet.q4 = q4;
365 packet.roll = roll;
366 packet.pitch = pitch;
367 packet.yaw = yaw;
368 packet.xacc = xacc;
369 packet.yacc = yacc;
370 packet.zacc = zacc;
371 packet.xgyro = xgyro;
372 packet.ygyro = ygyro;
373 packet.zgyro = zgyro;
374 packet.lat = lat;
375 packet.lon = lon;
376 packet.alt = alt;
377 packet.std_dev_horz = std_dev_horz;
378 packet.std_dev_vert = std_dev_vert;
379 packet.vn = vn;
380 packet.ve = ve;
381 packet.vd = vd;
382 packet.lat_int = lat_int;
383 packet.lon_int = lon_int;
384
385 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
386#endif
387
388 msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
389 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
390}
391
392/**
393 * @brief Encode a sim_state struct
394 *
395 * @param system_id ID of this system
396 * @param component_id ID of this component (e.g. 200 for IMU)
397 * @param msg The MAVLink message to compress the data into
398 * @param sim_state C-struct to read the message contents from
399 */
400static inline uint16_t mavlink_msg_sim_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state)
401{
402 return mavlink_msg_sim_state_pack(system_id, component_id, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd, sim_state->lat_int, sim_state->lon_int);
403}
404
405/**
406 * @brief Encode a sim_state struct on a channel
407 *
408 * @param system_id ID of this system
409 * @param component_id ID of this component (e.g. 200 for IMU)
410 * @param chan The MAVLink channel this message will be sent over
411 * @param msg The MAVLink message to compress the data into
412 * @param sim_state C-struct to read the message contents from
413 */
414static inline uint16_t mavlink_msg_sim_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state)
415{
416 return mavlink_msg_sim_state_pack_chan(system_id, component_id, chan, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd, sim_state->lat_int, sim_state->lon_int);
417}
418
419/**
420 * @brief Encode a sim_state struct with provided status structure
421 *
422 * @param system_id ID of this system
423 * @param component_id ID of this component (e.g. 200 for IMU)
424 * @param status MAVLink status structure
425 * @param msg The MAVLink message to compress the data into
426 * @param sim_state C-struct to read the message contents from
427 */
428static inline uint16_t mavlink_msg_sim_state_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state)
429{
430 return mavlink_msg_sim_state_pack_status(system_id, component_id, _status, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd, sim_state->lat_int, sim_state->lon_int);
431}
432
433/**
434 * @brief Send a sim_state message
435 * @param chan MAVLink channel to send the message
436 *
437 * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
438 * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
439 * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
440 * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
441 * @param roll [rad] Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
442 * @param pitch [rad] Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
443 * @param yaw [rad] Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
444 * @param xacc [m/s/s] X acceleration
445 * @param yacc [m/s/s] Y acceleration
446 * @param zacc [m/s/s] Z acceleration
447 * @param xgyro [rad/s] Angular speed around X axis
448 * @param ygyro [rad/s] Angular speed around Y axis
449 * @param zgyro [rad/s] Angular speed around Z axis
450 * @param lat [deg] Latitude (lower precision). Both this and the lat_int field should be set.
451 * @param lon [deg] Longitude (lower precision). Both this and the lon_int field should be set.
452 * @param alt [m] Altitude
453 * @param std_dev_horz Horizontal position standard deviation
454 * @param std_dev_vert Vertical position standard deviation
455 * @param vn [m/s] True velocity in north direction in earth-fixed NED frame
456 * @param ve [m/s] True velocity in east direction in earth-fixed NED frame
457 * @param vd [m/s] True velocity in down direction in earth-fixed NED frame
458 * @param lat_int [degE7] Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).
459 * @param lon_int [degE7] Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).
460 */
461#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
462
463static inline void mavlink_msg_sim_state_send(mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd, int32_t lat_int, int32_t lon_int)
464{
465#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
466 char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
467 _mav_put_float(buf, 0, q1);
468 _mav_put_float(buf, 4, q2);
469 _mav_put_float(buf, 8, q3);
470 _mav_put_float(buf, 12, q4);
471 _mav_put_float(buf, 16, roll);
472 _mav_put_float(buf, 20, pitch);
473 _mav_put_float(buf, 24, yaw);
474 _mav_put_float(buf, 28, xacc);
475 _mav_put_float(buf, 32, yacc);
476 _mav_put_float(buf, 36, zacc);
477 _mav_put_float(buf, 40, xgyro);
478 _mav_put_float(buf, 44, ygyro);
479 _mav_put_float(buf, 48, zgyro);
480 _mav_put_float(buf, 52, lat);
481 _mav_put_float(buf, 56, lon);
482 _mav_put_float(buf, 60, alt);
483 _mav_put_float(buf, 64, std_dev_horz);
484 _mav_put_float(buf, 68, std_dev_vert);
485 _mav_put_float(buf, 72, vn);
486 _mav_put_float(buf, 76, ve);
487 _mav_put_float(buf, 80, vd);
488 _mav_put_int32_t(buf, 84, lat_int);
489 _mav_put_int32_t(buf, 88, lon_int);
490
491 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
492#else
493 mavlink_sim_state_t packet;
494 packet.q1 = q1;
495 packet.q2 = q2;
496 packet.q3 = q3;
497 packet.q4 = q4;
498 packet.roll = roll;
499 packet.pitch = pitch;
500 packet.yaw = yaw;
501 packet.xacc = xacc;
502 packet.yacc = yacc;
503 packet.zacc = zacc;
504 packet.xgyro = xgyro;
505 packet.ygyro = ygyro;
506 packet.zgyro = zgyro;
507 packet.lat = lat;
508 packet.lon = lon;
509 packet.alt = alt;
510 packet.std_dev_horz = std_dev_horz;
511 packet.std_dev_vert = std_dev_vert;
512 packet.vn = vn;
513 packet.ve = ve;
514 packet.vd = vd;
515 packet.lat_int = lat_int;
516 packet.lon_int = lon_int;
517
518 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
519#endif
520}
521
522/**
523 * @brief Send a sim_state message
524 * @param chan MAVLink channel to send the message
525 * @param struct The MAVLink struct to serialize
526 */
527static inline void mavlink_msg_sim_state_send_struct(mavlink_channel_t chan, const mavlink_sim_state_t* sim_state)
528{
529#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
530 mavlink_msg_sim_state_send(chan, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd, sim_state->lat_int, sim_state->lon_int);
531#else
532 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)sim_state, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
533#endif
534}
535
536#if MAVLINK_MSG_ID_SIM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
537/*
538 This variant of _send() can be used to save stack space by reusing
539 memory from the receive buffer. The caller provides a
540 mavlink_message_t which is the size of a full mavlink message. This
541 is usually the receive buffer for the channel, and allows a reply to an
542 incoming message with minimum stack space usage.
543 */
544static inline void mavlink_msg_sim_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd, int32_t lat_int, int32_t lon_int)
545{
546#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
547 char *buf = (char *)msgbuf;
548 _mav_put_float(buf, 0, q1);
549 _mav_put_float(buf, 4, q2);
550 _mav_put_float(buf, 8, q3);
551 _mav_put_float(buf, 12, q4);
552 _mav_put_float(buf, 16, roll);
553 _mav_put_float(buf, 20, pitch);
554 _mav_put_float(buf, 24, yaw);
555 _mav_put_float(buf, 28, xacc);
556 _mav_put_float(buf, 32, yacc);
557 _mav_put_float(buf, 36, zacc);
558 _mav_put_float(buf, 40, xgyro);
559 _mav_put_float(buf, 44, ygyro);
560 _mav_put_float(buf, 48, zgyro);
561 _mav_put_float(buf, 52, lat);
562 _mav_put_float(buf, 56, lon);
563 _mav_put_float(buf, 60, alt);
564 _mav_put_float(buf, 64, std_dev_horz);
565 _mav_put_float(buf, 68, std_dev_vert);
566 _mav_put_float(buf, 72, vn);
567 _mav_put_float(buf, 76, ve);
568 _mav_put_float(buf, 80, vd);
569 _mav_put_int32_t(buf, 84, lat_int);
570 _mav_put_int32_t(buf, 88, lon_int);
571
572 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
573#else
574 mavlink_sim_state_t *packet = (mavlink_sim_state_t *)msgbuf;
575 packet->q1 = q1;
576 packet->q2 = q2;
577 packet->q3 = q3;
578 packet->q4 = q4;
579 packet->roll = roll;
580 packet->pitch = pitch;
581 packet->yaw = yaw;
582 packet->xacc = xacc;
583 packet->yacc = yacc;
584 packet->zacc = zacc;
585 packet->xgyro = xgyro;
586 packet->ygyro = ygyro;
587 packet->zgyro = zgyro;
588 packet->lat = lat;
589 packet->lon = lon;
590 packet->alt = alt;
591 packet->std_dev_horz = std_dev_horz;
592 packet->std_dev_vert = std_dev_vert;
593 packet->vn = vn;
594 packet->ve = ve;
595 packet->vd = vd;
596 packet->lat_int = lat_int;
597 packet->lon_int = lon_int;
598
599 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
600#endif
601}
602#endif
603
604#endif
605
606// MESSAGE SIM_STATE UNPACKING
607
608
609/**
610 * @brief Get field q1 from sim_state message
611 *
612 * @return True attitude quaternion component 1, w (1 in null-rotation)
613 */
614static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg)
615{
616 return _MAV_RETURN_float(msg, 0);
617}
618
619/**
620 * @brief Get field q2 from sim_state message
621 *
622 * @return True attitude quaternion component 2, x (0 in null-rotation)
623 */
624static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg)
625{
626 return _MAV_RETURN_float(msg, 4);
627}
628
629/**
630 * @brief Get field q3 from sim_state message
631 *
632 * @return True attitude quaternion component 3, y (0 in null-rotation)
633 */
634static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg)
635{
636 return _MAV_RETURN_float(msg, 8);
637}
638
639/**
640 * @brief Get field q4 from sim_state message
641 *
642 * @return True attitude quaternion component 4, z (0 in null-rotation)
643 */
644static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg)
645{
646 return _MAV_RETURN_float(msg, 12);
647}
648
649/**
650 * @brief Get field roll from sim_state message
651 *
652 * @return [rad] Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
653 */
654static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg)
655{
656 return _MAV_RETURN_float(msg, 16);
657}
658
659/**
660 * @brief Get field pitch from sim_state message
661 *
662 * @return [rad] Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
663 */
664static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg)
665{
666 return _MAV_RETURN_float(msg, 20);
667}
668
669/**
670 * @brief Get field yaw from sim_state message
671 *
672 * @return [rad] Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
673 */
674static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg)
675{
676 return _MAV_RETURN_float(msg, 24);
677}
678
679/**
680 * @brief Get field xacc from sim_state message
681 *
682 * @return [m/s/s] X acceleration
683 */
684static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg)
685{
686 return _MAV_RETURN_float(msg, 28);
687}
688
689/**
690 * @brief Get field yacc from sim_state message
691 *
692 * @return [m/s/s] Y acceleration
693 */
694static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg)
695{
696 return _MAV_RETURN_float(msg, 32);
697}
698
699/**
700 * @brief Get field zacc from sim_state message
701 *
702 * @return [m/s/s] Z acceleration
703 */
704static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg)
705{
706 return _MAV_RETURN_float(msg, 36);
707}
708
709/**
710 * @brief Get field xgyro from sim_state message
711 *
712 * @return [rad/s] Angular speed around X axis
713 */
714static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg)
715{
716 return _MAV_RETURN_float(msg, 40);
717}
718
719/**
720 * @brief Get field ygyro from sim_state message
721 *
722 * @return [rad/s] Angular speed around Y axis
723 */
724static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg)
725{
726 return _MAV_RETURN_float(msg, 44);
727}
728
729/**
730 * @brief Get field zgyro from sim_state message
731 *
732 * @return [rad/s] Angular speed around Z axis
733 */
734static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg)
735{
736 return _MAV_RETURN_float(msg, 48);
737}
738
739/**
740 * @brief Get field lat from sim_state message
741 *
742 * @return [deg] Latitude (lower precision). Both this and the lat_int field should be set.
743 */
744static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg)
745{
746 return _MAV_RETURN_float(msg, 52);
747}
748
749/**
750 * @brief Get field lon from sim_state message
751 *
752 * @return [deg] Longitude (lower precision). Both this and the lon_int field should be set.
753 */
754static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg)
755{
756 return _MAV_RETURN_float(msg, 56);
757}
758
759/**
760 * @brief Get field alt from sim_state message
761 *
762 * @return [m] Altitude
763 */
764static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg)
765{
766 return _MAV_RETURN_float(msg, 60);
767}
768
769/**
770 * @brief Get field std_dev_horz from sim_state message
771 *
772 * @return Horizontal position standard deviation
773 */
774static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message_t* msg)
775{
776 return _MAV_RETURN_float(msg, 64);
777}
778
779/**
780 * @brief Get field std_dev_vert from sim_state message
781 *
782 * @return Vertical position standard deviation
783 */
784static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message_t* msg)
785{
786 return _MAV_RETURN_float(msg, 68);
787}
788
789/**
790 * @brief Get field vn from sim_state message
791 *
792 * @return [m/s] True velocity in north direction in earth-fixed NED frame
793 */
794static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg)
795{
796 return _MAV_RETURN_float(msg, 72);
797}
798
799/**
800 * @brief Get field ve from sim_state message
801 *
802 * @return [m/s] True velocity in east direction in earth-fixed NED frame
803 */
804static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg)
805{
806 return _MAV_RETURN_float(msg, 76);
807}
808
809/**
810 * @brief Get field vd from sim_state message
811 *
812 * @return [m/s] True velocity in down direction in earth-fixed NED frame
813 */
814static inline float mavlink_msg_sim_state_get_vd(const mavlink_message_t* msg)
815{
816 return _MAV_RETURN_float(msg, 80);
817}
818
819/**
820 * @brief Get field lat_int from sim_state message
821 *
822 * @return [degE7] Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).
823 */
824static inline int32_t mavlink_msg_sim_state_get_lat_int(const mavlink_message_t* msg)
825{
826 return _MAV_RETURN_int32_t(msg, 84);
827}
828
829/**
830 * @brief Get field lon_int from sim_state message
831 *
832 * @return [degE7] Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).
833 */
834static inline int32_t mavlink_msg_sim_state_get_lon_int(const mavlink_message_t* msg)
835{
836 return _MAV_RETURN_int32_t(msg, 88);
837}
838
839/**
840 * @brief Decode a sim_state message into a struct
841 *
842 * @param msg The message to decode
843 * @param sim_state C-struct to decode the message contents into
844 */
845static inline void mavlink_msg_sim_state_decode(const mavlink_message_t* msg, mavlink_sim_state_t* sim_state)
846{
847#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
848 sim_state->q1 = mavlink_msg_sim_state_get_q1(msg);
849 sim_state->q2 = mavlink_msg_sim_state_get_q2(msg);
850 sim_state->q3 = mavlink_msg_sim_state_get_q3(msg);
851 sim_state->q4 = mavlink_msg_sim_state_get_q4(msg);
852 sim_state->roll = mavlink_msg_sim_state_get_roll(msg);
853 sim_state->pitch = mavlink_msg_sim_state_get_pitch(msg);
854 sim_state->yaw = mavlink_msg_sim_state_get_yaw(msg);
855 sim_state->xacc = mavlink_msg_sim_state_get_xacc(msg);
856 sim_state->yacc = mavlink_msg_sim_state_get_yacc(msg);
857 sim_state->zacc = mavlink_msg_sim_state_get_zacc(msg);
858 sim_state->xgyro = mavlink_msg_sim_state_get_xgyro(msg);
859 sim_state->ygyro = mavlink_msg_sim_state_get_ygyro(msg);
860 sim_state->zgyro = mavlink_msg_sim_state_get_zgyro(msg);
861 sim_state->lat = mavlink_msg_sim_state_get_lat(msg);
862 sim_state->lon = mavlink_msg_sim_state_get_lon(msg);
863 sim_state->alt = mavlink_msg_sim_state_get_alt(msg);
864 sim_state->std_dev_horz = mavlink_msg_sim_state_get_std_dev_horz(msg);
865 sim_state->std_dev_vert = mavlink_msg_sim_state_get_std_dev_vert(msg);
866 sim_state->vn = mavlink_msg_sim_state_get_vn(msg);
867 sim_state->ve = mavlink_msg_sim_state_get_ve(msg);
868 sim_state->vd = mavlink_msg_sim_state_get_vd(msg);
869 sim_state->lat_int = mavlink_msg_sim_state_get_lat_int(msg);
870 sim_state->lon_int = mavlink_msg_sim_state_get_lon_int(msg);
871#else
872 uint8_t len = msg->len < MAVLINK_MSG_ID_SIM_STATE_LEN? msg->len : MAVLINK_MSG_ID_SIM_STATE_LEN;
873 memset(sim_state, 0, MAVLINK_MSG_ID_SIM_STATE_LEN);
874 memcpy(sim_state, _MAV_PAYLOAD(msg), len);
875#endif
876}