MAV'RIC
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h
1 // MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST PACKING
2 
3 #define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST 162
4 
6 {
7  int16_t roll[4];
8  int16_t pitch[4];
9  int16_t yaw[4];
10  uint16_t thrust[4];
11  uint8_t group;
12  uint8_t mode;
14 
15 #define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN 34
16 #define MAVLINK_MSG_ID_162_LEN 34
17 
18 #define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC 240
19 #define MAVLINK_MSG_ID_162_CRC 240
20 
21 #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 4
22 #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 4
23 #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 4
24 #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_THRUST_LEN 4
25 
26 #define MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST { \
27  "SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST", \
28  6, \
29  { { "roll", NULL, MAVLINK_TYPE_INT16_T, 4, 0, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, roll) }, \
30  { "pitch", NULL, MAVLINK_TYPE_INT16_T, 4, 8, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, pitch) }, \
31  { "yaw", NULL, MAVLINK_TYPE_INT16_T, 4, 16, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, yaw) }, \
32  { "thrust", NULL, MAVLINK_TYPE_UINT16_T, 4, 24, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, thrust) }, \
33  { "group", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, group) }, \
34  { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, mode) }, \
35  } \
36 }
37 
38 
53 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
54  uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
55 {
56 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
57  char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN];
58  _mav_put_uint8_t(buf, 32, group);
59  _mav_put_uint8_t(buf, 33, mode);
60  _mav_put_int16_t_array(buf, 0, roll, 4);
61  _mav_put_int16_t_array(buf, 8, pitch, 4);
62  _mav_put_int16_t_array(buf, 16, yaw, 4);
63  _mav_put_uint16_t_array(buf, 24, thrust, 4);
64  memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
65 #else
67  packet.group = group;
68  packet.mode = mode;
69  mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
70  mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
71  mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
72  mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
73  memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
74 #endif
75 
76  msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST;
77 #if MAVLINK_CRC_EXTRA
78  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC);
79 #else
80  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
81 #endif
82 }
83 
98 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
99  mavlink_message_t* msg,
100  uint8_t group,uint8_t mode,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust)
101 {
102 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103  char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN];
104  _mav_put_uint8_t(buf, 32, group);
105  _mav_put_uint8_t(buf, 33, mode);
106  _mav_put_int16_t_array(buf, 0, roll, 4);
107  _mav_put_int16_t_array(buf, 8, pitch, 4);
108  _mav_put_int16_t_array(buf, 16, yaw, 4);
109  _mav_put_uint16_t_array(buf, 24, thrust, 4);
110  memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
111 #else
113  packet.group = group;
114  packet.mode = mode;
115  mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
116  mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
117  mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
118  mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
119  memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
120 #endif
121 
122  msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST;
123 #if MAVLINK_CRC_EXTRA
124  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC);
125 #else
126  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
127 #endif
128 }
129 
138 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust)
139 {
140  return mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(system_id, component_id, msg, set_quad_swarm_roll_pitch_yaw_thrust->group, set_quad_swarm_roll_pitch_yaw_thrust->mode, set_quad_swarm_roll_pitch_yaw_thrust->roll, set_quad_swarm_roll_pitch_yaw_thrust->pitch, set_quad_swarm_roll_pitch_yaw_thrust->yaw, set_quad_swarm_roll_pitch_yaw_thrust->thrust);
141 }
142 
152 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust)
153 {
154  return mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_chan(system_id, component_id, chan, msg, set_quad_swarm_roll_pitch_yaw_thrust->group, set_quad_swarm_roll_pitch_yaw_thrust->mode, set_quad_swarm_roll_pitch_yaw_thrust->roll, set_quad_swarm_roll_pitch_yaw_thrust->pitch, set_quad_swarm_roll_pitch_yaw_thrust->yaw, set_quad_swarm_roll_pitch_yaw_thrust->thrust);
155 }
156 
168 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
169 
170 static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
171 {
172 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
173  char buf[MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN];
174  _mav_put_uint8_t(buf, 32, group);
175  _mav_put_uint8_t(buf, 33, mode);
176  _mav_put_int16_t_array(buf, 0, roll, 4);
177  _mav_put_int16_t_array(buf, 8, pitch, 4);
178  _mav_put_int16_t_array(buf, 16, yaw, 4);
179  _mav_put_uint16_t_array(buf, 24, thrust, 4);
180 #if MAVLINK_CRC_EXTRA
181  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC);
182 #else
183  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
184 #endif
185 #else
187  packet.group = group;
188  packet.mode = mode;
189  mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
190  mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
191  mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
192  mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
193 #if MAVLINK_CRC_EXTRA
194  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC);
195 #else
196  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
197 #endif
198 #endif
199 }
200 
201 #if MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
202 /*
203  This varient of _send() can be used to save stack space by re-using
204  memory from the receive buffer. The caller provides a
205  mavlink_message_t which is the size of a full mavlink message. This
206  is usually the receive buffer for the channel, and allows a reply to an
207  incoming message with minimum stack space usage.
208  */
209 static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
210 {
211 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
212  char *buf = (char *)msgbuf;
213  _mav_put_uint8_t(buf, 32, group);
214  _mav_put_uint8_t(buf, 33, mode);
215  _mav_put_int16_t_array(buf, 0, roll, 4);
216  _mav_put_int16_t_array(buf, 8, pitch, 4);
217  _mav_put_int16_t_array(buf, 16, yaw, 4);
218  _mav_put_uint16_t_array(buf, 24, thrust, 4);
219 #if MAVLINK_CRC_EXTRA
220  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC);
221 #else
222  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
223 #endif
224 #else
226  packet->group = group;
227  packet->mode = mode;
228  mav_array_memcpy(packet->roll, roll, sizeof(int16_t)*4);
229  mav_array_memcpy(packet->pitch, pitch, sizeof(int16_t)*4);
230  mav_array_memcpy(packet->yaw, yaw, sizeof(int16_t)*4);
231  mav_array_memcpy(packet->thrust, thrust, sizeof(uint16_t)*4);
232 #if MAVLINK_CRC_EXTRA
233  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC);
234 #else
235  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)packet, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
236 #endif
237 #endif
238 }
239 #endif
240 
241 #endif
242 
243 // MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST UNPACKING
244 
245 
251 static inline uint8_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_group(const mavlink_message_t* msg)
252 {
253  return _MAV_RETURN_uint8_t(msg, 32);
254 }
255 
261 static inline uint8_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_mode(const mavlink_message_t* msg)
262 {
263  return _MAV_RETURN_uint8_t(msg, 33);
264 }
265 
271 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(const mavlink_message_t* msg, int16_t *roll)
272 {
273  return _MAV_RETURN_int16_t_array(msg, roll, 4, 0);
274 }
275 
281 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(const mavlink_message_t* msg, int16_t *pitch)
282 {
283  return _MAV_RETURN_int16_t_array(msg, pitch, 4, 8);
284 }
285 
291 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(const mavlink_message_t* msg, int16_t *yaw)
292 {
293  return _MAV_RETURN_int16_t_array(msg, yaw, 4, 16);
294 }
295 
301 static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(const mavlink_message_t* msg, uint16_t *thrust)
302 {
303  return _MAV_RETURN_uint16_t_array(msg, thrust, 4, 24);
304 }
305 
312 static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(const mavlink_message_t* msg, mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust)
313 {
314 #if MAVLINK_NEED_BYTE_SWAP
315  mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(msg, set_quad_swarm_roll_pitch_yaw_thrust->roll);
316  mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(msg, set_quad_swarm_roll_pitch_yaw_thrust->pitch);
317  mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(msg, set_quad_swarm_roll_pitch_yaw_thrust->yaw);
318  mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(msg, set_quad_swarm_roll_pitch_yaw_thrust->thrust);
319  set_quad_swarm_roll_pitch_yaw_thrust->group = mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_group(msg);
320  set_quad_swarm_roll_pitch_yaw_thrust->mode = mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_mode(msg);
321 #else
322  memcpy(set_quad_swarm_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN);
323 #endif
324 }