RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_highres_imu.h
1#pragma once
2// MESSAGE HIGHRES_IMU PACKING
3
4#define MAVLINK_MSG_ID_HIGHRES_IMU 105
5
6MAVPACKED(
7typedef struct __mavlink_highres_imu_t {
8 uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
9 float xacc; /*< X acceleration (m/s^2)*/
10 float yacc; /*< Y acceleration (m/s^2)*/
11 float zacc; /*< Z acceleration (m/s^2)*/
12 float xgyro; /*< Angular speed around X axis (rad / sec)*/
13 float ygyro; /*< Angular speed around Y axis (rad / sec)*/
14 float zgyro; /*< Angular speed around Z axis (rad / sec)*/
15 float xmag; /*< X Magnetic field (Gauss)*/
16 float ymag; /*< Y Magnetic field (Gauss)*/
17 float zmag; /*< Z Magnetic field (Gauss)*/
18 float abs_pressure; /*< Absolute pressure in millibar*/
19 float diff_pressure; /*< Differential pressure in millibar*/
20 float pressure_alt; /*< Altitude calculated from pressure*/
21 float temperature; /*< Temperature in degrees celsius*/
22 uint16_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature*/
23}) mavlink_highres_imu_t;
24
25#define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62
26#define MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN 62
27#define MAVLINK_MSG_ID_105_LEN 62
28#define MAVLINK_MSG_ID_105_MIN_LEN 62
29
30#define MAVLINK_MSG_ID_HIGHRES_IMU_CRC 93
31#define MAVLINK_MSG_ID_105_CRC 93
32
33
34
35#if MAVLINK_COMMAND_24BIT
36#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
37 105, \
38 "HIGHRES_IMU", \
39 15, \
40 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
41 { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
42 { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
43 { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
44 { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
45 { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
46 { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
47 { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
48 { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
49 { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
50 { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
51 { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
52 { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
53 { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
54 { "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
55 } \
56}
57#else
58#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
59 "HIGHRES_IMU", \
60 15, \
61 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
62 { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
63 { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
64 { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
65 { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
66 { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
67 { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
68 { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
69 { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
70 { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
71 { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
72 { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
73 { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
74 { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
75 { "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
76 } \
77}
78#endif
79
80/**
81 * @brief Pack a highres_imu message
82 * @param system_id ID of this system
83 * @param component_id ID of this component (e.g. 200 for IMU)
84 * @param msg The MAVLink message to compress the data into
85 *
86 * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
87 * @param xacc X acceleration (m/s^2)
88 * @param yacc Y acceleration (m/s^2)
89 * @param zacc Z acceleration (m/s^2)
90 * @param xgyro Angular speed around X axis (rad / sec)
91 * @param ygyro Angular speed around Y axis (rad / sec)
92 * @param zgyro Angular speed around Z axis (rad / sec)
93 * @param xmag X Magnetic field (Gauss)
94 * @param ymag Y Magnetic field (Gauss)
95 * @param zmag Z Magnetic field (Gauss)
96 * @param abs_pressure Absolute pressure in millibar
97 * @param diff_pressure Differential pressure in millibar
98 * @param pressure_alt Altitude calculated from pressure
99 * @param temperature Temperature in degrees celsius
100 * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
101 * @return length of the message in bytes (excluding serial stream start sign)
102 */
103static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
104 uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
105{
106#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
107 char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
108 _mav_put_uint64_t(buf, 0, time_usec);
109 _mav_put_float(buf, 8, xacc);
110 _mav_put_float(buf, 12, yacc);
111 _mav_put_float(buf, 16, zacc);
112 _mav_put_float(buf, 20, xgyro);
113 _mav_put_float(buf, 24, ygyro);
114 _mav_put_float(buf, 28, zgyro);
115 _mav_put_float(buf, 32, xmag);
116 _mav_put_float(buf, 36, ymag);
117 _mav_put_float(buf, 40, zmag);
118 _mav_put_float(buf, 44, abs_pressure);
119 _mav_put_float(buf, 48, diff_pressure);
120 _mav_put_float(buf, 52, pressure_alt);
121 _mav_put_float(buf, 56, temperature);
122 _mav_put_uint16_t(buf, 60, fields_updated);
123
124 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
125#else
126 mavlink_highres_imu_t packet;
127 packet.time_usec = time_usec;
128 packet.xacc = xacc;
129 packet.yacc = yacc;
130 packet.zacc = zacc;
131 packet.xgyro = xgyro;
132 packet.ygyro = ygyro;
133 packet.zgyro = zgyro;
134 packet.xmag = xmag;
135 packet.ymag = ymag;
136 packet.zmag = zmag;
137 packet.abs_pressure = abs_pressure;
138 packet.diff_pressure = diff_pressure;
139 packet.pressure_alt = pressure_alt;
140 packet.temperature = temperature;
141 packet.fields_updated = fields_updated;
142
143 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
144#endif
145
146 msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
147 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
148}
149
150/**
151 * @brief Pack a highres_imu message on a channel
152 * @param system_id ID of this system
153 * @param component_id ID of this component (e.g. 200 for IMU)
154 * @param chan The MAVLink channel this message will be sent over
155 * @param msg The MAVLink message to compress the data into
156 * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
157 * @param xacc X acceleration (m/s^2)
158 * @param yacc Y acceleration (m/s^2)
159 * @param zacc Z acceleration (m/s^2)
160 * @param xgyro Angular speed around X axis (rad / sec)
161 * @param ygyro Angular speed around Y axis (rad / sec)
162 * @param zgyro Angular speed around Z axis (rad / sec)
163 * @param xmag X Magnetic field (Gauss)
164 * @param ymag Y Magnetic field (Gauss)
165 * @param zmag Z Magnetic field (Gauss)
166 * @param abs_pressure Absolute pressure in millibar
167 * @param diff_pressure Differential pressure in millibar
168 * @param pressure_alt Altitude calculated from pressure
169 * @param temperature Temperature in degrees celsius
170 * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
171 * @return length of the message in bytes (excluding serial stream start sign)
172 */
173static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
174 mavlink_message_t* msg,
175 uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated)
176{
177#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
178 char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
179 _mav_put_uint64_t(buf, 0, time_usec);
180 _mav_put_float(buf, 8, xacc);
181 _mav_put_float(buf, 12, yacc);
182 _mav_put_float(buf, 16, zacc);
183 _mav_put_float(buf, 20, xgyro);
184 _mav_put_float(buf, 24, ygyro);
185 _mav_put_float(buf, 28, zgyro);
186 _mav_put_float(buf, 32, xmag);
187 _mav_put_float(buf, 36, ymag);
188 _mav_put_float(buf, 40, zmag);
189 _mav_put_float(buf, 44, abs_pressure);
190 _mav_put_float(buf, 48, diff_pressure);
191 _mav_put_float(buf, 52, pressure_alt);
192 _mav_put_float(buf, 56, temperature);
193 _mav_put_uint16_t(buf, 60, fields_updated);
194
195 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
196#else
197 mavlink_highres_imu_t packet;
198 packet.time_usec = time_usec;
199 packet.xacc = xacc;
200 packet.yacc = yacc;
201 packet.zacc = zacc;
202 packet.xgyro = xgyro;
203 packet.ygyro = ygyro;
204 packet.zgyro = zgyro;
205 packet.xmag = xmag;
206 packet.ymag = ymag;
207 packet.zmag = zmag;
208 packet.abs_pressure = abs_pressure;
209 packet.diff_pressure = diff_pressure;
210 packet.pressure_alt = pressure_alt;
211 packet.temperature = temperature;
212 packet.fields_updated = fields_updated;
213
214 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
215#endif
216
217 msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
218 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
219}
220
221/**
222 * @brief Encode a highres_imu struct
223 *
224 * @param system_id ID of this system
225 * @param component_id ID of this component (e.g. 200 for IMU)
226 * @param msg The MAVLink message to compress the data into
227 * @param highres_imu C-struct to read the message contents from
228 */
229static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
230{
231 return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
232}
233
234/**
235 * @brief Encode a highres_imu struct on a channel
236 *
237 * @param system_id ID of this system
238 * @param component_id ID of this component (e.g. 200 for IMU)
239 * @param chan The MAVLink channel this message will be sent over
240 * @param msg The MAVLink message to compress the data into
241 * @param highres_imu C-struct to read the message contents from
242 */
243static inline uint16_t mavlink_msg_highres_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
244{
245 return mavlink_msg_highres_imu_pack_chan(system_id, component_id, chan, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
246}
247
248/**
249 * @brief Send a highres_imu message
250 * @param chan MAVLink channel to send the message
251 *
252 * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
253 * @param xacc X acceleration (m/s^2)
254 * @param yacc Y acceleration (m/s^2)
255 * @param zacc Z acceleration (m/s^2)
256 * @param xgyro Angular speed around X axis (rad / sec)
257 * @param ygyro Angular speed around Y axis (rad / sec)
258 * @param zgyro Angular speed around Z axis (rad / sec)
259 * @param xmag X Magnetic field (Gauss)
260 * @param ymag Y Magnetic field (Gauss)
261 * @param zmag Z Magnetic field (Gauss)
262 * @param abs_pressure Absolute pressure in millibar
263 * @param diff_pressure Differential pressure in millibar
264 * @param pressure_alt Altitude calculated from pressure
265 * @param temperature Temperature in degrees celsius
266 * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
267 */
268#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
269
270static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
271{
272#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
273 char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
274 _mav_put_uint64_t(buf, 0, time_usec);
275 _mav_put_float(buf, 8, xacc);
276 _mav_put_float(buf, 12, yacc);
277 _mav_put_float(buf, 16, zacc);
278 _mav_put_float(buf, 20, xgyro);
279 _mav_put_float(buf, 24, ygyro);
280 _mav_put_float(buf, 28, zgyro);
281 _mav_put_float(buf, 32, xmag);
282 _mav_put_float(buf, 36, ymag);
283 _mav_put_float(buf, 40, zmag);
284 _mav_put_float(buf, 44, abs_pressure);
285 _mav_put_float(buf, 48, diff_pressure);
286 _mav_put_float(buf, 52, pressure_alt);
287 _mav_put_float(buf, 56, temperature);
288 _mav_put_uint16_t(buf, 60, fields_updated);
289
290 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
291#else
292 mavlink_highres_imu_t packet;
293 packet.time_usec = time_usec;
294 packet.xacc = xacc;
295 packet.yacc = yacc;
296 packet.zacc = zacc;
297 packet.xgyro = xgyro;
298 packet.ygyro = ygyro;
299 packet.zgyro = zgyro;
300 packet.xmag = xmag;
301 packet.ymag = ymag;
302 packet.zmag = zmag;
303 packet.abs_pressure = abs_pressure;
304 packet.diff_pressure = diff_pressure;
305 packet.pressure_alt = pressure_alt;
306 packet.temperature = temperature;
307 packet.fields_updated = fields_updated;
308
309 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
310#endif
311}
312
313/**
314 * @brief Send a highres_imu message
315 * @param chan MAVLink channel to send the message
316 * @param struct The MAVLink struct to serialize
317 */
318static inline void mavlink_msg_highres_imu_send_struct(mavlink_channel_t chan, const mavlink_highres_imu_t* highres_imu)
319{
320#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
321 mavlink_msg_highres_imu_send(chan, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
322#else
323 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)highres_imu, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
324#endif
325}
326
327#if MAVLINK_MSG_ID_HIGHRES_IMU_LEN <= MAVLINK_MAX_PAYLOAD_LEN
328/*
329 This varient of _send() can be used to save stack space by re-using
330 memory from the receive buffer. The caller provides a
331 mavlink_message_t which is the size of a full mavlink message. This
332 is usually the receive buffer for the channel, and allows a reply to an
333 incoming message with minimum stack space usage.
334 */
335static inline void mavlink_msg_highres_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
336{
337#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
338 char *buf = (char *)msgbuf;
339 _mav_put_uint64_t(buf, 0, time_usec);
340 _mav_put_float(buf, 8, xacc);
341 _mav_put_float(buf, 12, yacc);
342 _mav_put_float(buf, 16, zacc);
343 _mav_put_float(buf, 20, xgyro);
344 _mav_put_float(buf, 24, ygyro);
345 _mav_put_float(buf, 28, zgyro);
346 _mav_put_float(buf, 32, xmag);
347 _mav_put_float(buf, 36, ymag);
348 _mav_put_float(buf, 40, zmag);
349 _mav_put_float(buf, 44, abs_pressure);
350 _mav_put_float(buf, 48, diff_pressure);
351 _mav_put_float(buf, 52, pressure_alt);
352 _mav_put_float(buf, 56, temperature);
353 _mav_put_uint16_t(buf, 60, fields_updated);
354
355 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
356#else
357 mavlink_highres_imu_t *packet = (mavlink_highres_imu_t *)msgbuf;
358 packet->time_usec = time_usec;
359 packet->xacc = xacc;
360 packet->yacc = yacc;
361 packet->zacc = zacc;
362 packet->xgyro = xgyro;
363 packet->ygyro = ygyro;
364 packet->zgyro = zgyro;
365 packet->xmag = xmag;
366 packet->ymag = ymag;
367 packet->zmag = zmag;
368 packet->abs_pressure = abs_pressure;
369 packet->diff_pressure = diff_pressure;
370 packet->pressure_alt = pressure_alt;
371 packet->temperature = temperature;
372 packet->fields_updated = fields_updated;
373
374 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
375#endif
376}
377#endif
378
379#endif
380
381// MESSAGE HIGHRES_IMU UNPACKING
382
383
384/**
385 * @brief Get field time_usec from highres_imu message
386 *
387 * @return Timestamp (microseconds, synced to UNIX time or since system boot)
388 */
389static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg)
390{
391 return _MAV_RETURN_uint64_t(msg, 0);
392}
393
394/**
395 * @brief Get field xacc from highres_imu message
396 *
397 * @return X acceleration (m/s^2)
398 */
399static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg)
400{
401 return _MAV_RETURN_float(msg, 8);
402}
403
404/**
405 * @brief Get field yacc from highres_imu message
406 *
407 * @return Y acceleration (m/s^2)
408 */
409static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg)
410{
411 return _MAV_RETURN_float(msg, 12);
412}
413
414/**
415 * @brief Get field zacc from highres_imu message
416 *
417 * @return Z acceleration (m/s^2)
418 */
419static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg)
420{
421 return _MAV_RETURN_float(msg, 16);
422}
423
424/**
425 * @brief Get field xgyro from highres_imu message
426 *
427 * @return Angular speed around X axis (rad / sec)
428 */
429static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg)
430{
431 return _MAV_RETURN_float(msg, 20);
432}
433
434/**
435 * @brief Get field ygyro from highres_imu message
436 *
437 * @return Angular speed around Y axis (rad / sec)
438 */
439static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg)
440{
441 return _MAV_RETURN_float(msg, 24);
442}
443
444/**
445 * @brief Get field zgyro from highres_imu message
446 *
447 * @return Angular speed around Z axis (rad / sec)
448 */
449static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg)
450{
451 return _MAV_RETURN_float(msg, 28);
452}
453
454/**
455 * @brief Get field xmag from highres_imu message
456 *
457 * @return X Magnetic field (Gauss)
458 */
459static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg)
460{
461 return _MAV_RETURN_float(msg, 32);
462}
463
464/**
465 * @brief Get field ymag from highres_imu message
466 *
467 * @return Y Magnetic field (Gauss)
468 */
469static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg)
470{
471 return _MAV_RETURN_float(msg, 36);
472}
473
474/**
475 * @brief Get field zmag from highres_imu message
476 *
477 * @return Z Magnetic field (Gauss)
478 */
479static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg)
480{
481 return _MAV_RETURN_float(msg, 40);
482}
483
484/**
485 * @brief Get field abs_pressure from highres_imu message
486 *
487 * @return Absolute pressure in millibar
488 */
489static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg)
490{
491 return _MAV_RETURN_float(msg, 44);
492}
493
494/**
495 * @brief Get field diff_pressure from highres_imu message
496 *
497 * @return Differential pressure in millibar
498 */
499static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg)
500{
501 return _MAV_RETURN_float(msg, 48);
502}
503
504/**
505 * @brief Get field pressure_alt from highres_imu message
506 *
507 * @return Altitude calculated from pressure
508 */
509static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg)
510{
511 return _MAV_RETURN_float(msg, 52);
512}
513
514/**
515 * @brief Get field temperature from highres_imu message
516 *
517 * @return Temperature in degrees celsius
518 */
519static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg)
520{
521 return _MAV_RETURN_float(msg, 56);
522}
523
524/**
525 * @brief Get field fields_updated from highres_imu message
526 *
527 * @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
528 */
529static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg)
530{
531 return _MAV_RETURN_uint16_t(msg, 60);
532}
533
534/**
535 * @brief Decode a highres_imu message into a struct
536 *
537 * @param msg The message to decode
538 * @param highres_imu C-struct to decode the message contents into
539 */
540static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu)
541{
542#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
543 highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg);
544 highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg);
545 highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg);
546 highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg);
547 highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg);
548 highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg);
549 highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg);
550 highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg);
551 highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg);
552 highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg);
553 highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg);
554 highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg);
555 highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg);
556 highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg);
557 highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg);
558#else
559 uint8_t len = msg->len < MAVLINK_MSG_ID_HIGHRES_IMU_LEN? msg->len : MAVLINK_MSG_ID_HIGHRES_IMU_LEN;
560 memset(highres_imu, 0, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
561 memcpy(highres_imu, _MAV_PAYLOAD(msg), len);
562#endif
563}