Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_gimbal_device_set_attitude.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE GIMBAL_DEVICE_SET_ATTITUDE PACKING
3
4#define MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE 284
5
6
8 float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.*/
9 float angular_velocity_x; /*< [rad/s] X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.*/
10 float angular_velocity_y; /*< [rad/s] Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.*/
11 float angular_velocity_z; /*< [rad/s] Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.*/
12 uint16_t flags; /*< Low level gimbal flags.*/
13 uint8_t target_system; /*< System ID*/
14 uint8_t target_component; /*< Component ID*/
15} mavlink_gimbal_device_set_attitude_t;
16
17#define MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN 32
18#define MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN 32
19#define MAVLINK_MSG_ID_284_LEN 32
20#define MAVLINK_MSG_ID_284_MIN_LEN 32
21
22#define MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC 99
23#define MAVLINK_MSG_ID_284_CRC 99
24
25#define MAVLINK_MSG_GIMBAL_DEVICE_SET_ATTITUDE_FIELD_Q_LEN 4
26
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_SET_ATTITUDE {
29 284,
30 "GIMBAL_DEVICE_SET_ATTITUDE",
31 7,
32 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gimbal_device_set_attitude_t, target_system) },
33 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gimbal_device_set_attitude_t, target_component) },
34 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gimbal_device_set_attitude_t, flags) },
35 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 0, offsetof(mavlink_gimbal_device_set_attitude_t, q) },
36 { "angular_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_device_set_attitude_t, angular_velocity_x) },
37 { "angular_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_set_attitude_t, angular_velocity_y) },
38 { "angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_set_attitude_t, angular_velocity_z) },
39 } \
40}
41#else
42#define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_SET_ATTITUDE {
43 "GIMBAL_DEVICE_SET_ATTITUDE",
44 7,
45 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gimbal_device_set_attitude_t, target_system) },
46 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gimbal_device_set_attitude_t, target_component) },
47 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gimbal_device_set_attitude_t, flags) },
48 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 0, offsetof(mavlink_gimbal_device_set_attitude_t, q) },
49 { "angular_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_device_set_attitude_t, angular_velocity_x) },
50 { "angular_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_set_attitude_t, angular_velocity_y) },
51 { "angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_set_attitude_t, angular_velocity_z) },
52 } \
53}
54#endif
55
56/**
57 * @brief Pack a gimbal_device_set_attitude 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
61 *
62 * @param target_system System ID
63 * @param target_component Component ID
64 * @param flags Low level gimbal flags.
65 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.
66 * @param angular_velocity_x [rad/s] X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.
67 * @param angular_velocity_y [rad/s] Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.
68 * @param angular_velocity_z [rad/s] Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.
69 * @return length of the message in bytes (excluding serial stream start sign)
70 */
71static inline uint16_t mavlink_msg_gimbal_device_set_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72 uint8_t target_system, uint8_t target_component, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z)
73{
74#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
76 _mav_put_float(buf, 16, angular_velocity_x);
77 _mav_put_float(buf, 20, angular_velocity_y);
78 _mav_put_float(buf, 24, angular_velocity_z);
79 _mav_put_uint16_t(buf, 28, flags);
80 _mav_put_uint8_t(buf, 30, target_system);
81 _mav_put_uint8_t(buf, 31, target_component);
82 _mav_put_float_array(buf, 0, q, 4);
83 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
84#else
85 mavlink_gimbal_device_set_attitude_t packet;
86 packet.angular_velocity_x = angular_velocity_x;
87 packet.angular_velocity_y = angular_velocity_y;
88 packet.angular_velocity_z = angular_velocity_z;
89 packet.flags = flags;
90 packet.target_system = target_system;
91 packet.target_component = target_component;
92 mav_array_memcpy(packet.q, q, sizeof(float)*4);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
94#endif
95
98}
99
100/**
101 * @brief Pack a gimbal_device_set_attitude message
102 * @param system_id ID of this system
103 * @param component_id ID of this component (e.g. 200 for IMU)
104 * @param status MAVLink status structure
105 * @param msg The MAVLink message to compress the data into
106 *
107 * @param target_system System ID
108 * @param target_component Component ID
109 * @param flags Low level gimbal flags.
110 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.
111 * @param angular_velocity_x [rad/s] X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.
112 * @param angular_velocity_y [rad/s] Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.
113 * @param angular_velocity_z [rad/s] Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.
114 * @return length of the message in bytes (excluding serial stream start sign)
115 */
116static inline uint16_t mavlink_msg_gimbal_device_set_attitude_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
117 uint8_t target_system, uint8_t target_component, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z)
118{
119#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
121 _mav_put_float(buf, 16, angular_velocity_x);
122 _mav_put_float(buf, 20, angular_velocity_y);
123 _mav_put_float(buf, 24, angular_velocity_z);
124 _mav_put_uint16_t(buf, 28, flags);
125 _mav_put_uint8_t(buf, 30, target_system);
126 _mav_put_uint8_t(buf, 31, target_component);
127 _mav_put_float_array(buf, 0, q, 4);
128 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
129#else
130 mavlink_gimbal_device_set_attitude_t packet;
131 packet.angular_velocity_x = angular_velocity_x;
132 packet.angular_velocity_y = angular_velocity_y;
133 packet.angular_velocity_z = angular_velocity_z;
134 packet.flags = flags;
135 packet.target_system = target_system;
136 packet.target_component = target_component;
137 mav_array_memcpy(packet.q, q, sizeof(float)*4);
138 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
139#endif
140
142#if MAVLINK_CRC_EXTRA
143 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC);
144#else
145 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
146#endif
147}
148
149/**
150 * @brief Pack a gimbal_device_set_attitude message on a channel
151 * @param system_id ID of this system
152 * @param component_id ID of this component (e.g. 200 for IMU)
153 * @param chan The MAVLink channel this message will be sent over
154 * @param msg The MAVLink message to compress the data into
155 * @param target_system System ID
156 * @param target_component Component ID
157 * @param flags Low level gimbal flags.
158 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.
159 * @param angular_velocity_x [rad/s] X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.
160 * @param angular_velocity_y [rad/s] Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.
161 * @param angular_velocity_z [rad/s] Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.
162 * @return length of the message in bytes (excluding serial stream start sign)
163 */
164static inline uint16_t mavlink_msg_gimbal_device_set_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
165 mavlink_message_t* msg,
166 uint8_t target_system,uint8_t target_component,uint16_t flags,const float *q,float angular_velocity_x,float angular_velocity_y,float angular_velocity_z)
167{
168#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
170 _mav_put_float(buf, 16, angular_velocity_x);
171 _mav_put_float(buf, 20, angular_velocity_y);
172 _mav_put_float(buf, 24, angular_velocity_z);
173 _mav_put_uint16_t(buf, 28, flags);
174 _mav_put_uint8_t(buf, 30, target_system);
175 _mav_put_uint8_t(buf, 31, target_component);
176 _mav_put_float_array(buf, 0, q, 4);
177 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
178#else
179 mavlink_gimbal_device_set_attitude_t packet;
180 packet.angular_velocity_x = angular_velocity_x;
181 packet.angular_velocity_y = angular_velocity_y;
182 packet.angular_velocity_z = angular_velocity_z;
183 packet.flags = flags;
184 packet.target_system = target_system;
185 packet.target_component = target_component;
186 mav_array_memcpy(packet.q, q, sizeof(float)*4);
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
188#endif
189
192}
193
194/**
195 * @brief Encode a gimbal_device_set_attitude struct
196 *
197 * @param system_id ID of this system
198 * @param component_id ID of this component (e.g. 200 for IMU)
199 * @param msg The MAVLink message to compress the data into
200 * @param gimbal_device_set_attitude C-struct to read the message contents from
201 */
202static inline uint16_t mavlink_msg_gimbal_device_set_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_device_set_attitude_t* gimbal_device_set_attitude)
203{
204 return mavlink_msg_gimbal_device_set_attitude_pack(system_id, component_id, msg, gimbal_device_set_attitude->target_system, gimbal_device_set_attitude->target_component, gimbal_device_set_attitude->flags, gimbal_device_set_attitude->q, gimbal_device_set_attitude->angular_velocity_x, gimbal_device_set_attitude->angular_velocity_y, gimbal_device_set_attitude->angular_velocity_z);
205}
206
207/**
208 * @brief Encode a gimbal_device_set_attitude struct on a channel
209 *
210 * @param system_id ID of this system
211 * @param component_id ID of this component (e.g. 200 for IMU)
212 * @param chan The MAVLink channel this message will be sent over
213 * @param msg The MAVLink message to compress the data into
214 * @param gimbal_device_set_attitude C-struct to read the message contents from
215 */
216static inline uint16_t mavlink_msg_gimbal_device_set_attitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_device_set_attitude_t* gimbal_device_set_attitude)
217{
218 return mavlink_msg_gimbal_device_set_attitude_pack_chan(system_id, component_id, chan, msg, gimbal_device_set_attitude->target_system, gimbal_device_set_attitude->target_component, gimbal_device_set_attitude->flags, gimbal_device_set_attitude->q, gimbal_device_set_attitude->angular_velocity_x, gimbal_device_set_attitude->angular_velocity_y, gimbal_device_set_attitude->angular_velocity_z);
219}
220
221/**
222 * @brief Encode a gimbal_device_set_attitude struct with provided status structure
223 *
224 * @param system_id ID of this system
225 * @param component_id ID of this component (e.g. 200 for IMU)
226 * @param status MAVLink status structure
227 * @param msg The MAVLink message to compress the data into
228 * @param gimbal_device_set_attitude C-struct to read the message contents from
229 */
230static inline uint16_t mavlink_msg_gimbal_device_set_attitude_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_gimbal_device_set_attitude_t* gimbal_device_set_attitude)
231{
232 return mavlink_msg_gimbal_device_set_attitude_pack_status(system_id, component_id, _status, msg, gimbal_device_set_attitude->target_system, gimbal_device_set_attitude->target_component, gimbal_device_set_attitude->flags, gimbal_device_set_attitude->q, gimbal_device_set_attitude->angular_velocity_x, gimbal_device_set_attitude->angular_velocity_y, gimbal_device_set_attitude->angular_velocity_z);
233}
234
235/**
236 * @brief Send a gimbal_device_set_attitude message
237 * @param chan MAVLink channel to send the message
238 *
239 * @param target_system System ID
240 * @param target_component Component ID
241 * @param flags Low level gimbal flags.
242 * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.
243 * @param angular_velocity_x [rad/s] X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.
244 * @param angular_velocity_y [rad/s] Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.
245 * @param angular_velocity_z [rad/s] Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.
246 */
247#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
248
249static inline void mavlink_msg_gimbal_device_set_attitude_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z)
250{
251#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
252 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN];
253 _mav_put_float(buf, 16, angular_velocity_x);
254 _mav_put_float(buf, 20, angular_velocity_y);
255 _mav_put_float(buf, 24, angular_velocity_z);
256 _mav_put_uint16_t(buf, 28, flags);
257 _mav_put_uint8_t(buf, 30, target_system);
258 _mav_put_uint8_t(buf, 31, target_component);
259 _mav_put_float_array(buf, 0, q, 4);
260 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC);
261#else
262 mavlink_gimbal_device_set_attitude_t packet;
263 packet.angular_velocity_x = angular_velocity_x;
264 packet.angular_velocity_y = angular_velocity_y;
265 packet.angular_velocity_z = angular_velocity_z;
266 packet.flags = flags;
267 packet.target_system = target_system;
268 packet.target_component = target_component;
269 mav_array_memcpy(packet.q, q, sizeof(float)*4);
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC);
271#endif
272}
273
274/**
275 * @brief Send a gimbal_device_set_attitude message
276 * @param chan MAVLink channel to send the message
277 * @param struct The MAVLink struct to serialize
278 */
279static inline void mavlink_msg_gimbal_device_set_attitude_send_struct(mavlink_channel_t chan, const mavlink_gimbal_device_set_attitude_t* gimbal_device_set_attitude)
280{
281#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
282 mavlink_msg_gimbal_device_set_attitude_send(chan, gimbal_device_set_attitude->target_system, gimbal_device_set_attitude->target_component, gimbal_device_set_attitude->flags, gimbal_device_set_attitude->q, gimbal_device_set_attitude->angular_velocity_x, gimbal_device_set_attitude->angular_velocity_y, gimbal_device_set_attitude->angular_velocity_z);
283#else
284 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE, (const char *)gimbal_device_set_attitude, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC);
285#endif
286}
287
288#if MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
289/*
290 This variant of _send() can be used to save stack space by reusing
291 memory from the receive buffer. The caller provides a
292 mavlink_message_t which is the size of a full mavlink message. This
293 is usually the receive buffer for the channel, and allows a reply to an
294 incoming message with minimum stack space usage.
295 */
296static inline void mavlink_msg_gimbal_device_set_attitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t flags, const float *q, float angular_velocity_x, float angular_velocity_y, float angular_velocity_z)
297{
298#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
299 char *buf = (char *)msgbuf;
300 _mav_put_float(buf, 16, angular_velocity_x);
301 _mav_put_float(buf, 20, angular_velocity_y);
302 _mav_put_float(buf, 24, angular_velocity_z);
303 _mav_put_uint16_t(buf, 28, flags);
304 _mav_put_uint8_t(buf, 30, target_system);
305 _mav_put_uint8_t(buf, 31, target_component);
306 _mav_put_float_array(buf, 0, q, 4);
307 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC);
308#else
309 mavlink_gimbal_device_set_attitude_t *packet = (mavlink_gimbal_device_set_attitude_t *)msgbuf;
310 packet->angular_velocity_x = angular_velocity_x;
311 packet->angular_velocity_y = angular_velocity_y;
312 packet->angular_velocity_z = angular_velocity_z;
313 packet->flags = flags;
314 packet->target_system = target_system;
315 packet->target_component = target_component;
316 mav_array_memcpy(packet->q, q, sizeof(float)*4);
317 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_CRC);
318#endif
319}
320#endif
321
322#endif
323
324// MESSAGE GIMBAL_DEVICE_SET_ATTITUDE UNPACKING
325
326
327/**
328 * @brief Get field target_system from gimbal_device_set_attitude message
329 *
330 * @return System ID
331 */
332static inline uint8_t mavlink_msg_gimbal_device_set_attitude_get_target_system(const mavlink_message_t* msg)
333{
334 return _MAV_RETURN_uint8_t(msg, 30);
335}
336
337/**
338 * @brief Get field target_component from gimbal_device_set_attitude message
339 *
340 * @return Component ID
341 */
342static inline uint8_t mavlink_msg_gimbal_device_set_attitude_get_target_component(const mavlink_message_t* msg)
343{
344 return _MAV_RETURN_uint8_t(msg, 31);
345}
346
347/**
348 * @brief Get field flags from gimbal_device_set_attitude message
349 *
350 * @return Low level gimbal flags.
351 */
352static inline uint16_t mavlink_msg_gimbal_device_set_attitude_get_flags(const mavlink_message_t* msg)
353{
354 return _MAV_RETURN_uint16_t(msg, 28);
355}
356
357/**
358 * @brief Get field q from gimbal_device_set_attitude message
359 *
360 * @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.
361 */
362static inline uint16_t mavlink_msg_gimbal_device_set_attitude_get_q(const mavlink_message_t* msg, float *q)
363{
364 return _MAV_RETURN_float_array(msg, q, 4, 0);
365}
366
367/**
368 * @brief Get field angular_velocity_x from gimbal_device_set_attitude message
369 *
370 * @return [rad/s] X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.
371 */
372static inline float mavlink_msg_gimbal_device_set_attitude_get_angular_velocity_x(const mavlink_message_t* msg)
373{
374 return _MAV_RETURN_float(msg, 16);
375}
376
377/**
378 * @brief Get field angular_velocity_y from gimbal_device_set_attitude message
379 *
380 * @return [rad/s] Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.
381 */
382static inline float mavlink_msg_gimbal_device_set_attitude_get_angular_velocity_y(const mavlink_message_t* msg)
383{
384 return _MAV_RETURN_float(msg, 20);
385}
386
387/**
388 * @brief Get field angular_velocity_z from gimbal_device_set_attitude message
389 *
390 * @return [rad/s] Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.
391 */
392static inline float mavlink_msg_gimbal_device_set_attitude_get_angular_velocity_z(const mavlink_message_t* msg)
393{
394 return _MAV_RETURN_float(msg, 24);
395}
396
397/**
398 * @brief Decode a gimbal_device_set_attitude message into a struct
399 *
400 * @param msg The message to decode
401 * @param gimbal_device_set_attitude C-struct to decode the message contents into
402 */
403static inline void mavlink_msg_gimbal_device_set_attitude_decode(const mavlink_message_t* msg, mavlink_gimbal_device_set_attitude_t* gimbal_device_set_attitude)
404{
405#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
406 mavlink_msg_gimbal_device_set_attitude_get_q(msg, gimbal_device_set_attitude->q);
407 gimbal_device_set_attitude->angular_velocity_x = mavlink_msg_gimbal_device_set_attitude_get_angular_velocity_x(msg);
408 gimbal_device_set_attitude->angular_velocity_y = mavlink_msg_gimbal_device_set_attitude_get_angular_velocity_y(msg);
409 gimbal_device_set_attitude->angular_velocity_z = mavlink_msg_gimbal_device_set_attitude_get_angular_velocity_z(msg);
410 gimbal_device_set_attitude->flags = mavlink_msg_gimbal_device_set_attitude_get_flags(msg);
411 gimbal_device_set_attitude->target_system = mavlink_msg_gimbal_device_set_attitude_get_target_system(msg);
412 gimbal_device_set_attitude->target_component = mavlink_msg_gimbal_device_set_attitude_get_target_component(msg);
413#else
414 uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN;
415 memset(gimbal_device_set_attitude, 0, MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_LEN);
416 memcpy(gimbal_device_set_attitude, _MAV_PAYLOAD(msg), len);
417#endif
418}