Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | // MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST PACKING |
2 | |||
3 | #define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST 61 |
||
4 | |||
5 | typedef struct __mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t |
||
6 | { |
||
7 | int16_t roll[6]; ///< Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
8 | int16_t pitch[6]; ///< Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
9 | int16_t yaw[6]; ///< Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
10 | uint16_t thrust[6]; ///< Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 |
||
11 | uint8_t target_systems[6]; ///< System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs |
||
12 | } mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t; |
||
13 | |||
14 | #define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN 54 |
||
15 | #define MAVLINK_MSG_ID_61_LEN 54 |
||
16 | |||
17 | #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 6 |
||
18 | #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 6 |
||
19 | #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 6 |
||
20 | #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_THRUST_LEN 6 |
||
21 | #define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_TARGET_SYSTEMS_LEN 6 |
||
22 | |||
23 | #define MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST { \ |
||
24 | "SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST", \ |
||
25 | 5, \ |
||
26 | { { "roll", NULL, MAVLINK_TYPE_INT16_T, 6, 0, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, roll) }, \ |
||
27 | { "pitch", NULL, MAVLINK_TYPE_INT16_T, 6, 12, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, pitch) }, \ |
||
28 | { "yaw", NULL, MAVLINK_TYPE_INT16_T, 6, 24, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, yaw) }, \ |
||
29 | { "thrust", NULL, MAVLINK_TYPE_UINT16_T, 6, 36, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, thrust) }, \ |
||
30 | { "target_systems", NULL, MAVLINK_TYPE_UINT8_T, 6, 48, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, target_systems) }, \ |
||
31 | } \ |
||
32 | } |
||
33 | |||
34 | |||
35 | /** |
||
36 | * @brief Pack a set_quad_swarm_roll_pitch_yaw_thrust message |
||
37 | * @param system_id ID of this system |
||
38 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
39 | * @param msg The MAVLink message to compress the data into |
||
40 | * |
||
41 | * @param target_systems System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs |
||
42 | * @param roll Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
43 | * @param pitch Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
44 | * @param yaw Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
45 | * @param thrust Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 |
||
46 | * @return length of the message in bytes (excluding serial stream start sign) |
||
47 | */ |
||
48 | 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, |
||
49 | const uint8_t *target_systems, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) |
||
50 | { |
||
51 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
52 | char buf[54]; |
||
53 | |||
54 | _mav_put_int16_t_array(buf, 0, roll, 6); |
||
55 | _mav_put_int16_t_array(buf, 12, pitch, 6); |
||
56 | _mav_put_int16_t_array(buf, 24, yaw, 6); |
||
57 | _mav_put_uint16_t_array(buf, 36, thrust, 6); |
||
58 | _mav_put_uint8_t_array(buf, 48, target_systems, 6); |
||
59 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54); |
||
60 | #else |
||
61 | mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; |
||
62 | |||
63 | mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*6); |
||
64 | mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*6); |
||
65 | mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*6); |
||
66 | mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*6); |
||
67 | mav_array_memcpy(packet.target_systems, target_systems, sizeof(uint8_t)*6); |
||
68 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54); |
||
69 | #endif |
||
70 | |||
71 | msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; |
||
72 | return mavlink_finalize_message(msg, system_id, component_id, 54, 200); |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @brief Pack a set_quad_swarm_roll_pitch_yaw_thrust message on a channel |
||
77 | * @param system_id ID of this system |
||
78 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
79 | * @param chan The MAVLink channel this message was sent over |
||
80 | * @param msg The MAVLink message to compress the data into |
||
81 | * @param target_systems System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs |
||
82 | * @param roll Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
83 | * @param pitch Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
84 | * @param yaw Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
85 | * @param thrust Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 |
||
86 | * @return length of the message in bytes (excluding serial stream start sign) |
||
87 | */ |
||
88 | 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, |
||
89 | mavlink_message_t* msg, |
||
90 | const uint8_t *target_systems,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust) |
||
91 | { |
||
92 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
93 | char buf[54]; |
||
94 | |||
95 | _mav_put_int16_t_array(buf, 0, roll, 6); |
||
96 | _mav_put_int16_t_array(buf, 12, pitch, 6); |
||
97 | _mav_put_int16_t_array(buf, 24, yaw, 6); |
||
98 | _mav_put_uint16_t_array(buf, 36, thrust, 6); |
||
99 | _mav_put_uint8_t_array(buf, 48, target_systems, 6); |
||
100 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54); |
||
101 | #else |
||
102 | mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; |
||
103 | |||
104 | mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*6); |
||
105 | mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*6); |
||
106 | mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*6); |
||
107 | mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*6); |
||
108 | mav_array_memcpy(packet.target_systems, target_systems, sizeof(uint8_t)*6); |
||
109 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54); |
||
110 | #endif |
||
111 | |||
112 | msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; |
||
113 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 54, 200); |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * @brief Encode a set_quad_swarm_roll_pitch_yaw_thrust struct into a message |
||
118 | * |
||
119 | * @param system_id ID of this system |
||
120 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
121 | * @param msg The MAVLink message to compress the data into |
||
122 | * @param set_quad_swarm_roll_pitch_yaw_thrust C-struct to read the message contents from |
||
123 | */ |
||
124 | 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) |
||
125 | { |
||
126 | return mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(system_id, component_id, msg, set_quad_swarm_roll_pitch_yaw_thrust->target_systems, 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); |
||
127 | } |
||
128 | |||
129 | /** |
||
130 | * @brief Send a set_quad_swarm_roll_pitch_yaw_thrust message |
||
131 | * @param chan MAVLink channel to send the message |
||
132 | * |
||
133 | * @param target_systems System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs |
||
134 | * @param roll Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
135 | * @param pitch Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
136 | * @param yaw Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
137 | * @param thrust Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 |
||
138 | */ |
||
139 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
||
140 | |||
141 | static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, const uint8_t *target_systems, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) |
||
142 | { |
||
143 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
144 | char buf[54]; |
||
145 | |||
146 | _mav_put_int16_t_array(buf, 0, roll, 6); |
||
147 | _mav_put_int16_t_array(buf, 12, pitch, 6); |
||
148 | _mav_put_int16_t_array(buf, 24, yaw, 6); |
||
149 | _mav_put_uint16_t_array(buf, 36, thrust, 6); |
||
150 | _mav_put_uint8_t_array(buf, 48, target_systems, 6); |
||
151 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, 54, 200); |
||
152 | #else |
||
153 | mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; |
||
154 | |||
155 | mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*6); |
||
156 | mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*6); |
||
157 | mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*6); |
||
158 | mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*6); |
||
159 | mav_array_memcpy(packet.target_systems, target_systems, sizeof(uint8_t)*6); |
||
160 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 54, 200); |
||
161 | #endif |
||
162 | } |
||
163 | |||
164 | #endif |
||
165 | |||
166 | // MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST UNPACKING |
||
167 | |||
168 | |||
169 | /** |
||
170 | * @brief Get field target_systems from set_quad_swarm_roll_pitch_yaw_thrust message |
||
171 | * |
||
172 | * @return System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs |
||
173 | */ |
||
174 | static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_target_systems(const mavlink_message_t* msg, uint8_t *target_systems) |
||
175 | { |
||
176 | return _MAV_RETURN_uint8_t_array(msg, target_systems, 6, 48); |
||
177 | } |
||
178 | |||
179 | /** |
||
180 | * @brief Get field roll from set_quad_swarm_roll_pitch_yaw_thrust message |
||
181 | * |
||
182 | * @return Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
183 | */ |
||
184 | static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(const mavlink_message_t* msg, int16_t *roll) |
||
185 | { |
||
186 | return _MAV_RETURN_int16_t_array(msg, roll, 6, 0); |
||
187 | } |
||
188 | |||
189 | /** |
||
190 | * @brief Get field pitch from set_quad_swarm_roll_pitch_yaw_thrust message |
||
191 | * |
||
192 | * @return Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
193 | */ |
||
194 | static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(const mavlink_message_t* msg, int16_t *pitch) |
||
195 | { |
||
196 | return _MAV_RETURN_int16_t_array(msg, pitch, 6, 12); |
||
197 | } |
||
198 | |||
199 | /** |
||
200 | * @brief Get field yaw from set_quad_swarm_roll_pitch_yaw_thrust message |
||
201 | * |
||
202 | * @return Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 |
||
203 | */ |
||
204 | static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(const mavlink_message_t* msg, int16_t *yaw) |
||
205 | { |
||
206 | return _MAV_RETURN_int16_t_array(msg, yaw, 6, 24); |
||
207 | } |
||
208 | |||
209 | /** |
||
210 | * @brief Get field thrust from set_quad_swarm_roll_pitch_yaw_thrust message |
||
211 | * |
||
212 | * @return Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 |
||
213 | */ |
||
214 | static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(const mavlink_message_t* msg, uint16_t *thrust) |
||
215 | { |
||
216 | return _MAV_RETURN_uint16_t_array(msg, thrust, 6, 36); |
||
217 | } |
||
218 | |||
219 | /** |
||
220 | * @brief Decode a set_quad_swarm_roll_pitch_yaw_thrust message into a struct |
||
221 | * |
||
222 | * @param msg The message to decode |
||
223 | * @param set_quad_swarm_roll_pitch_yaw_thrust C-struct to decode the message contents into |
||
224 | */ |
||
225 | 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) |
||
226 | { |
||
227 | #if MAVLINK_NEED_BYTE_SWAP |
||
228 | mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(msg, set_quad_swarm_roll_pitch_yaw_thrust->roll); |
||
229 | mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(msg, set_quad_swarm_roll_pitch_yaw_thrust->pitch); |
||
230 | mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(msg, set_quad_swarm_roll_pitch_yaw_thrust->yaw); |
||
231 | mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(msg, set_quad_swarm_roll_pitch_yaw_thrust->thrust); |
||
232 | mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_target_systems(msg, set_quad_swarm_roll_pitch_yaw_thrust->target_systems); |
||
233 | #else |
||
234 | memcpy(set_quad_swarm_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 54); |
||
235 | #endif |
||
236 | } |