[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / MAVLink / common / mavlink_msg_set_attitude_target.h
blob1b68caa025bfd4acb9d4b65bd4e12a35fe657d58
1 #pragma once
2 // MESSAGE SET_ATTITUDE_TARGET PACKING
4 #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET 82
6 MAVPACKED(
7 typedef struct __mavlink_set_attitude_target_t {
8 uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
9 float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
10 float body_roll_rate; /*< Body roll rate in radians per second*/
11 float body_pitch_rate; /*< Body roll rate in radians per second*/
12 float body_yaw_rate; /*< Body roll rate in radians per second*/
13 float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/
14 uint8_t target_system; /*< System ID*/
15 uint8_t target_component; /*< Component ID*/
16 uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude*/
17 }) mavlink_set_attitude_target_t;
19 #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN 39
20 #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN 39
21 #define MAVLINK_MSG_ID_82_LEN 39
22 #define MAVLINK_MSG_ID_82_MIN_LEN 39
24 #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC 49
25 #define MAVLINK_MSG_ID_82_CRC 49
27 #define MAVLINK_MSG_SET_ATTITUDE_TARGET_FIELD_Q_LEN 4
29 #if MAVLINK_COMMAND_24BIT
30 #define MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET { \
31 82, \
32 "SET_ATTITUDE_TARGET", \
33 9, \
34 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \
35 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \
36 { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \
37 { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \
38 { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \
39 { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \
40 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \
41 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \
42 { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \
43 } \
45 #else
46 #define MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET { \
47 "SET_ATTITUDE_TARGET", \
48 9, \
49 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \
50 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \
51 { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \
52 { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \
53 { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \
54 { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \
55 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \
56 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \
57 { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \
58 } \
60 #endif
62 /**
63 * @brief Pack a set_attitude_target 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 time_boot_ms Timestamp in milliseconds since system boot
69 * @param target_system System ID
70 * @param target_component Component ID
71 * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
72 * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
73 * @param body_roll_rate Body roll rate in radians per second
74 * @param body_pitch_rate Body roll rate in radians per second
75 * @param body_yaw_rate Body roll rate in radians per second
76 * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
77 * @return length of the message in bytes (excluding serial stream start sign)
79 static inline uint16_t mavlink_msg_set_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
82 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
83 char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN];
84 _mav_put_uint32_t(buf, 0, time_boot_ms);
85 _mav_put_float(buf, 20, body_roll_rate);
86 _mav_put_float(buf, 24, body_pitch_rate);
87 _mav_put_float(buf, 28, body_yaw_rate);
88 _mav_put_float(buf, 32, thrust);
89 _mav_put_uint8_t(buf, 36, target_system);
90 _mav_put_uint8_t(buf, 37, target_component);
91 _mav_put_uint8_t(buf, 38, type_mask);
92 _mav_put_float_array(buf, 4, q, 4);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
94 #else
95 mavlink_set_attitude_target_t packet;
96 packet.time_boot_ms = time_boot_ms;
97 packet.body_roll_rate = body_roll_rate;
98 packet.body_pitch_rate = body_pitch_rate;
99 packet.body_yaw_rate = body_yaw_rate;
100 packet.thrust = thrust;
101 packet.target_system = target_system;
102 packet.target_component = target_component;
103 packet.type_mask = type_mask;
104 mav_array_memcpy(packet.q, q, sizeof(float)*4);
105 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
106 #endif
108 msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET;
109 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
113 * @brief Pack a set_attitude_target 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 time_boot_ms Timestamp in milliseconds since system boot
119 * @param target_system System ID
120 * @param target_component Component ID
121 * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
122 * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
123 * @param body_roll_rate Body roll rate in radians per second
124 * @param body_pitch_rate Body roll rate in radians per second
125 * @param body_yaw_rate Body roll rate in radians per second
126 * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
127 * @return length of the message in bytes (excluding serial stream start sign)
129 static inline uint16_t mavlink_msg_set_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
130 mavlink_message_t* msg,
131 uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust)
133 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN];
135 _mav_put_uint32_t(buf, 0, time_boot_ms);
136 _mav_put_float(buf, 20, body_roll_rate);
137 _mav_put_float(buf, 24, body_pitch_rate);
138 _mav_put_float(buf, 28, body_yaw_rate);
139 _mav_put_float(buf, 32, thrust);
140 _mav_put_uint8_t(buf, 36, target_system);
141 _mav_put_uint8_t(buf, 37, target_component);
142 _mav_put_uint8_t(buf, 38, type_mask);
143 _mav_put_float_array(buf, 4, q, 4);
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
145 #else
146 mavlink_set_attitude_target_t packet;
147 packet.time_boot_ms = time_boot_ms;
148 packet.body_roll_rate = body_roll_rate;
149 packet.body_pitch_rate = body_pitch_rate;
150 packet.body_yaw_rate = body_yaw_rate;
151 packet.thrust = thrust;
152 packet.target_system = target_system;
153 packet.target_component = target_component;
154 packet.type_mask = type_mask;
155 mav_array_memcpy(packet.q, q, sizeof(float)*4);
156 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
157 #endif
159 msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET;
160 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
164 * @brief Encode a set_attitude_target 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 set_attitude_target C-struct to read the message contents from
171 static inline uint16_t mavlink_msg_set_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_attitude_target_t* set_attitude_target)
173 return mavlink_msg_set_attitude_target_pack(system_id, component_id, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust);
177 * @brief Encode a set_attitude_target 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 set_attitude_target C-struct to read the message contents from
185 static inline uint16_t mavlink_msg_set_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_attitude_target_t* set_attitude_target)
187 return mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, chan, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust);
191 * @brief Send a set_attitude_target message
192 * @param chan MAVLink channel to send the message
194 * @param time_boot_ms Timestamp in milliseconds since system boot
195 * @param target_system System ID
196 * @param target_component Component ID
197 * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
198 * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
199 * @param body_roll_rate Body roll rate in radians per second
200 * @param body_pitch_rate Body roll rate in radians per second
201 * @param body_yaw_rate Body roll rate in radians per second
202 * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
204 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
206 static inline void mavlink_msg_set_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
208 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
209 char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN];
210 _mav_put_uint32_t(buf, 0, time_boot_ms);
211 _mav_put_float(buf, 20, body_roll_rate);
212 _mav_put_float(buf, 24, body_pitch_rate);
213 _mav_put_float(buf, 28, body_yaw_rate);
214 _mav_put_float(buf, 32, thrust);
215 _mav_put_uint8_t(buf, 36, target_system);
216 _mav_put_uint8_t(buf, 37, target_component);
217 _mav_put_uint8_t(buf, 38, type_mask);
218 _mav_put_float_array(buf, 4, q, 4);
219 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
220 #else
221 mavlink_set_attitude_target_t packet;
222 packet.time_boot_ms = time_boot_ms;
223 packet.body_roll_rate = body_roll_rate;
224 packet.body_pitch_rate = body_pitch_rate;
225 packet.body_yaw_rate = body_yaw_rate;
226 packet.thrust = thrust;
227 packet.target_system = target_system;
228 packet.target_component = target_component;
229 packet.type_mask = type_mask;
230 mav_array_memcpy(packet.q, q, sizeof(float)*4);
231 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
232 #endif
236 * @brief Send a set_attitude_target message
237 * @param chan MAVLink channel to send the message
238 * @param struct The MAVLink struct to serialize
240 static inline void mavlink_msg_set_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_set_attitude_target_t* set_attitude_target)
242 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 mavlink_msg_set_attitude_target_send(chan, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust);
244 #else
245 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)set_attitude_target, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
246 #endif
249 #if MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_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_set_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
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, body_roll_rate);
263 _mav_put_float(buf, 24, body_pitch_rate);
264 _mav_put_float(buf, 28, body_yaw_rate);
265 _mav_put_float(buf, 32, thrust);
266 _mav_put_uint8_t(buf, 36, target_system);
267 _mav_put_uint8_t(buf, 37, target_component);
268 _mav_put_uint8_t(buf, 38, type_mask);
269 _mav_put_float_array(buf, 4, q, 4);
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
271 #else
272 mavlink_set_attitude_target_t *packet = (mavlink_set_attitude_target_t *)msgbuf;
273 packet->time_boot_ms = time_boot_ms;
274 packet->body_roll_rate = body_roll_rate;
275 packet->body_pitch_rate = body_pitch_rate;
276 packet->body_yaw_rate = body_yaw_rate;
277 packet->thrust = thrust;
278 packet->target_system = target_system;
279 packet->target_component = target_component;
280 packet->type_mask = type_mask;
281 mav_array_memcpy(packet->q, q, sizeof(float)*4);
282 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
283 #endif
285 #endif
287 #endif
289 // MESSAGE SET_ATTITUDE_TARGET UNPACKING
293 * @brief Get field time_boot_ms from set_attitude_target message
295 * @return Timestamp in milliseconds since system boot
297 static inline uint32_t mavlink_msg_set_attitude_target_get_time_boot_ms(const mavlink_message_t* msg)
299 return _MAV_RETURN_uint32_t(msg, 0);
303 * @brief Get field target_system from set_attitude_target message
305 * @return System ID
307 static inline uint8_t mavlink_msg_set_attitude_target_get_target_system(const mavlink_message_t* msg)
309 return _MAV_RETURN_uint8_t(msg, 36);
313 * @brief Get field target_component from set_attitude_target message
315 * @return Component ID
317 static inline uint8_t mavlink_msg_set_attitude_target_get_target_component(const mavlink_message_t* msg)
319 return _MAV_RETURN_uint8_t(msg, 37);
323 * @brief Get field type_mask from set_attitude_target message
325 * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
327 static inline uint8_t mavlink_msg_set_attitude_target_get_type_mask(const mavlink_message_t* msg)
329 return _MAV_RETURN_uint8_t(msg, 38);
333 * @brief Get field q from set_attitude_target message
335 * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
337 static inline uint16_t mavlink_msg_set_attitude_target_get_q(const mavlink_message_t* msg, float *q)
339 return _MAV_RETURN_float_array(msg, q, 4, 4);
343 * @brief Get field body_roll_rate from set_attitude_target message
345 * @return Body roll rate in radians per second
347 static inline float mavlink_msg_set_attitude_target_get_body_roll_rate(const mavlink_message_t* msg)
349 return _MAV_RETURN_float(msg, 20);
353 * @brief Get field body_pitch_rate from set_attitude_target message
355 * @return Body roll rate in radians per second
357 static inline float mavlink_msg_set_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg)
359 return _MAV_RETURN_float(msg, 24);
363 * @brief Get field body_yaw_rate from set_attitude_target message
365 * @return Body roll rate in radians per second
367 static inline float mavlink_msg_set_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg)
369 return _MAV_RETURN_float(msg, 28);
373 * @brief Get field thrust from set_attitude_target message
375 * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
377 static inline float mavlink_msg_set_attitude_target_get_thrust(const mavlink_message_t* msg)
379 return _MAV_RETURN_float(msg, 32);
383 * @brief Decode a set_attitude_target message into a struct
385 * @param msg The message to decode
386 * @param set_attitude_target C-struct to decode the message contents into
388 static inline void mavlink_msg_set_attitude_target_decode(const mavlink_message_t* msg, mavlink_set_attitude_target_t* set_attitude_target)
390 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
391 set_attitude_target->time_boot_ms = mavlink_msg_set_attitude_target_get_time_boot_ms(msg);
392 mavlink_msg_set_attitude_target_get_q(msg, set_attitude_target->q);
393 set_attitude_target->body_roll_rate = mavlink_msg_set_attitude_target_get_body_roll_rate(msg);
394 set_attitude_target->body_pitch_rate = mavlink_msg_set_attitude_target_get_body_pitch_rate(msg);
395 set_attitude_target->body_yaw_rate = mavlink_msg_set_attitude_target_get_body_yaw_rate(msg);
396 set_attitude_target->thrust = mavlink_msg_set_attitude_target_get_thrust(msg);
397 set_attitude_target->target_system = mavlink_msg_set_attitude_target_get_target_system(msg);
398 set_attitude_target->target_component = mavlink_msg_set_attitude_target_get_target_component(msg);
399 set_attitude_target->type_mask = mavlink_msg_set_attitude_target_get_type_mask(msg);
400 #else
401 uint8_t len = msg->len < MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN;
402 memset(set_attitude_target, 0, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
403 memcpy(set_attitude_target, _MAV_PAYLOAD(msg), len);
404 #endif