4#define MAVLINK_MSG_ID_SENSOR_OFFSETS 150
7typedef struct __mavlink_sensor_offsets_t {
20}) mavlink_sensor_offsets_t;
22#define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42
23#define MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN 42
24#define MAVLINK_MSG_ID_150_LEN 42
25#define MAVLINK_MSG_ID_150_MIN_LEN 42
27#define MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC 134
28#define MAVLINK_MSG_ID_150_CRC 134
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
37 { { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
38 { "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
39 { "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
40 { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
41 { "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
42 { "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
43 { "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
44 { "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
45 { "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
46 { "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
47 { "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
48 { "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
52#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
55 { { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
56 { "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
57 { "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
58 { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
59 { "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
60 { "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
61 { "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
62 { "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
63 { "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
64 { "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
65 { "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
66 { "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
91static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z,
float mag_declination, int32_t raw_press, int32_t raw_temp,
float gyro_cal_x,
float gyro_cal_y,
float gyro_cal_z,
float accel_cal_x,
float accel_cal_y,
float accel_cal_z)
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
96 _mav_put_float(buf, 0, mag_declination);
97 _mav_put_int32_t(buf, 4, raw_press);
98 _mav_put_int32_t(buf, 8, raw_temp);
99 _mav_put_float(buf, 12, gyro_cal_x);
100 _mav_put_float(buf, 16, gyro_cal_y);
101 _mav_put_float(buf, 20, gyro_cal_z);
102 _mav_put_float(buf, 24, accel_cal_x);
103 _mav_put_float(buf, 28, accel_cal_y);
104 _mav_put_float(buf, 32, accel_cal_z);
105 _mav_put_int16_t(buf, 36, mag_ofs_x);
106 _mav_put_int16_t(buf, 38, mag_ofs_y);
107 _mav_put_int16_t(buf, 40, mag_ofs_z);
109 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
111 mavlink_sensor_offsets_t packet;
112 packet.mag_declination = mag_declination;
113 packet.raw_press = raw_press;
114 packet.raw_temp = raw_temp;
115 packet.gyro_cal_x = gyro_cal_x;
116 packet.gyro_cal_y = gyro_cal_y;
117 packet.gyro_cal_z = gyro_cal_z;
118 packet.accel_cal_x = accel_cal_x;
119 packet.accel_cal_y = accel_cal_y;
120 packet.accel_cal_z = accel_cal_z;
121 packet.mag_ofs_x = mag_ofs_x;
122 packet.mag_ofs_y = mag_ofs_y;
123 packet.mag_ofs_z = mag_ofs_z;
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
128 msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
152static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
153 mavlink_message_t* msg,
154 int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z,
float mag_declination,int32_t raw_press,int32_t raw_temp,
float gyro_cal_x,
float gyro_cal_y,
float gyro_cal_z,
float accel_cal_x,
float accel_cal_y,
float accel_cal_z)
156#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157 char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
158 _mav_put_float(buf, 0, mag_declination);
159 _mav_put_int32_t(buf, 4, raw_press);
160 _mav_put_int32_t(buf, 8, raw_temp);
161 _mav_put_float(buf, 12, gyro_cal_x);
162 _mav_put_float(buf, 16, gyro_cal_y);
163 _mav_put_float(buf, 20, gyro_cal_z);
164 _mav_put_float(buf, 24, accel_cal_x);
165 _mav_put_float(buf, 28, accel_cal_y);
166 _mav_put_float(buf, 32, accel_cal_z);
167 _mav_put_int16_t(buf, 36, mag_ofs_x);
168 _mav_put_int16_t(buf, 38, mag_ofs_y);
169 _mav_put_int16_t(buf, 40, mag_ofs_z);
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
173 mavlink_sensor_offsets_t packet;
174 packet.mag_declination = mag_declination;
175 packet.raw_press = raw_press;
176 packet.raw_temp = raw_temp;
177 packet.gyro_cal_x = gyro_cal_x;
178 packet.gyro_cal_y = gyro_cal_y;
179 packet.gyro_cal_z = gyro_cal_z;
180 packet.accel_cal_x = accel_cal_x;
181 packet.accel_cal_y = accel_cal_y;
182 packet.accel_cal_z = accel_cal_z;
183 packet.mag_ofs_x = mag_ofs_x;
184 packet.mag_ofs_y = mag_ofs_y;
185 packet.mag_ofs_z = mag_ofs_z;
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
190 msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
191 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
202static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_sensor_offsets_t* sensor_offsets)
204 return mavlink_msg_sensor_offsets_pack(system_id, component_id, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
216static inline uint16_t mavlink_msg_sensor_offsets_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_sensor_offsets_t* sensor_offsets)
218 return mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, chan, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
238#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
240static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z,
float mag_declination, int32_t raw_press, int32_t raw_temp,
float gyro_cal_x,
float gyro_cal_y,
float gyro_cal_z,
float accel_cal_x,
float accel_cal_y,
float accel_cal_z)
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
244 _mav_put_float(buf, 0, mag_declination);
245 _mav_put_int32_t(buf, 4, raw_press);
246 _mav_put_int32_t(buf, 8, raw_temp);
247 _mav_put_float(buf, 12, gyro_cal_x);
248 _mav_put_float(buf, 16, gyro_cal_y);
249 _mav_put_float(buf, 20, gyro_cal_z);
250 _mav_put_float(buf, 24, accel_cal_x);
251 _mav_put_float(buf, 28, accel_cal_y);
252 _mav_put_float(buf, 32, accel_cal_z);
253 _mav_put_int16_t(buf, 36, mag_ofs_x);
254 _mav_put_int16_t(buf, 38, mag_ofs_y);
255 _mav_put_int16_t(buf, 40, mag_ofs_z);
257 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
259 mavlink_sensor_offsets_t packet;
260 packet.mag_declination = mag_declination;
261 packet.raw_press = raw_press;
262 packet.raw_temp = raw_temp;
263 packet.gyro_cal_x = gyro_cal_x;
264 packet.gyro_cal_y = gyro_cal_y;
265 packet.gyro_cal_z = gyro_cal_z;
266 packet.accel_cal_x = accel_cal_x;
267 packet.accel_cal_y = accel_cal_y;
268 packet.accel_cal_z = accel_cal_z;
269 packet.mag_ofs_x = mag_ofs_x;
270 packet.mag_ofs_y = mag_ofs_y;
271 packet.mag_ofs_z = mag_ofs_z;
273 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (
const char *)&packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
282static inline void mavlink_msg_sensor_offsets_send_struct(mavlink_channel_t chan,
const mavlink_sensor_offsets_t* sensor_offsets)
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 mavlink_msg_sensor_offsets_send(chan, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (
const char *)sensor_offsets, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
291#if MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
299static inline void mavlink_msg_sensor_offsets_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z,
float mag_declination, int32_t raw_press, int32_t raw_temp,
float gyro_cal_x,
float gyro_cal_y,
float gyro_cal_z,
float accel_cal_x,
float accel_cal_y,
float accel_cal_z)
301#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
302 char *buf = (
char *)msgbuf;
303 _mav_put_float(buf, 0, mag_declination);
304 _mav_put_int32_t(buf, 4, raw_press);
305 _mav_put_int32_t(buf, 8, raw_temp);
306 _mav_put_float(buf, 12, gyro_cal_x);
307 _mav_put_float(buf, 16, gyro_cal_y);
308 _mav_put_float(buf, 20, gyro_cal_z);
309 _mav_put_float(buf, 24, accel_cal_x);
310 _mav_put_float(buf, 28, accel_cal_y);
311 _mav_put_float(buf, 32, accel_cal_z);
312 _mav_put_int16_t(buf, 36, mag_ofs_x);
313 _mav_put_int16_t(buf, 38, mag_ofs_y);
314 _mav_put_int16_t(buf, 40, mag_ofs_z);
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
318 mavlink_sensor_offsets_t *packet = (mavlink_sensor_offsets_t *)msgbuf;
319 packet->mag_declination = mag_declination;
320 packet->raw_press = raw_press;
321 packet->raw_temp = raw_temp;
322 packet->gyro_cal_x = gyro_cal_x;
323 packet->gyro_cal_y = gyro_cal_y;
324 packet->gyro_cal_z = gyro_cal_z;
325 packet->accel_cal_x = accel_cal_x;
326 packet->accel_cal_y = accel_cal_y;
327 packet->accel_cal_z = accel_cal_z;
328 packet->mag_ofs_x = mag_ofs_x;
329 packet->mag_ofs_y = mag_ofs_y;
330 packet->mag_ofs_z = mag_ofs_z;
332 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (
const char *)packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
347static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(
const mavlink_message_t* msg)
349 return _MAV_RETURN_int16_t(msg, 36);
357static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(
const mavlink_message_t* msg)
359 return _MAV_RETURN_int16_t(msg, 38);
367static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(
const mavlink_message_t* msg)
369 return _MAV_RETURN_int16_t(msg, 40);
377static inline float mavlink_msg_sensor_offsets_get_mag_declination(
const mavlink_message_t* msg)
379 return _MAV_RETURN_float(msg, 0);
387static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(
const mavlink_message_t* msg)
389 return _MAV_RETURN_int32_t(msg, 4);
397static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(
const mavlink_message_t* msg)
399 return _MAV_RETURN_int32_t(msg, 8);
407static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(
const mavlink_message_t* msg)
409 return _MAV_RETURN_float(msg, 12);
417static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(
const mavlink_message_t* msg)
419 return _MAV_RETURN_float(msg, 16);
427static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(
const mavlink_message_t* msg)
429 return _MAV_RETURN_float(msg, 20);
437static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(
const mavlink_message_t* msg)
439 return _MAV_RETURN_float(msg, 24);
447static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(
const mavlink_message_t* msg)
449 return _MAV_RETURN_float(msg, 28);
457static inline float mavlink_msg_sensor_offsets_get_accel_cal_z(
const mavlink_message_t* msg)
459 return _MAV_RETURN_float(msg, 32);
468static inline void mavlink_msg_sensor_offsets_decode(
const mavlink_message_t* msg, mavlink_sensor_offsets_t* sensor_offsets)
470#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
471 sensor_offsets->mag_declination = mavlink_msg_sensor_offsets_get_mag_declination(msg);
472 sensor_offsets->raw_press = mavlink_msg_sensor_offsets_get_raw_press(msg);
473 sensor_offsets->raw_temp = mavlink_msg_sensor_offsets_get_raw_temp(msg);
474 sensor_offsets->gyro_cal_x = mavlink_msg_sensor_offsets_get_gyro_cal_x(msg);
475 sensor_offsets->gyro_cal_y = mavlink_msg_sensor_offsets_get_gyro_cal_y(msg);
476 sensor_offsets->gyro_cal_z = mavlink_msg_sensor_offsets_get_gyro_cal_z(msg);
477 sensor_offsets->accel_cal_x = mavlink_msg_sensor_offsets_get_accel_cal_x(msg);
478 sensor_offsets->accel_cal_y = mavlink_msg_sensor_offsets_get_accel_cal_y(msg);
479 sensor_offsets->accel_cal_z = mavlink_msg_sensor_offsets_get_accel_cal_z(msg);
480 sensor_offsets->mag_ofs_x = mavlink_msg_sensor_offsets_get_mag_ofs_x(msg);
481 sensor_offsets->mag_ofs_y = mavlink_msg_sensor_offsets_get_mag_ofs_y(msg);
482 sensor_offsets->mag_ofs_z = mavlink_msg_sensor_offsets_get_mag_ofs_z(msg);
484 uint8_t len = msg->len < MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN? msg->len : MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN;
485 memset(sensor_offsets, 0, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
486 memcpy(sensor_offsets, _MAV_PAYLOAD(msg), len);