3 #define MAVLINK_MSG_ID_SIM_STATE 108
30 #define MAVLINK_MSG_ID_SIM_STATE_LEN 84
31 #define MAVLINK_MSG_ID_108_LEN 84
33 #define MAVLINK_MSG_ID_SIM_STATE_CRC 32
34 #define MAVLINK_MSG_ID_108_CRC 32
38 #define MAVLINK_MESSAGE_INFO_SIM_STATE { \
41 { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \
42 { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) }, \
43 { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) }, \
44 { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) }, \
45 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) }, \
46 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) }, \
47 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) }, \
48 { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) }, \
49 { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) }, \
50 { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) }, \
51 { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) }, \
52 { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) }, \
53 { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) }, \
54 { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) }, \
55 { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) }, \
56 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) }, \
57 { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) }, \
58 { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) }, \
59 { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) }, \
60 { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) }, \
61 { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) }, \
95 static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
96 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)
98 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
99 char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
100 _mav_put_float(buf, 0, q1);
101 _mav_put_float(buf, 4, q2);
102 _mav_put_float(buf, 8, q3);
103 _mav_put_float(buf, 12, q4);
104 _mav_put_float(buf, 16, roll);
105 _mav_put_float(buf, 20, pitch);
106 _mav_put_float(buf, 24, yaw);
107 _mav_put_float(buf, 28, xacc);
108 _mav_put_float(buf, 32, yacc);
109 _mav_put_float(buf, 36, zacc);
110 _mav_put_float(buf, 40, xgyro);
111 _mav_put_float(buf, 44, ygyro);
112 _mav_put_float(buf, 48, zgyro);
113 _mav_put_float(buf, 52, lat);
114 _mav_put_float(buf, 56, lon);
115 _mav_put_float(buf, 60, alt);
116 _mav_put_float(buf, 64, std_dev_horz);
117 _mav_put_float(buf, 68, std_dev_vert);
118 _mav_put_float(buf, 72, vn);
119 _mav_put_float(buf, 76, ve);
120 _mav_put_float(buf, 80, vd);
122 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
130 packet.
pitch = pitch;
135 packet.
xgyro = xgyro;
136 packet.
ygyro = ygyro;
137 packet.
zgyro = zgyro;
147 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
150 msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
151 #if MAVLINK_CRC_EXTRA
152 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
154 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_LEN);
187 static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
188 mavlink_message_t* msg,
189 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)
191 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
192 char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
193 _mav_put_float(buf, 0, q1);
194 _mav_put_float(buf, 4, q2);
195 _mav_put_float(buf, 8, q3);
196 _mav_put_float(buf, 12, q4);
197 _mav_put_float(buf, 16, roll);
198 _mav_put_float(buf, 20, pitch);
199 _mav_put_float(buf, 24, yaw);
200 _mav_put_float(buf, 28, xacc);
201 _mav_put_float(buf, 32, yacc);
202 _mav_put_float(buf, 36, zacc);
203 _mav_put_float(buf, 40, xgyro);
204 _mav_put_float(buf, 44, ygyro);
205 _mav_put_float(buf, 48, zgyro);
206 _mav_put_float(buf, 52, lat);
207 _mav_put_float(buf, 56, lon);
208 _mav_put_float(buf, 60, alt);
209 _mav_put_float(buf, 64, std_dev_horz);
210 _mav_put_float(buf, 68, std_dev_vert);
211 _mav_put_float(buf, 72, vn);
212 _mav_put_float(buf, 76, ve);
213 _mav_put_float(buf, 80, vd);
215 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
223 packet.
pitch = pitch;
228 packet.
xgyro = xgyro;
229 packet.
ygyro = ygyro;
230 packet.
zgyro = zgyro;
240 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
243 msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
244 #if MAVLINK_CRC_EXTRA
245 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
247 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_LEN);
259 static 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)
261 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);
273 static 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)
275 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);
304 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
306 static 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)
308 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
309 char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
310 _mav_put_float(buf, 0, q1);
311 _mav_put_float(buf, 4, q2);
312 _mav_put_float(buf, 8, q3);
313 _mav_put_float(buf, 12, q4);
314 _mav_put_float(buf, 16, roll);
315 _mav_put_float(buf, 20, pitch);
316 _mav_put_float(buf, 24, yaw);
317 _mav_put_float(buf, 28, xacc);
318 _mav_put_float(buf, 32, yacc);
319 _mav_put_float(buf, 36, zacc);
320 _mav_put_float(buf, 40, xgyro);
321 _mav_put_float(buf, 44, ygyro);
322 _mav_put_float(buf, 48, zgyro);
323 _mav_put_float(buf, 52, lat);
324 _mav_put_float(buf, 56, lon);
325 _mav_put_float(buf, 60, alt);
326 _mav_put_float(buf, 64, std_dev_horz);
327 _mav_put_float(buf, 68, std_dev_vert);
328 _mav_put_float(buf, 72, vn);
329 _mav_put_float(buf, 76, ve);
330 _mav_put_float(buf, 80, vd);
332 #if MAVLINK_CRC_EXTRA
333 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
335 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
344 packet.
pitch = pitch;
349 packet.
xgyro = xgyro;
350 packet.
ygyro = ygyro;
351 packet.
zgyro = zgyro;
361 #if MAVLINK_CRC_EXTRA
362 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (
const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
364 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (
const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
369 #if MAVLINK_MSG_ID_SIM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
377 static 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)
379 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
380 char *buf = (
char *)msgbuf;
381 _mav_put_float(buf, 0, q1);
382 _mav_put_float(buf, 4, q2);
383 _mav_put_float(buf, 8, q3);
384 _mav_put_float(buf, 12, q4);
385 _mav_put_float(buf, 16, roll);
386 _mav_put_float(buf, 20, pitch);
387 _mav_put_float(buf, 24, yaw);
388 _mav_put_float(buf, 28, xacc);
389 _mav_put_float(buf, 32, yacc);
390 _mav_put_float(buf, 36, zacc);
391 _mav_put_float(buf, 40, xgyro);
392 _mav_put_float(buf, 44, ygyro);
393 _mav_put_float(buf, 48, zgyro);
394 _mav_put_float(buf, 52, lat);
395 _mav_put_float(buf, 56, lon);
396 _mav_put_float(buf, 60, alt);
397 _mav_put_float(buf, 64, std_dev_horz);
398 _mav_put_float(buf, 68, std_dev_vert);
399 _mav_put_float(buf, 72, vn);
400 _mav_put_float(buf, 76, ve);
401 _mav_put_float(buf, 80, vd);
403 #if MAVLINK_CRC_EXTRA
404 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
406 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
415 packet->
pitch = pitch;
420 packet->
xgyro = xgyro;
421 packet->
ygyro = ygyro;
422 packet->
zgyro = zgyro;
432 #if MAVLINK_CRC_EXTRA
433 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (
const char *)packet, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
435 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (
const char *)packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
451 static inline float mavlink_msg_sim_state_get_q1(
const mavlink_message_t* msg)
453 return _MAV_RETURN_float(msg, 0);
461 static inline float mavlink_msg_sim_state_get_q2(
const mavlink_message_t* msg)
463 return _MAV_RETURN_float(msg, 4);
471 static inline float mavlink_msg_sim_state_get_q3(
const mavlink_message_t* msg)
473 return _MAV_RETURN_float(msg, 8);
481 static inline float mavlink_msg_sim_state_get_q4(
const mavlink_message_t* msg)
483 return _MAV_RETURN_float(msg, 12);
491 static inline float mavlink_msg_sim_state_get_roll(
const mavlink_message_t* msg)
493 return _MAV_RETURN_float(msg, 16);
501 static inline float mavlink_msg_sim_state_get_pitch(
const mavlink_message_t* msg)
503 return _MAV_RETURN_float(msg, 20);
511 static inline float mavlink_msg_sim_state_get_yaw(
const mavlink_message_t* msg)
513 return _MAV_RETURN_float(msg, 24);
521 static inline float mavlink_msg_sim_state_get_xacc(
const mavlink_message_t* msg)
523 return _MAV_RETURN_float(msg, 28);
531 static inline float mavlink_msg_sim_state_get_yacc(
const mavlink_message_t* msg)
533 return _MAV_RETURN_float(msg, 32);
541 static inline float mavlink_msg_sim_state_get_zacc(
const mavlink_message_t* msg)
543 return _MAV_RETURN_float(msg, 36);
551 static inline float mavlink_msg_sim_state_get_xgyro(
const mavlink_message_t* msg)
553 return _MAV_RETURN_float(msg, 40);
561 static inline float mavlink_msg_sim_state_get_ygyro(
const mavlink_message_t* msg)
563 return _MAV_RETURN_float(msg, 44);
571 static inline float mavlink_msg_sim_state_get_zgyro(
const mavlink_message_t* msg)
573 return _MAV_RETURN_float(msg, 48);
581 static inline float mavlink_msg_sim_state_get_lat(
const mavlink_message_t* msg)
583 return _MAV_RETURN_float(msg, 52);
591 static inline float mavlink_msg_sim_state_get_lon(
const mavlink_message_t* msg)
593 return _MAV_RETURN_float(msg, 56);
601 static inline float mavlink_msg_sim_state_get_alt(
const mavlink_message_t* msg)
603 return _MAV_RETURN_float(msg, 60);
611 static inline float mavlink_msg_sim_state_get_std_dev_horz(
const mavlink_message_t* msg)
613 return _MAV_RETURN_float(msg, 64);
621 static inline float mavlink_msg_sim_state_get_std_dev_vert(
const mavlink_message_t* msg)
623 return _MAV_RETURN_float(msg, 68);
631 static inline float mavlink_msg_sim_state_get_vn(
const mavlink_message_t* msg)
633 return _MAV_RETURN_float(msg, 72);
641 static inline float mavlink_msg_sim_state_get_ve(
const mavlink_message_t* msg)
643 return _MAV_RETURN_float(msg, 76);
651 static inline float mavlink_msg_sim_state_get_vd(
const mavlink_message_t* msg)
653 return _MAV_RETURN_float(msg, 80);
662 static inline void mavlink_msg_sim_state_decode(
const mavlink_message_t* msg,
mavlink_sim_state_t* sim_state)
664 #if MAVLINK_NEED_BYTE_SWAP
665 sim_state->
q1 = mavlink_msg_sim_state_get_q1(msg);
666 sim_state->
q2 = mavlink_msg_sim_state_get_q2(msg);
667 sim_state->
q3 = mavlink_msg_sim_state_get_q3(msg);
668 sim_state->
q4 = mavlink_msg_sim_state_get_q4(msg);
669 sim_state->
roll = mavlink_msg_sim_state_get_roll(msg);
670 sim_state->
pitch = mavlink_msg_sim_state_get_pitch(msg);
671 sim_state->
yaw = mavlink_msg_sim_state_get_yaw(msg);
672 sim_state->
xacc = mavlink_msg_sim_state_get_xacc(msg);
673 sim_state->
yacc = mavlink_msg_sim_state_get_yacc(msg);
674 sim_state->
zacc = mavlink_msg_sim_state_get_zacc(msg);
675 sim_state->
xgyro = mavlink_msg_sim_state_get_xgyro(msg);
676 sim_state->
ygyro = mavlink_msg_sim_state_get_ygyro(msg);
677 sim_state->
zgyro = mavlink_msg_sim_state_get_zgyro(msg);
678 sim_state->
lat = mavlink_msg_sim_state_get_lat(msg);
679 sim_state->
lon = mavlink_msg_sim_state_get_lon(msg);
680 sim_state->
alt = mavlink_msg_sim_state_get_alt(msg);
681 sim_state->
std_dev_horz = mavlink_msg_sim_state_get_std_dev_horz(msg);
682 sim_state->
std_dev_vert = mavlink_msg_sim_state_get_std_dev_vert(msg);
683 sim_state->
vn = mavlink_msg_sim_state_get_vn(msg);
684 sim_state->
ve = mavlink_msg_sim_state_get_ve(msg);
685 sim_state->
vd = mavlink_msg_sim_state_get_vd(msg);
687 memcpy(sim_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SIM_STATE_LEN);
float alt
Altitude in meters.
Definition: mavlink_msg_sim_state.h:22
float q2
True attitude quaternion component 2, x (0 in null-rotation)
Definition: mavlink_msg_sim_state.h:8
float roll
Attitude roll expressed as Euler angles, not recommended except for human-readable outputs...
Definition: mavlink_msg_sim_state.h:11
float std_dev_horz
Horizontal position standard deviation.
Definition: mavlink_msg_sim_state.h:23
float xgyro
Angular speed around X axis rad/s.
Definition: mavlink_msg_sim_state.h:17
float q4
True attitude quaternion component 4, z (0 in null-rotation)
Definition: mavlink_msg_sim_state.h:10
float lon
Longitude in degrees.
Definition: mavlink_msg_sim_state.h:21
float lat
Latitude in degrees.
Definition: mavlink_msg_sim_state.h:20
float std_dev_vert
Vertical position standard deviation.
Definition: mavlink_msg_sim_state.h:24
float ve
True velocity in m/s in EAST direction in earth-fixed NED frame.
Definition: mavlink_msg_sim_state.h:26
float q3
True attitude quaternion component 3, y (0 in null-rotation)
Definition: mavlink_msg_sim_state.h:9
float pitch
Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs...
Definition: mavlink_msg_sim_state.h:12
float vd
True velocity in m/s in DOWN direction in earth-fixed NED frame.
Definition: mavlink_msg_sim_state.h:27
float yacc
Y acceleration m/s/s.
Definition: mavlink_msg_sim_state.h:15
float zacc
Z acceleration m/s/s.
Definition: mavlink_msg_sim_state.h:16
float yaw
Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs...
Definition: mavlink_msg_sim_state.h:13
float vn
True velocity in m/s in NORTH direction in earth-fixed NED frame.
Definition: mavlink_msg_sim_state.h:25
float zgyro
Angular speed around Z axis rad/s.
Definition: mavlink_msg_sim_state.h:19
float xacc
X acceleration m/s/s.
Definition: mavlink_msg_sim_state.h:14
float ygyro
Angular speed around Y axis rad/s.
Definition: mavlink_msg_sim_state.h:18
float q1
True attitude quaternion component 1, w (1 in null-rotation)
Definition: mavlink_msg_sim_state.h:7
Definition: mavlink_msg_sim_state.h:5