Bump clang version to 18 (#14116)
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_hil_state.h
blob923ed60b955f48348bf57ab8e90029c435a3d2bf
1 // MESSAGE HIL_STATE PACKING
3 #define MAVLINK_MSG_ID_HIL_STATE 90
5 typedef struct __mavlink_hil_state_t
7 uint64_t time_usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
8 float roll; ///< Roll angle (rad)
9 float pitch; ///< Pitch angle (rad)
10 float yaw; ///< Yaw angle (rad)
11 float rollspeed; ///< Body frame roll / phi angular speed (rad/s)
12 float pitchspeed; ///< Body frame pitch / theta angular speed (rad/s)
13 float yawspeed; ///< Body frame yaw / psi angular speed (rad/s)
14 int32_t lat; ///< Latitude, expressed as * 1E7
15 int32_t lon; ///< Longitude, expressed as * 1E7
16 int32_t alt; ///< Altitude in meters, expressed as * 1000 (millimeters)
17 int16_t vx; ///< Ground X Speed (Latitude), expressed as m/s * 100
18 int16_t vy; ///< Ground Y Speed (Longitude), expressed as m/s * 100
19 int16_t vz; ///< Ground Z Speed (Altitude), expressed as m/s * 100
20 int16_t xacc; ///< X acceleration (mg)
21 int16_t yacc; ///< Y acceleration (mg)
22 int16_t zacc; ///< Z acceleration (mg)
23 } mavlink_hil_state_t;
25 #define MAVLINK_MSG_ID_HIL_STATE_LEN 56
26 #define MAVLINK_MSG_ID_90_LEN 56
28 #define MAVLINK_MSG_ID_HIL_STATE_CRC 183
29 #define MAVLINK_MSG_ID_90_CRC 183
33 #define MAVLINK_MESSAGE_INFO_HIL_STATE { \
34 "HIL_STATE", \
35 16, \
36 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \
37 { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \
38 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \
39 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \
40 { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \
41 { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \
42 { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \
43 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \
44 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \
45 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \
46 { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \
47 { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \
48 { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \
49 { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \
50 { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \
51 { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \
52 } \
56 /**
57 * @brief Pack a hil_state message
58 * @param system_id ID of this system
59 * @param component_id ID of this component (e.g. 200 for IMU)
60 * @param msg The MAVLink message to compress the data into
62 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
63 * @param roll Roll angle (rad)
64 * @param pitch Pitch angle (rad)
65 * @param yaw Yaw angle (rad)
66 * @param rollspeed Body frame roll / phi angular speed (rad/s)
67 * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
68 * @param yawspeed Body frame yaw / psi angular speed (rad/s)
69 * @param lat Latitude, expressed as * 1E7
70 * @param lon Longitude, expressed as * 1E7
71 * @param alt Altitude in meters, expressed as * 1000 (millimeters)
72 * @param vx Ground X Speed (Latitude), expressed as m/s * 100
73 * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
74 * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
75 * @param xacc X acceleration (mg)
76 * @param yacc Y acceleration (mg)
77 * @param zacc Z acceleration (mg)
78 * @return length of the message in bytes (excluding serial stream start sign)
80 static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
81 uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
83 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
85 _mav_put_uint64_t(buf, 0, time_usec);
86 _mav_put_float(buf, 8, roll);
87 _mav_put_float(buf, 12, pitch);
88 _mav_put_float(buf, 16, yaw);
89 _mav_put_float(buf, 20, rollspeed);
90 _mav_put_float(buf, 24, pitchspeed);
91 _mav_put_float(buf, 28, yawspeed);
92 _mav_put_int32_t(buf, 32, lat);
93 _mav_put_int32_t(buf, 36, lon);
94 _mav_put_int32_t(buf, 40, alt);
95 _mav_put_int16_t(buf, 44, vx);
96 _mav_put_int16_t(buf, 46, vy);
97 _mav_put_int16_t(buf, 48, vz);
98 _mav_put_int16_t(buf, 50, xacc);
99 _mav_put_int16_t(buf, 52, yacc);
100 _mav_put_int16_t(buf, 54, zacc);
102 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
103 #else
104 mavlink_hil_state_t packet;
105 packet.time_usec = time_usec;
106 packet.roll = roll;
107 packet.pitch = pitch;
108 packet.yaw = yaw;
109 packet.rollspeed = rollspeed;
110 packet.pitchspeed = pitchspeed;
111 packet.yawspeed = yawspeed;
112 packet.lat = lat;
113 packet.lon = lon;
114 packet.alt = alt;
115 packet.vx = vx;
116 packet.vy = vy;
117 packet.vz = vz;
118 packet.xacc = xacc;
119 packet.yacc = yacc;
120 packet.zacc = zacc;
122 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
123 #endif
125 msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
126 #if MAVLINK_CRC_EXTRA
127 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
128 #else
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_LEN);
130 #endif
134 * @brief Pack a hil_state message on a channel
135 * @param system_id ID of this system
136 * @param component_id ID of this component (e.g. 200 for IMU)
137 * @param chan The MAVLink channel this message will be sent over
138 * @param msg The MAVLink message to compress the data into
139 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
140 * @param roll Roll angle (rad)
141 * @param pitch Pitch angle (rad)
142 * @param yaw Yaw angle (rad)
143 * @param rollspeed Body frame roll / phi angular speed (rad/s)
144 * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
145 * @param yawspeed Body frame yaw / psi angular speed (rad/s)
146 * @param lat Latitude, expressed as * 1E7
147 * @param lon Longitude, expressed as * 1E7
148 * @param alt Altitude in meters, expressed as * 1000 (millimeters)
149 * @param vx Ground X Speed (Latitude), expressed as m/s * 100
150 * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
151 * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
152 * @param xacc X acceleration (mg)
153 * @param yacc Y acceleration (mg)
154 * @param zacc Z acceleration (mg)
155 * @return length of the message in bytes (excluding serial stream start sign)
157 static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
158 mavlink_message_t* msg,
159 uint64_t time_usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc)
161 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
162 char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
163 _mav_put_uint64_t(buf, 0, time_usec);
164 _mav_put_float(buf, 8, roll);
165 _mav_put_float(buf, 12, pitch);
166 _mav_put_float(buf, 16, yaw);
167 _mav_put_float(buf, 20, rollspeed);
168 _mav_put_float(buf, 24, pitchspeed);
169 _mav_put_float(buf, 28, yawspeed);
170 _mav_put_int32_t(buf, 32, lat);
171 _mav_put_int32_t(buf, 36, lon);
172 _mav_put_int32_t(buf, 40, alt);
173 _mav_put_int16_t(buf, 44, vx);
174 _mav_put_int16_t(buf, 46, vy);
175 _mav_put_int16_t(buf, 48, vz);
176 _mav_put_int16_t(buf, 50, xacc);
177 _mav_put_int16_t(buf, 52, yacc);
178 _mav_put_int16_t(buf, 54, zacc);
180 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
181 #else
182 mavlink_hil_state_t packet;
183 packet.time_usec = time_usec;
184 packet.roll = roll;
185 packet.pitch = pitch;
186 packet.yaw = yaw;
187 packet.rollspeed = rollspeed;
188 packet.pitchspeed = pitchspeed;
189 packet.yawspeed = yawspeed;
190 packet.lat = lat;
191 packet.lon = lon;
192 packet.alt = alt;
193 packet.vx = vx;
194 packet.vy = vy;
195 packet.vz = vz;
196 packet.xacc = xacc;
197 packet.yacc = yacc;
198 packet.zacc = zacc;
200 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
201 #endif
203 msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
204 #if MAVLINK_CRC_EXTRA
205 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
206 #else
207 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_LEN);
208 #endif
212 * @brief Encode a hil_state struct
214 * @param system_id ID of this system
215 * @param component_id ID of this component (e.g. 200 for IMU)
216 * @param msg The MAVLink message to compress the data into
217 * @param hil_state C-struct to read the message contents from
219 static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state)
221 return mavlink_msg_hil_state_pack(system_id, component_id, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
225 * @brief Encode a hil_state struct on a channel
227 * @param system_id ID of this system
228 * @param component_id ID of this component (e.g. 200 for IMU)
229 * @param chan The MAVLink channel this message will be sent over
230 * @param msg The MAVLink message to compress the data into
231 * @param hil_state C-struct to read the message contents from
233 static inline uint16_t mavlink_msg_hil_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state)
235 return mavlink_msg_hil_state_pack_chan(system_id, component_id, chan, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
239 * @brief Send a hil_state message
240 * @param chan MAVLink channel to send the message
242 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
243 * @param roll Roll angle (rad)
244 * @param pitch Pitch angle (rad)
245 * @param yaw Yaw angle (rad)
246 * @param rollspeed Body frame roll / phi angular speed (rad/s)
247 * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
248 * @param yawspeed Body frame yaw / psi angular speed (rad/s)
249 * @param lat Latitude, expressed as * 1E7
250 * @param lon Longitude, expressed as * 1E7
251 * @param alt Altitude in meters, expressed as * 1000 (millimeters)
252 * @param vx Ground X Speed (Latitude), expressed as m/s * 100
253 * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
254 * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
255 * @param xacc X acceleration (mg)
256 * @param yacc Y acceleration (mg)
257 * @param zacc Z acceleration (mg)
259 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
261 static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
263 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
264 char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
265 _mav_put_uint64_t(buf, 0, time_usec);
266 _mav_put_float(buf, 8, roll);
267 _mav_put_float(buf, 12, pitch);
268 _mav_put_float(buf, 16, yaw);
269 _mav_put_float(buf, 20, rollspeed);
270 _mav_put_float(buf, 24, pitchspeed);
271 _mav_put_float(buf, 28, yawspeed);
272 _mav_put_int32_t(buf, 32, lat);
273 _mav_put_int32_t(buf, 36, lon);
274 _mav_put_int32_t(buf, 40, alt);
275 _mav_put_int16_t(buf, 44, vx);
276 _mav_put_int16_t(buf, 46, vy);
277 _mav_put_int16_t(buf, 48, vz);
278 _mav_put_int16_t(buf, 50, xacc);
279 _mav_put_int16_t(buf, 52, yacc);
280 _mav_put_int16_t(buf, 54, zacc);
282 #if MAVLINK_CRC_EXTRA
283 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
284 #else
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
286 #endif
287 #else
288 mavlink_hil_state_t packet;
289 packet.time_usec = time_usec;
290 packet.roll = roll;
291 packet.pitch = pitch;
292 packet.yaw = yaw;
293 packet.rollspeed = rollspeed;
294 packet.pitchspeed = pitchspeed;
295 packet.yawspeed = yawspeed;
296 packet.lat = lat;
297 packet.lon = lon;
298 packet.alt = alt;
299 packet.vx = vx;
300 packet.vy = vy;
301 packet.vz = vz;
302 packet.xacc = xacc;
303 packet.yacc = yacc;
304 packet.zacc = zacc;
306 #if MAVLINK_CRC_EXTRA
307 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
308 #else
309 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
310 #endif
311 #endif
314 #if MAVLINK_MSG_ID_HIL_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
316 This varient of _send() can be used to save stack space by re-using
317 memory from the receive buffer. The caller provides a
318 mavlink_message_t which is the size of a full mavlink message. This
319 is usually the receive buffer for the channel, and allows a reply to an
320 incoming message with minimum stack space usage.
322 static inline void mavlink_msg_hil_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
324 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
325 char *buf = (char *)msgbuf;
326 _mav_put_uint64_t(buf, 0, time_usec);
327 _mav_put_float(buf, 8, roll);
328 _mav_put_float(buf, 12, pitch);
329 _mav_put_float(buf, 16, yaw);
330 _mav_put_float(buf, 20, rollspeed);
331 _mav_put_float(buf, 24, pitchspeed);
332 _mav_put_float(buf, 28, yawspeed);
333 _mav_put_int32_t(buf, 32, lat);
334 _mav_put_int32_t(buf, 36, lon);
335 _mav_put_int32_t(buf, 40, alt);
336 _mav_put_int16_t(buf, 44, vx);
337 _mav_put_int16_t(buf, 46, vy);
338 _mav_put_int16_t(buf, 48, vz);
339 _mav_put_int16_t(buf, 50, xacc);
340 _mav_put_int16_t(buf, 52, yacc);
341 _mav_put_int16_t(buf, 54, zacc);
343 #if MAVLINK_CRC_EXTRA
344 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
345 #else
346 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
347 #endif
348 #else
349 mavlink_hil_state_t *packet = (mavlink_hil_state_t *)msgbuf;
350 packet->time_usec = time_usec;
351 packet->roll = roll;
352 packet->pitch = pitch;
353 packet->yaw = yaw;
354 packet->rollspeed = rollspeed;
355 packet->pitchspeed = pitchspeed;
356 packet->yawspeed = yawspeed;
357 packet->lat = lat;
358 packet->lon = lon;
359 packet->alt = alt;
360 packet->vx = vx;
361 packet->vy = vy;
362 packet->vz = vz;
363 packet->xacc = xacc;
364 packet->yacc = yacc;
365 packet->zacc = zacc;
367 #if MAVLINK_CRC_EXTRA
368 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
369 #else
370 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
371 #endif
372 #endif
374 #endif
376 #endif
378 // MESSAGE HIL_STATE UNPACKING
382 * @brief Get field time_usec from hil_state message
384 * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
386 static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message_t* msg)
388 return _MAV_RETURN_uint64_t(msg, 0);
392 * @brief Get field roll from hil_state message
394 * @return Roll angle (rad)
396 static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg)
398 return _MAV_RETURN_float(msg, 8);
402 * @brief Get field pitch from hil_state message
404 * @return Pitch angle (rad)
406 static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg)
408 return _MAV_RETURN_float(msg, 12);
412 * @brief Get field yaw from hil_state message
414 * @return Yaw angle (rad)
416 static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg)
418 return _MAV_RETURN_float(msg, 16);
422 * @brief Get field rollspeed from hil_state message
424 * @return Body frame roll / phi angular speed (rad/s)
426 static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* msg)
428 return _MAV_RETURN_float(msg, 20);
432 * @brief Get field pitchspeed from hil_state message
434 * @return Body frame pitch / theta angular speed (rad/s)
436 static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t* msg)
438 return _MAV_RETURN_float(msg, 24);
442 * @brief Get field yawspeed from hil_state message
444 * @return Body frame yaw / psi angular speed (rad/s)
446 static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* msg)
448 return _MAV_RETURN_float(msg, 28);
452 * @brief Get field lat from hil_state message
454 * @return Latitude, expressed as * 1E7
456 static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg)
458 return _MAV_RETURN_int32_t(msg, 32);
462 * @brief Get field lon from hil_state message
464 * @return Longitude, expressed as * 1E7
466 static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg)
468 return _MAV_RETURN_int32_t(msg, 36);
472 * @brief Get field alt from hil_state message
474 * @return Altitude in meters, expressed as * 1000 (millimeters)
476 static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg)
478 return _MAV_RETURN_int32_t(msg, 40);
482 * @brief Get field vx from hil_state message
484 * @return Ground X Speed (Latitude), expressed as m/s * 100
486 static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg)
488 return _MAV_RETURN_int16_t(msg, 44);
492 * @brief Get field vy from hil_state message
494 * @return Ground Y Speed (Longitude), expressed as m/s * 100
496 static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg)
498 return _MAV_RETURN_int16_t(msg, 46);
502 * @brief Get field vz from hil_state message
504 * @return Ground Z Speed (Altitude), expressed as m/s * 100
506 static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg)
508 return _MAV_RETURN_int16_t(msg, 48);
512 * @brief Get field xacc from hil_state message
514 * @return X acceleration (mg)
516 static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* msg)
518 return _MAV_RETURN_int16_t(msg, 50);
522 * @brief Get field yacc from hil_state message
524 * @return Y acceleration (mg)
526 static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* msg)
528 return _MAV_RETURN_int16_t(msg, 52);
532 * @brief Get field zacc from hil_state message
534 * @return Z acceleration (mg)
536 static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* msg)
538 return _MAV_RETURN_int16_t(msg, 54);
542 * @brief Decode a hil_state message into a struct
544 * @param msg The message to decode
545 * @param hil_state C-struct to decode the message contents into
547 static inline void mavlink_msg_hil_state_decode(const mavlink_message_t* msg, mavlink_hil_state_t* hil_state)
549 #if MAVLINK_NEED_BYTE_SWAP
550 hil_state->time_usec = mavlink_msg_hil_state_get_time_usec(msg);
551 hil_state->roll = mavlink_msg_hil_state_get_roll(msg);
552 hil_state->pitch = mavlink_msg_hil_state_get_pitch(msg);
553 hil_state->yaw = mavlink_msg_hil_state_get_yaw(msg);
554 hil_state->rollspeed = mavlink_msg_hil_state_get_rollspeed(msg);
555 hil_state->pitchspeed = mavlink_msg_hil_state_get_pitchspeed(msg);
556 hil_state->yawspeed = mavlink_msg_hil_state_get_yawspeed(msg);
557 hil_state->lat = mavlink_msg_hil_state_get_lat(msg);
558 hil_state->lon = mavlink_msg_hil_state_get_lon(msg);
559 hil_state->alt = mavlink_msg_hil_state_get_alt(msg);
560 hil_state->vx = mavlink_msg_hil_state_get_vx(msg);
561 hil_state->vy = mavlink_msg_hil_state_get_vy(msg);
562 hil_state->vz = mavlink_msg_hil_state_get_vz(msg);
563 hil_state->xacc = mavlink_msg_hil_state_get_xacc(msg);
564 hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg);
565 hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg);
566 #else
567 memcpy(hil_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_STATE_LEN);
568 #endif