4#define MAVLINK_MSG_ID_AHRS2 178
7typedef struct __mavlink_ahrs2_t {
16#define MAVLINK_MSG_ID_AHRS2_LEN 24
17#define MAVLINK_MSG_ID_AHRS2_MIN_LEN 24
18#define MAVLINK_MSG_ID_178_LEN 24
19#define MAVLINK_MSG_ID_178_MIN_LEN 24
21#define MAVLINK_MSG_ID_AHRS2_CRC 47
22#define MAVLINK_MSG_ID_178_CRC 47
26#if MAVLINK_COMMAND_24BIT
27#define MAVLINK_MESSAGE_INFO_AHRS2 { \
31 { { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs2_t, roll) }, \
32 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs2_t, pitch) }, \
33 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs2_t, yaw) }, \
34 { "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs2_t, altitude) }, \
35 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_ahrs2_t, lat) }, \
36 { "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_ahrs2_t, lng) }, \
40#define MAVLINK_MESSAGE_INFO_AHRS2 { \
43 { { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs2_t, roll) }, \
44 { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs2_t, pitch) }, \
45 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs2_t, yaw) }, \
46 { "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs2_t, altitude) }, \
47 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_ahrs2_t, lat) }, \
48 { "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_ahrs2_t, lng) }, \
67static inline uint16_t mavlink_msg_ahrs2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
68 float roll,
float pitch,
float yaw,
float altitude, int32_t lat, int32_t lng)
70#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71 char buf[MAVLINK_MSG_ID_AHRS2_LEN];
72 _mav_put_float(buf, 0, roll);
73 _mav_put_float(buf, 4, pitch);
74 _mav_put_float(buf, 8, yaw);
75 _mav_put_float(buf, 12, altitude);
76 _mav_put_int32_t(buf, 16, lat);
77 _mav_put_int32_t(buf, 20, lng);
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS2_LEN);
81 mavlink_ahrs2_t packet;
85 packet.altitude = altitude;
89 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS2_LEN);
92 msg->msgid = MAVLINK_MSG_ID_AHRS2;
93 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
110static inline uint16_t mavlink_msg_ahrs2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
111 mavlink_message_t* msg,
112 float roll,
float pitch,
float yaw,
float altitude,int32_t lat,int32_t lng)
114#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
115 char buf[MAVLINK_MSG_ID_AHRS2_LEN];
116 _mav_put_float(buf, 0, roll);
117 _mav_put_float(buf, 4, pitch);
118 _mav_put_float(buf, 8, yaw);
119 _mav_put_float(buf, 12, altitude);
120 _mav_put_int32_t(buf, 16, lat);
121 _mav_put_int32_t(buf, 20, lng);
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS2_LEN);
125 mavlink_ahrs2_t packet;
127 packet.pitch = pitch;
129 packet.altitude = altitude;
133 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS2_LEN);
136 msg->msgid = MAVLINK_MSG_ID_AHRS2;
137 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
148static inline uint16_t mavlink_msg_ahrs2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_ahrs2_t* ahrs2)
150 return mavlink_msg_ahrs2_pack(system_id, component_id, msg, ahrs2->roll, ahrs2->pitch, ahrs2->yaw, ahrs2->altitude, ahrs2->lat, ahrs2->lng);
162static inline uint16_t mavlink_msg_ahrs2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_ahrs2_t* ahrs2)
164 return mavlink_msg_ahrs2_pack_chan(system_id, component_id, chan, msg, ahrs2->roll, ahrs2->pitch, ahrs2->yaw, ahrs2->altitude, ahrs2->lat, ahrs2->lng);
178#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
180static inline void mavlink_msg_ahrs2_send(mavlink_channel_t chan,
float roll,
float pitch,
float yaw,
float altitude, int32_t lat, int32_t lng)
182#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
183 char buf[MAVLINK_MSG_ID_AHRS2_LEN];
184 _mav_put_float(buf, 0, roll);
185 _mav_put_float(buf, 4, pitch);
186 _mav_put_float(buf, 8, yaw);
187 _mav_put_float(buf, 12, altitude);
188 _mav_put_int32_t(buf, 16, lat);
189 _mav_put_int32_t(buf, 20, lng);
191 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, buf, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
193 mavlink_ahrs2_t packet;
195 packet.pitch = pitch;
197 packet.altitude = altitude;
201 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, (
const char *)&packet, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
210static inline void mavlink_msg_ahrs2_send_struct(mavlink_channel_t chan,
const mavlink_ahrs2_t* ahrs2)
212#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
213 mavlink_msg_ahrs2_send(chan, ahrs2->roll, ahrs2->pitch, ahrs2->yaw, ahrs2->altitude, ahrs2->lat, ahrs2->lng);
215 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, (
const char *)ahrs2, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
219#if MAVLINK_MSG_ID_AHRS2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
227static inline void mavlink_msg_ahrs2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,
float roll,
float pitch,
float yaw,
float altitude, int32_t lat, int32_t lng)
229#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 char *buf = (
char *)msgbuf;
231 _mav_put_float(buf, 0, roll);
232 _mav_put_float(buf, 4, pitch);
233 _mav_put_float(buf, 8, yaw);
234 _mav_put_float(buf, 12, altitude);
235 _mav_put_int32_t(buf, 16, lat);
236 _mav_put_int32_t(buf, 20, lng);
238 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, buf, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
240 mavlink_ahrs2_t *packet = (mavlink_ahrs2_t *)msgbuf;
242 packet->pitch = pitch;
244 packet->altitude = altitude;
248 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, (
const char *)packet, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
263static inline float mavlink_msg_ahrs2_get_roll(
const mavlink_message_t* msg)
265 return _MAV_RETURN_float(msg, 0);
273static inline float mavlink_msg_ahrs2_get_pitch(
const mavlink_message_t* msg)
275 return _MAV_RETURN_float(msg, 4);
283static inline float mavlink_msg_ahrs2_get_yaw(
const mavlink_message_t* msg)
285 return _MAV_RETURN_float(msg, 8);
293static inline float mavlink_msg_ahrs2_get_altitude(
const mavlink_message_t* msg)
295 return _MAV_RETURN_float(msg, 12);
303static inline int32_t mavlink_msg_ahrs2_get_lat(
const mavlink_message_t* msg)
305 return _MAV_RETURN_int32_t(msg, 16);
313static inline int32_t mavlink_msg_ahrs2_get_lng(
const mavlink_message_t* msg)
315 return _MAV_RETURN_int32_t(msg, 20);
324static inline void mavlink_msg_ahrs2_decode(
const mavlink_message_t* msg, mavlink_ahrs2_t* ahrs2)
326#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
327 ahrs2->roll = mavlink_msg_ahrs2_get_roll(msg);
328 ahrs2->pitch = mavlink_msg_ahrs2_get_pitch(msg);
329 ahrs2->yaw = mavlink_msg_ahrs2_get_yaw(msg);
330 ahrs2->altitude = mavlink_msg_ahrs2_get_altitude(msg);
331 ahrs2->lat = mavlink_msg_ahrs2_get_lat(msg);
332 ahrs2->lng = mavlink_msg_ahrs2_get_lng(msg);
334 uint8_t len = msg->len < MAVLINK_MSG_ID_AHRS2_LEN? msg->len : MAVLINK_MSG_ID_AHRS2_LEN;
335 memset(ahrs2, 0, MAVLINK_MSG_ID_AHRS2_LEN);
336 memcpy(ahrs2, _MAV_PAYLOAD(msg), len);