MAV'RIC
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint.h
1 // MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT PACKING
2 
3 #define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT 165
4 
6 {
7  uint32_t time_boot_ms;
8  float roll_rate;
9  float pitch_rate;
10  float yaw_rate;
11  float thrust;
13 
14 #define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN 20
15 #define MAVLINK_MSG_ID_165_LEN 20
16 
17 #define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC 127
18 #define MAVLINK_MSG_ID_165_CRC 127
19 
20 
21 
22 #define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT { \
23  "ROLL_PITCH_YAW_RATES_THRUST_SETPOINT", \
24  5, \
25  { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, time_boot_ms) }, \
26  { "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, roll_rate) }, \
27  { "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, pitch_rate) }, \
28  { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, yaw_rate) }, \
29  { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, thrust) }, \
30  } \
31 }
32 
33 
47 static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
48  uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
49 {
50 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
51  char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN];
52  _mav_put_uint32_t(buf, 0, time_boot_ms);
53  _mav_put_float(buf, 4, roll_rate);
54  _mav_put_float(buf, 8, pitch_rate);
55  _mav_put_float(buf, 12, yaw_rate);
56  _mav_put_float(buf, 16, thrust);
57 
58  memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
59 #else
61  packet.time_boot_ms = time_boot_ms;
62  packet.roll_rate = roll_rate;
63  packet.pitch_rate = pitch_rate;
64  packet.yaw_rate = yaw_rate;
65  packet.thrust = thrust;
66 
67  memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
68 #endif
69 
70  msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT;
71 #if MAVLINK_CRC_EXTRA
72  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC);
73 #else
74  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
75 #endif
76 }
77 
91 static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
92  mavlink_message_t* msg,
93  uint32_t time_boot_ms,float roll_rate,float pitch_rate,float yaw_rate,float thrust)
94 {
95 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
96  char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN];
97  _mav_put_uint32_t(buf, 0, time_boot_ms);
98  _mav_put_float(buf, 4, roll_rate);
99  _mav_put_float(buf, 8, pitch_rate);
100  _mav_put_float(buf, 12, yaw_rate);
101  _mav_put_float(buf, 16, thrust);
102 
103  memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
104 #else
106  packet.time_boot_ms = time_boot_ms;
107  packet.roll_rate = roll_rate;
108  packet.pitch_rate = pitch_rate;
109  packet.yaw_rate = yaw_rate;
110  packet.thrust = thrust;
111 
112  memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
113 #endif
114 
115  msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT;
116 #if MAVLINK_CRC_EXTRA
117  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC);
118 #else
119  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
120 #endif
121 }
122 
131 static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
132 {
133  return mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(system_id, component_id, msg, roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms, roll_pitch_yaw_rates_thrust_setpoint->roll_rate, roll_pitch_yaw_rates_thrust_setpoint->pitch_rate, roll_pitch_yaw_rates_thrust_setpoint->yaw_rate, roll_pitch_yaw_rates_thrust_setpoint->thrust);
134 }
135 
145 static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
146 {
147  return mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_chan(system_id, component_id, chan, msg, roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms, roll_pitch_yaw_rates_thrust_setpoint->roll_rate, roll_pitch_yaw_rates_thrust_setpoint->pitch_rate, roll_pitch_yaw_rates_thrust_setpoint->yaw_rate, roll_pitch_yaw_rates_thrust_setpoint->thrust);
148 }
149 
160 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
161 
162 static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
163 {
164 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
165  char buf[MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN];
166  _mav_put_uint32_t(buf, 0, time_boot_ms);
167  _mav_put_float(buf, 4, roll_rate);
168  _mav_put_float(buf, 8, pitch_rate);
169  _mav_put_float(buf, 12, yaw_rate);
170  _mav_put_float(buf, 16, thrust);
171 
172 #if MAVLINK_CRC_EXTRA
173  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC);
174 #else
175  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
176 #endif
177 #else
179  packet.time_boot_ms = time_boot_ms;
180  packet.roll_rate = roll_rate;
181  packet.pitch_rate = pitch_rate;
182  packet.yaw_rate = yaw_rate;
183  packet.thrust = thrust;
184 
185 #if MAVLINK_CRC_EXTRA
186  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC);
187 #else
188  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
189 #endif
190 #endif
191 }
192 
193 #if MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
194 /*
195  This varient of _send() can be used to save stack space by re-using
196  memory from the receive buffer. The caller provides a
197  mavlink_message_t which is the size of a full mavlink message. This
198  is usually the receive buffer for the channel, and allows a reply to an
199  incoming message with minimum stack space usage.
200  */
201 static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
202 {
203 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
204  char *buf = (char *)msgbuf;
205  _mav_put_uint32_t(buf, 0, time_boot_ms);
206  _mav_put_float(buf, 4, roll_rate);
207  _mav_put_float(buf, 8, pitch_rate);
208  _mav_put_float(buf, 12, yaw_rate);
209  _mav_put_float(buf, 16, thrust);
210 
211 #if MAVLINK_CRC_EXTRA
212  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC);
213 #else
214  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
215 #endif
216 #else
218  packet->time_boot_ms = time_boot_ms;
219  packet->roll_rate = roll_rate;
220  packet->pitch_rate = pitch_rate;
221  packet->yaw_rate = yaw_rate;
222  packet->thrust = thrust;
223 
224 #if MAVLINK_CRC_EXTRA
225  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC);
226 #else
227  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
228 #endif
229 #endif
230 }
231 #endif
232 
233 #endif
234 
235 // MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT UNPACKING
236 
237 
243 static inline uint32_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
244 {
245  return _MAV_RETURN_uint32_t(msg, 0);
246 }
247 
253 static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_roll_rate(const mavlink_message_t* msg)
254 {
255  return _MAV_RETURN_float(msg, 4);
256 }
257 
263 static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_pitch_rate(const mavlink_message_t* msg)
264 {
265  return _MAV_RETURN_float(msg, 8);
266 }
267 
273 static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(const mavlink_message_t* msg)
274 {
275  return _MAV_RETURN_float(msg, 12);
276 }
277 
283 static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(const mavlink_message_t* msg)
284 {
285  return _MAV_RETURN_float(msg, 16);
286 }
287 
294 static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(const mavlink_message_t* msg, mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
295 {
296 #if MAVLINK_NEED_BYTE_SWAP
297  roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_time_boot_ms(msg);
298  roll_pitch_yaw_rates_thrust_setpoint->roll_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_roll_rate(msg);
299  roll_pitch_yaw_rates_thrust_setpoint->pitch_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_pitch_rate(msg);
300  roll_pitch_yaw_rates_thrust_setpoint->yaw_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(msg);
301  roll_pitch_yaw_rates_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(msg);
302 #else
303  memcpy(roll_pitch_yaw_rates_thrust_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN);
304 #endif
305 }