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