NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_gimbal_report.h
Go to the documentation of this file.
1 // MESSAGE GIMBAL_REPORT PACKING
2 
3 #define MAVLINK_MSG_ID_GIMBAL_REPORT 200
4 
6 {
7  float delta_time;
8  float delta_angle_x;
9  float delta_angle_y;
10  float delta_angle_z;
14  float joint_roll;
15  float joint_el;
16  float joint_az;
17  uint8_t target_system;
18  uint8_t target_component;
20 
21 #define MAVLINK_MSG_ID_GIMBAL_REPORT_LEN 42
22 #define MAVLINK_MSG_ID_200_LEN 42
23 
24 #define MAVLINK_MSG_ID_GIMBAL_REPORT_CRC 134
25 #define MAVLINK_MSG_ID_200_CRC 134
26 
27 
28 
29 #define MAVLINK_MESSAGE_INFO_GIMBAL_REPORT { \
30  "GIMBAL_REPORT", \
31  12, \
32  { { "delta_time", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_gimbal_report_t, delta_time) }, \
33  { "delta_angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_report_t, delta_angle_x) }, \
34  { "delta_angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_report_t, delta_angle_y) }, \
35  { "delta_angle_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_report_t, delta_angle_z) }, \
36  { "delta_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_report_t, delta_velocity_x) }, \
37  { "delta_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_report_t, delta_velocity_y) }, \
38  { "delta_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_report_t, delta_velocity_z) }, \
39  { "joint_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_report_t, joint_roll) }, \
40  { "joint_el", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_report_t, joint_el) }, \
41  { "joint_az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_report_t, joint_az) }, \
42  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_gimbal_report_t, target_system) }, \
43  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_gimbal_report_t, target_component) }, \
44  } \
45 }
46 
47 
68 static inline uint16_t mavlink_msg_gimbal_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
69  uint8_t target_system, uint8_t target_component, float delta_time, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_roll, float joint_el, float joint_az)
70 {
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
73  _mav_put_float(buf, 0, delta_time);
74  _mav_put_float(buf, 4, delta_angle_x);
75  _mav_put_float(buf, 8, delta_angle_y);
76  _mav_put_float(buf, 12, delta_angle_z);
77  _mav_put_float(buf, 16, delta_velocity_x);
78  _mav_put_float(buf, 20, delta_velocity_y);
79  _mav_put_float(buf, 24, delta_velocity_z);
80  _mav_put_float(buf, 28, joint_roll);
81  _mav_put_float(buf, 32, joint_el);
82  _mav_put_float(buf, 36, joint_az);
83  _mav_put_uint8_t(buf, 40, target_system);
84  _mav_put_uint8_t(buf, 41, target_component);
85 
87 #else
89  packet.delta_time = delta_time;
90  packet.delta_angle_x = delta_angle_x;
91  packet.delta_angle_y = delta_angle_y;
92  packet.delta_angle_z = delta_angle_z;
93  packet.delta_velocity_x = delta_velocity_x;
94  packet.delta_velocity_y = delta_velocity_y;
95  packet.delta_velocity_z = delta_velocity_z;
96  packet.joint_roll = joint_roll;
97  packet.joint_el = joint_el;
98  packet.joint_az = joint_az;
99  packet.target_system = target_system;
100  packet.target_component = target_component;
101 
103 #endif
104 
105  msg->msgid = MAVLINK_MSG_ID_GIMBAL_REPORT;
106 #if MAVLINK_CRC_EXTRA
108 #else
109  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
110 #endif
111 }
112 
133 static inline uint16_t mavlink_msg_gimbal_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
134  mavlink_message_t* msg,
135  uint8_t target_system,uint8_t target_component,float delta_time,float delta_angle_x,float delta_angle_y,float delta_angle_z,float delta_velocity_x,float delta_velocity_y,float delta_velocity_z,float joint_roll,float joint_el,float joint_az)
136 {
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
139  _mav_put_float(buf, 0, delta_time);
140  _mav_put_float(buf, 4, delta_angle_x);
141  _mav_put_float(buf, 8, delta_angle_y);
142  _mav_put_float(buf, 12, delta_angle_z);
143  _mav_put_float(buf, 16, delta_velocity_x);
144  _mav_put_float(buf, 20, delta_velocity_y);
145  _mav_put_float(buf, 24, delta_velocity_z);
146  _mav_put_float(buf, 28, joint_roll);
147  _mav_put_float(buf, 32, joint_el);
148  _mav_put_float(buf, 36, joint_az);
149  _mav_put_uint8_t(buf, 40, target_system);
150  _mav_put_uint8_t(buf, 41, target_component);
151 
153 #else
155  packet.delta_time = delta_time;
156  packet.delta_angle_x = delta_angle_x;
157  packet.delta_angle_y = delta_angle_y;
158  packet.delta_angle_z = delta_angle_z;
159  packet.delta_velocity_x = delta_velocity_x;
160  packet.delta_velocity_y = delta_velocity_y;
161  packet.delta_velocity_z = delta_velocity_z;
162  packet.joint_roll = joint_roll;
163  packet.joint_el = joint_el;
164  packet.joint_az = joint_az;
165  packet.target_system = target_system;
166  packet.target_component = target_component;
167 
169 #endif
170 
171  msg->msgid = MAVLINK_MSG_ID_GIMBAL_REPORT;
172 #if MAVLINK_CRC_EXTRA
174 #else
175  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
176 #endif
177 }
178 
187 static inline uint16_t mavlink_msg_gimbal_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_report_t* gimbal_report)
188 {
189  return mavlink_msg_gimbal_report_pack(system_id, component_id, msg, gimbal_report->target_system, gimbal_report->target_component, gimbal_report->delta_time, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_roll, gimbal_report->joint_el, gimbal_report->joint_az);
190 }
191 
201 static inline uint16_t mavlink_msg_gimbal_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_report_t* gimbal_report)
202 {
203  return mavlink_msg_gimbal_report_pack_chan(system_id, component_id, chan, msg, gimbal_report->target_system, gimbal_report->target_component, gimbal_report->delta_time, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_roll, gimbal_report->joint_el, gimbal_report->joint_az);
204 }
205 
223 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
224 
225 static inline void mavlink_msg_gimbal_report_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float delta_time, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_roll, float joint_el, float joint_az)
226 {
227 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
229  _mav_put_float(buf, 0, delta_time);
230  _mav_put_float(buf, 4, delta_angle_x);
231  _mav_put_float(buf, 8, delta_angle_y);
232  _mav_put_float(buf, 12, delta_angle_z);
233  _mav_put_float(buf, 16, delta_velocity_x);
234  _mav_put_float(buf, 20, delta_velocity_y);
235  _mav_put_float(buf, 24, delta_velocity_z);
236  _mav_put_float(buf, 28, joint_roll);
237  _mav_put_float(buf, 32, joint_el);
238  _mav_put_float(buf, 36, joint_az);
239  _mav_put_uint8_t(buf, 40, target_system);
240  _mav_put_uint8_t(buf, 41, target_component);
241 
242 #if MAVLINK_CRC_EXTRA
244 #else
245  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
246 #endif
247 #else
249  packet.delta_time = delta_time;
250  packet.delta_angle_x = delta_angle_x;
251  packet.delta_angle_y = delta_angle_y;
252  packet.delta_angle_z = delta_angle_z;
253  packet.delta_velocity_x = delta_velocity_x;
254  packet.delta_velocity_y = delta_velocity_y;
255  packet.delta_velocity_z = delta_velocity_z;
256  packet.joint_roll = joint_roll;
257  packet.joint_el = joint_el;
258  packet.joint_az = joint_az;
259  packet.target_system = target_system;
260  packet.target_component = target_component;
261 
262 #if MAVLINK_CRC_EXTRA
263  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
264 #else
265  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
266 #endif
267 #endif
268 }
269 
270 #if MAVLINK_MSG_ID_GIMBAL_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
271 /*
272  This varient of _send() can be used to save stack space by re-using
273  memory from the receive buffer. The caller provides a
274  mavlink_message_t which is the size of a full mavlink message. This
275  is usually the receive buffer for the channel, and allows a reply to an
276  incoming message with minimum stack space usage.
277  */
278 static inline void mavlink_msg_gimbal_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float delta_time, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_roll, float joint_el, float joint_az)
279 {
280 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
281  char *buf = (char *)msgbuf;
282  _mav_put_float(buf, 0, delta_time);
283  _mav_put_float(buf, 4, delta_angle_x);
284  _mav_put_float(buf, 8, delta_angle_y);
285  _mav_put_float(buf, 12, delta_angle_z);
286  _mav_put_float(buf, 16, delta_velocity_x);
287  _mav_put_float(buf, 20, delta_velocity_y);
288  _mav_put_float(buf, 24, delta_velocity_z);
289  _mav_put_float(buf, 28, joint_roll);
290  _mav_put_float(buf, 32, joint_el);
291  _mav_put_float(buf, 36, joint_az);
292  _mav_put_uint8_t(buf, 40, target_system);
293  _mav_put_uint8_t(buf, 41, target_component);
294 
295 #if MAVLINK_CRC_EXTRA
297 #else
298  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
299 #endif
300 #else
302  packet->delta_time = delta_time;
303  packet->delta_angle_x = delta_angle_x;
304  packet->delta_angle_y = delta_angle_y;
305  packet->delta_angle_z = delta_angle_z;
306  packet->delta_velocity_x = delta_velocity_x;
307  packet->delta_velocity_y = delta_velocity_y;
308  packet->delta_velocity_z = delta_velocity_z;
309  packet->joint_roll = joint_roll;
310  packet->joint_el = joint_el;
311  packet->joint_az = joint_az;
312  packet->target_system = target_system;
313  packet->target_component = target_component;
314 
315 #if MAVLINK_CRC_EXTRA
316  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
317 #else
318  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
319 #endif
320 #endif
321 }
322 #endif
323 
324 #endif
325 
326 // MESSAGE GIMBAL_REPORT UNPACKING
327 
328 
334 static inline uint8_t mavlink_msg_gimbal_report_get_target_system(const mavlink_message_t* msg)
335 {
336  return _MAV_RETURN_uint8_t(msg, 40);
337 }
338 
344 static inline uint8_t mavlink_msg_gimbal_report_get_target_component(const mavlink_message_t* msg)
345 {
346  return _MAV_RETURN_uint8_t(msg, 41);
347 }
348 
354 static inline float mavlink_msg_gimbal_report_get_delta_time(const mavlink_message_t* msg)
355 {
356  return _MAV_RETURN_float(msg, 0);
357 }
358 
364 static inline float mavlink_msg_gimbal_report_get_delta_angle_x(const mavlink_message_t* msg)
365 {
366  return _MAV_RETURN_float(msg, 4);
367 }
368 
374 static inline float mavlink_msg_gimbal_report_get_delta_angle_y(const mavlink_message_t* msg)
375 {
376  return _MAV_RETURN_float(msg, 8);
377 }
378 
384 static inline float mavlink_msg_gimbal_report_get_delta_angle_z(const mavlink_message_t* msg)
385 {
386  return _MAV_RETURN_float(msg, 12);
387 }
388 
394 static inline float mavlink_msg_gimbal_report_get_delta_velocity_x(const mavlink_message_t* msg)
395 {
396  return _MAV_RETURN_float(msg, 16);
397 }
398 
404 static inline float mavlink_msg_gimbal_report_get_delta_velocity_y(const mavlink_message_t* msg)
405 {
406  return _MAV_RETURN_float(msg, 20);
407 }
408 
414 static inline float mavlink_msg_gimbal_report_get_delta_velocity_z(const mavlink_message_t* msg)
415 {
416  return _MAV_RETURN_float(msg, 24);
417 }
418 
424 static inline float mavlink_msg_gimbal_report_get_joint_roll(const mavlink_message_t* msg)
425 {
426  return _MAV_RETURN_float(msg, 28);
427 }
428 
434 static inline float mavlink_msg_gimbal_report_get_joint_el(const mavlink_message_t* msg)
435 {
436  return _MAV_RETURN_float(msg, 32);
437 }
438 
444 static inline float mavlink_msg_gimbal_report_get_joint_az(const mavlink_message_t* msg)
445 {
446  return _MAV_RETURN_float(msg, 36);
447 }
448 
455 static inline void mavlink_msg_gimbal_report_decode(const mavlink_message_t* msg, mavlink_gimbal_report_t* gimbal_report)
456 {
457 #if MAVLINK_NEED_BYTE_SWAP
458  gimbal_report->delta_time = mavlink_msg_gimbal_report_get_delta_time(msg);
459  gimbal_report->delta_angle_x = mavlink_msg_gimbal_report_get_delta_angle_x(msg);
460  gimbal_report->delta_angle_y = mavlink_msg_gimbal_report_get_delta_angle_y(msg);
461  gimbal_report->delta_angle_z = mavlink_msg_gimbal_report_get_delta_angle_z(msg);
462  gimbal_report->delta_velocity_x = mavlink_msg_gimbal_report_get_delta_velocity_x(msg);
463  gimbal_report->delta_velocity_y = mavlink_msg_gimbal_report_get_delta_velocity_y(msg);
464  gimbal_report->delta_velocity_z = mavlink_msg_gimbal_report_get_delta_velocity_z(msg);
465  gimbal_report->joint_roll = mavlink_msg_gimbal_report_get_joint_roll(msg);
466  gimbal_report->joint_el = mavlink_msg_gimbal_report_get_joint_el(msg);
467  gimbal_report->joint_az = mavlink_msg_gimbal_report_get_joint_az(msg);
468  gimbal_report->target_system = mavlink_msg_gimbal_report_get_target_system(msg);
469  gimbal_report->target_component = mavlink_msg_gimbal_report_get_target_component(msg);
470 #else
471  memcpy(gimbal_report, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
472 #endif
473 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134