Merge pull request #10476 from radiolinkW/RADIOLINKF722
[inav.git] / lib / main / MAVLink / common / mavlink_msg_gimbal_device_attitude_status.h
blob63275480b4efb1365b952fd3855f722bc61beeaa
1 #pragma once
2 // MESSAGE GIMBAL_DEVICE_ATTITUDE_STATUS PACKING
4 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS 285
7 typedef struct __mavlink_gimbal_device_attitude_status_t {
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
9 float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)*/
10 float angular_velocity_x; /*< [rad/s] X component of angular velocity (NaN if unknown)*/
11 float angular_velocity_y; /*< [rad/s] Y component of angular velocity (NaN if unknown)*/
12 float angular_velocity_z; /*< [rad/s] Z component of angular velocity (NaN if unknown)*/
13 uint32_t failure_flags; /*< Failure flags (0 for no failure)*/
14 uint16_t flags; /*< Current gimbal flags set.*/
15 uint8_t target_system; /*< System ID*/
16 uint8_t target_component; /*< Component ID*/
17 } mavlink_gimbal_device_attitude_status_t;
19 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN 40
20 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN 40
21 #define MAVLINK_MSG_ID_285_LEN 40
22 #define MAVLINK_MSG_ID_285_MIN_LEN 40
24 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC 137
25 #define MAVLINK_MSG_ID_285_CRC 137
27 #define MAVLINK_MSG_GIMBAL_DEVICE_ATTITUDE_STATUS_FIELD_Q_LEN 4
29 #if MAVLINK_COMMAND_24BIT
30 #define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_ATTITUDE_STATUS { \
31 285, \
32 "GIMBAL_DEVICE_ATTITUDE_STATUS", \
33 9, \
34 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_gimbal_device_attitude_status_t, target_system) }, \
35 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_gimbal_device_attitude_status_t, target_component) }, \
36 { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gimbal_device_attitude_status_t, time_boot_ms) }, \
37 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_gimbal_device_attitude_status_t, flags) }, \
38 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_gimbal_device_attitude_status_t, q) }, \
39 { "angular_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_attitude_status_t, angular_velocity_x) }, \
40 { "angular_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_attitude_status_t, angular_velocity_y) }, \
41 { "angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_device_attitude_status_t, angular_velocity_z) }, \
42 { "failure_flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_gimbal_device_attitude_status_t, failure_flags) }, \
43 } \
45 #else
46 #define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_ATTITUDE_STATUS { \
47 "GIMBAL_DEVICE_ATTITUDE_STATUS", \
48 9, \
49 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_gimbal_device_attitude_status_t, target_system) }, \
50 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_gimbal_device_attitude_status_t, target_component) }, \
51 { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gimbal_device_attitude_status_t, time_boot_ms) }, \
52 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_gimbal_device_attitude_status_t, flags) }, \
53 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_gimbal_device_attitude_status_t, q) }, \
54 { "angular_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_attitude_status_t, angular_velocity_x) }, \
55 { "angular_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_attitude_status_t, angular_velocity_y) }, \
56 { "angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_device_attitude_status_t, angular_velocity_z) }, \
57 { "failure_flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_gimbal_device_attitude_status_t, failure_flags) }, \
58 } \
60 #endif
62 /**
63 * @brief Pack a gimbal_device_attitude_status message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
68 * @param target_system System ID
69 * @param target_component Component ID
70 * @param time_boot_ms [ms] Timestamp (time since system boot).
71 * @param flags Current gimbal flags set.
72 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
73 * @param angular_velocity_x [rad/s] X component of angular velocity (NaN if unknown)
74 * @param angular_velocity_y [rad/s] Y component of angular velocity (NaN if unknown)
75 * @param angular_velocity_z [rad/s] Z component of angular velocity (NaN if unknown)
76 * @param failure_flags Failure flags (0 for no failure)
77 * @return length of the message in bytes (excluding serial stream start sign)
79 static inline uint16_t mavlink_msg_gimbal_device_attitude_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint8_t target_system, uint8_t target_component, uint32_t time_boot_ms, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z, uint32_t failure_flags)
82 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
83 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN];
84 _mav_put_uint32_t(buf, 0, time_boot_ms);
85 _mav_put_float(buf, 20, angular_velocity_x);
86 _mav_put_float(buf, 24, angular_velocity_y);
87 _mav_put_float(buf, 28, angular_velocity_z);
88 _mav_put_uint32_t(buf, 32, failure_flags);
89 _mav_put_uint16_t(buf, 36, flags);
90 _mav_put_uint8_t(buf, 38, target_system);
91 _mav_put_uint8_t(buf, 39, target_component);
92 _mav_put_float_array(buf, 4, q, 4);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN);
94 #else
95 mavlink_gimbal_device_attitude_status_t packet;
96 packet.time_boot_ms = time_boot_ms;
97 packet.angular_velocity_x = angular_velocity_x;
98 packet.angular_velocity_y = angular_velocity_y;
99 packet.angular_velocity_z = angular_velocity_z;
100 packet.failure_flags = failure_flags;
101 packet.flags = flags;
102 packet.target_system = target_system;
103 packet.target_component = target_component;
104 mav_array_memcpy(packet.q, q, sizeof(float)*4);
105 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN);
106 #endif
108 msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS;
109 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
113 * @brief Pack a gimbal_device_attitude_status message on a channel
114 * @param system_id ID of this system
115 * @param component_id ID of this component (e.g. 200 for IMU)
116 * @param chan The MAVLink channel this message will be sent over
117 * @param msg The MAVLink message to compress the data into
118 * @param target_system System ID
119 * @param target_component Component ID
120 * @param time_boot_ms [ms] Timestamp (time since system boot).
121 * @param flags Current gimbal flags set.
122 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
123 * @param angular_velocity_x [rad/s] X component of angular velocity (NaN if unknown)
124 * @param angular_velocity_y [rad/s] Y component of angular velocity (NaN if unknown)
125 * @param angular_velocity_z [rad/s] Z component of angular velocity (NaN if unknown)
126 * @param failure_flags Failure flags (0 for no failure)
127 * @return length of the message in bytes (excluding serial stream start sign)
129 static inline uint16_t mavlink_msg_gimbal_device_attitude_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
130 mavlink_message_t* msg,
131 uint8_t target_system,uint8_t target_component,uint32_t time_boot_ms,uint16_t flags,const float *q,float angular_velocity_x,float angular_velocity_y,float angular_velocity_z,uint32_t failure_flags)
133 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN];
135 _mav_put_uint32_t(buf, 0, time_boot_ms);
136 _mav_put_float(buf, 20, angular_velocity_x);
137 _mav_put_float(buf, 24, angular_velocity_y);
138 _mav_put_float(buf, 28, angular_velocity_z);
139 _mav_put_uint32_t(buf, 32, failure_flags);
140 _mav_put_uint16_t(buf, 36, flags);
141 _mav_put_uint8_t(buf, 38, target_system);
142 _mav_put_uint8_t(buf, 39, target_component);
143 _mav_put_float_array(buf, 4, q, 4);
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN);
145 #else
146 mavlink_gimbal_device_attitude_status_t packet;
147 packet.time_boot_ms = time_boot_ms;
148 packet.angular_velocity_x = angular_velocity_x;
149 packet.angular_velocity_y = angular_velocity_y;
150 packet.angular_velocity_z = angular_velocity_z;
151 packet.failure_flags = failure_flags;
152 packet.flags = flags;
153 packet.target_system = target_system;
154 packet.target_component = target_component;
155 mav_array_memcpy(packet.q, q, sizeof(float)*4);
156 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN);
157 #endif
159 msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS;
160 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
164 * @brief Encode a gimbal_device_attitude_status struct
166 * @param system_id ID of this system
167 * @param component_id ID of this component (e.g. 200 for IMU)
168 * @param msg The MAVLink message to compress the data into
169 * @param gimbal_device_attitude_status C-struct to read the message contents from
171 static inline uint16_t mavlink_msg_gimbal_device_attitude_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_device_attitude_status_t* gimbal_device_attitude_status)
173 return mavlink_msg_gimbal_device_attitude_status_pack(system_id, component_id, msg, gimbal_device_attitude_status->target_system, gimbal_device_attitude_status->target_component, gimbal_device_attitude_status->time_boot_ms, gimbal_device_attitude_status->flags, gimbal_device_attitude_status->q, gimbal_device_attitude_status->angular_velocity_x, gimbal_device_attitude_status->angular_velocity_y, gimbal_device_attitude_status->angular_velocity_z, gimbal_device_attitude_status->failure_flags);
177 * @brief Encode a gimbal_device_attitude_status struct on a channel
179 * @param system_id ID of this system
180 * @param component_id ID of this component (e.g. 200 for IMU)
181 * @param chan The MAVLink channel this message will be sent over
182 * @param msg The MAVLink message to compress the data into
183 * @param gimbal_device_attitude_status C-struct to read the message contents from
185 static inline uint16_t mavlink_msg_gimbal_device_attitude_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_device_attitude_status_t* gimbal_device_attitude_status)
187 return mavlink_msg_gimbal_device_attitude_status_pack_chan(system_id, component_id, chan, msg, gimbal_device_attitude_status->target_system, gimbal_device_attitude_status->target_component, gimbal_device_attitude_status->time_boot_ms, gimbal_device_attitude_status->flags, gimbal_device_attitude_status->q, gimbal_device_attitude_status->angular_velocity_x, gimbal_device_attitude_status->angular_velocity_y, gimbal_device_attitude_status->angular_velocity_z, gimbal_device_attitude_status->failure_flags);
191 * @brief Send a gimbal_device_attitude_status message
192 * @param chan MAVLink channel to send the message
194 * @param target_system System ID
195 * @param target_component Component ID
196 * @param time_boot_ms [ms] Timestamp (time since system boot).
197 * @param flags Current gimbal flags set.
198 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
199 * @param angular_velocity_x [rad/s] X component of angular velocity (NaN if unknown)
200 * @param angular_velocity_y [rad/s] Y component of angular velocity (NaN if unknown)
201 * @param angular_velocity_z [rad/s] Z component of angular velocity (NaN if unknown)
202 * @param failure_flags Failure flags (0 for no failure)
204 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
206 static inline void mavlink_msg_gimbal_device_attitude_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t time_boot_ms, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z, uint32_t failure_flags)
208 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
209 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN];
210 _mav_put_uint32_t(buf, 0, time_boot_ms);
211 _mav_put_float(buf, 20, angular_velocity_x);
212 _mav_put_float(buf, 24, angular_velocity_y);
213 _mav_put_float(buf, 28, angular_velocity_z);
214 _mav_put_uint32_t(buf, 32, failure_flags);
215 _mav_put_uint16_t(buf, 36, flags);
216 _mav_put_uint8_t(buf, 38, target_system);
217 _mav_put_uint8_t(buf, 39, target_component);
218 _mav_put_float_array(buf, 4, q, 4);
219 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
220 #else
221 mavlink_gimbal_device_attitude_status_t packet;
222 packet.time_boot_ms = time_boot_ms;
223 packet.angular_velocity_x = angular_velocity_x;
224 packet.angular_velocity_y = angular_velocity_y;
225 packet.angular_velocity_z = angular_velocity_z;
226 packet.failure_flags = failure_flags;
227 packet.flags = flags;
228 packet.target_system = target_system;
229 packet.target_component = target_component;
230 mav_array_memcpy(packet.q, q, sizeof(float)*4);
231 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
232 #endif
236 * @brief Send a gimbal_device_attitude_status message
237 * @param chan MAVLink channel to send the message
238 * @param struct The MAVLink struct to serialize
240 static inline void mavlink_msg_gimbal_device_attitude_status_send_struct(mavlink_channel_t chan, const mavlink_gimbal_device_attitude_status_t* gimbal_device_attitude_status)
242 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 mavlink_msg_gimbal_device_attitude_status_send(chan, gimbal_device_attitude_status->target_system, gimbal_device_attitude_status->target_component, gimbal_device_attitude_status->time_boot_ms, gimbal_device_attitude_status->flags, gimbal_device_attitude_status->q, gimbal_device_attitude_status->angular_velocity_x, gimbal_device_attitude_status->angular_velocity_y, gimbal_device_attitude_status->angular_velocity_z, gimbal_device_attitude_status->failure_flags);
244 #else
245 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, (const char *)gimbal_device_attitude_status, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
246 #endif
249 #if MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
251 This varient of _send() can be used to save stack space by re-using
252 memory from the receive buffer. The caller provides a
253 mavlink_message_t which is the size of a full mavlink message. This
254 is usually the receive buffer for the channel, and allows a reply to an
255 incoming message with minimum stack space usage.
257 static inline void mavlink_msg_gimbal_device_attitude_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t time_boot_ms, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z, uint32_t failure_flags)
259 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
260 char *buf = (char *)msgbuf;
261 _mav_put_uint32_t(buf, 0, time_boot_ms);
262 _mav_put_float(buf, 20, angular_velocity_x);
263 _mav_put_float(buf, 24, angular_velocity_y);
264 _mav_put_float(buf, 28, angular_velocity_z);
265 _mav_put_uint32_t(buf, 32, failure_flags);
266 _mav_put_uint16_t(buf, 36, flags);
267 _mav_put_uint8_t(buf, 38, target_system);
268 _mav_put_uint8_t(buf, 39, target_component);
269 _mav_put_float_array(buf, 4, q, 4);
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
271 #else
272 mavlink_gimbal_device_attitude_status_t *packet = (mavlink_gimbal_device_attitude_status_t *)msgbuf;
273 packet->time_boot_ms = time_boot_ms;
274 packet->angular_velocity_x = angular_velocity_x;
275 packet->angular_velocity_y = angular_velocity_y;
276 packet->angular_velocity_z = angular_velocity_z;
277 packet->failure_flags = failure_flags;
278 packet->flags = flags;
279 packet->target_system = target_system;
280 packet->target_component = target_component;
281 mav_array_memcpy(packet->q, q, sizeof(float)*4);
282 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_CRC);
283 #endif
285 #endif
287 #endif
289 // MESSAGE GIMBAL_DEVICE_ATTITUDE_STATUS UNPACKING
293 * @brief Get field target_system from gimbal_device_attitude_status message
295 * @return System ID
297 static inline uint8_t mavlink_msg_gimbal_device_attitude_status_get_target_system(const mavlink_message_t* msg)
299 return _MAV_RETURN_uint8_t(msg, 38);
303 * @brief Get field target_component from gimbal_device_attitude_status message
305 * @return Component ID
307 static inline uint8_t mavlink_msg_gimbal_device_attitude_status_get_target_component(const mavlink_message_t* msg)
309 return _MAV_RETURN_uint8_t(msg, 39);
313 * @brief Get field time_boot_ms from gimbal_device_attitude_status message
315 * @return [ms] Timestamp (time since system boot).
317 static inline uint32_t mavlink_msg_gimbal_device_attitude_status_get_time_boot_ms(const mavlink_message_t* msg)
319 return _MAV_RETURN_uint32_t(msg, 0);
323 * @brief Get field flags from gimbal_device_attitude_status message
325 * @return Current gimbal flags set.
327 static inline uint16_t mavlink_msg_gimbal_device_attitude_status_get_flags(const mavlink_message_t* msg)
329 return _MAV_RETURN_uint16_t(msg, 36);
333 * @brief Get field q from gimbal_device_attitude_status message
335 * @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
337 static inline uint16_t mavlink_msg_gimbal_device_attitude_status_get_q(const mavlink_message_t* msg, float *q)
339 return _MAV_RETURN_float_array(msg, q, 4, 4);
343 * @brief Get field angular_velocity_x from gimbal_device_attitude_status message
345 * @return [rad/s] X component of angular velocity (NaN if unknown)
347 static inline float mavlink_msg_gimbal_device_attitude_status_get_angular_velocity_x(const mavlink_message_t* msg)
349 return _MAV_RETURN_float(msg, 20);
353 * @brief Get field angular_velocity_y from gimbal_device_attitude_status message
355 * @return [rad/s] Y component of angular velocity (NaN if unknown)
357 static inline float mavlink_msg_gimbal_device_attitude_status_get_angular_velocity_y(const mavlink_message_t* msg)
359 return _MAV_RETURN_float(msg, 24);
363 * @brief Get field angular_velocity_z from gimbal_device_attitude_status message
365 * @return [rad/s] Z component of angular velocity (NaN if unknown)
367 static inline float mavlink_msg_gimbal_device_attitude_status_get_angular_velocity_z(const mavlink_message_t* msg)
369 return _MAV_RETURN_float(msg, 28);
373 * @brief Get field failure_flags from gimbal_device_attitude_status message
375 * @return Failure flags (0 for no failure)
377 static inline uint32_t mavlink_msg_gimbal_device_attitude_status_get_failure_flags(const mavlink_message_t* msg)
379 return _MAV_RETURN_uint32_t(msg, 32);
383 * @brief Decode a gimbal_device_attitude_status message into a struct
385 * @param msg The message to decode
386 * @param gimbal_device_attitude_status C-struct to decode the message contents into
388 static inline void mavlink_msg_gimbal_device_attitude_status_decode(const mavlink_message_t* msg, mavlink_gimbal_device_attitude_status_t* gimbal_device_attitude_status)
390 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
391 gimbal_device_attitude_status->time_boot_ms = mavlink_msg_gimbal_device_attitude_status_get_time_boot_ms(msg);
392 mavlink_msg_gimbal_device_attitude_status_get_q(msg, gimbal_device_attitude_status->q);
393 gimbal_device_attitude_status->angular_velocity_x = mavlink_msg_gimbal_device_attitude_status_get_angular_velocity_x(msg);
394 gimbal_device_attitude_status->angular_velocity_y = mavlink_msg_gimbal_device_attitude_status_get_angular_velocity_y(msg);
395 gimbal_device_attitude_status->angular_velocity_z = mavlink_msg_gimbal_device_attitude_status_get_angular_velocity_z(msg);
396 gimbal_device_attitude_status->failure_flags = mavlink_msg_gimbal_device_attitude_status_get_failure_flags(msg);
397 gimbal_device_attitude_status->flags = mavlink_msg_gimbal_device_attitude_status_get_flags(msg);
398 gimbal_device_attitude_status->target_system = mavlink_msg_gimbal_device_attitude_status_get_target_system(msg);
399 gimbal_device_attitude_status->target_component = mavlink_msg_gimbal_device_attitude_status_get_target_component(msg);
400 #else
401 uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN;
402 memset(gimbal_device_attitude_status, 0, MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_LEN);
403 memcpy(gimbal_device_attitude_status, _MAV_PAYLOAD(msg), len);
404 #endif