NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_image_triggered.h
Go to the documentation of this file.
1 // MESSAGE IMAGE_TRIGGERED PACKING
2 
3 #define MAVLINK_MSG_ID_IMAGE_TRIGGERED 152
4 
6 {
7  uint64_t timestamp;
8  uint32_t seq;
9  float roll;
10  float pitch;
11  float yaw;
12  float local_z;
13  float lat;
14  float lon;
15  float alt;
16  float ground_x;
17  float ground_y;
18  float ground_z;
20 
21 #define MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN 52
22 #define MAVLINK_MSG_ID_152_LEN 52
23 
24 #define MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC 86
25 #define MAVLINK_MSG_ID_152_CRC 86
26 
27 
28 
29 #define MAVLINK_MESSAGE_INFO_IMAGE_TRIGGERED { \
30  "IMAGE_TRIGGERED", \
31  12, \
32  { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_image_triggered_t, timestamp) }, \
33  { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_image_triggered_t, seq) }, \
34  { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_image_triggered_t, roll) }, \
35  { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_image_triggered_t, pitch) }, \
36  { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_image_triggered_t, yaw) }, \
37  { "local_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_image_triggered_t, local_z) }, \
38  { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_image_triggered_t, lat) }, \
39  { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_image_triggered_t, lon) }, \
40  { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_image_triggered_t, alt) }, \
41  { "ground_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_image_triggered_t, ground_x) }, \
42  { "ground_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_image_triggered_t, ground_y) }, \
43  { "ground_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_image_triggered_t, ground_z) }, \
44  } \
45 }
46 
47 
68 static inline uint16_t mavlink_msg_image_triggered_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
69  uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
70 {
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
73  _mav_put_uint64_t(buf, 0, timestamp);
74  _mav_put_uint32_t(buf, 8, seq);
75  _mav_put_float(buf, 12, roll);
76  _mav_put_float(buf, 16, pitch);
77  _mav_put_float(buf, 20, yaw);
78  _mav_put_float(buf, 24, local_z);
79  _mav_put_float(buf, 28, lat);
80  _mav_put_float(buf, 32, lon);
81  _mav_put_float(buf, 36, alt);
82  _mav_put_float(buf, 40, ground_x);
83  _mav_put_float(buf, 44, ground_y);
84  _mav_put_float(buf, 48, ground_z);
85 
87 #else
89  packet.timestamp = timestamp;
90  packet.seq = seq;
91  packet.roll = roll;
92  packet.pitch = pitch;
93  packet.yaw = yaw;
94  packet.local_z = local_z;
95  packet.lat = lat;
96  packet.lon = lon;
97  packet.alt = alt;
98  packet.ground_x = ground_x;
99  packet.ground_y = ground_y;
100  packet.ground_z = ground_z;
101 
103 #endif
104 
105  msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
106 #if MAVLINK_CRC_EXTRA
108 #else
109  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
110 #endif
111 }
112 
133 static inline uint16_t mavlink_msg_image_triggered_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
134  mavlink_message_t* msg,
135  uint64_t timestamp,uint32_t seq,float roll,float pitch,float yaw,float local_z,float lat,float lon,float alt,float ground_x,float ground_y,float ground_z)
136 {
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
139  _mav_put_uint64_t(buf, 0, timestamp);
140  _mav_put_uint32_t(buf, 8, seq);
141  _mav_put_float(buf, 12, roll);
142  _mav_put_float(buf, 16, pitch);
143  _mav_put_float(buf, 20, yaw);
144  _mav_put_float(buf, 24, local_z);
145  _mav_put_float(buf, 28, lat);
146  _mav_put_float(buf, 32, lon);
147  _mav_put_float(buf, 36, alt);
148  _mav_put_float(buf, 40, ground_x);
149  _mav_put_float(buf, 44, ground_y);
150  _mav_put_float(buf, 48, ground_z);
151 
153 #else
155  packet.timestamp = timestamp;
156  packet.seq = seq;
157  packet.roll = roll;
158  packet.pitch = pitch;
159  packet.yaw = yaw;
160  packet.local_z = local_z;
161  packet.lat = lat;
162  packet.lon = lon;
163  packet.alt = alt;
164  packet.ground_x = ground_x;
165  packet.ground_y = ground_y;
166  packet.ground_z = ground_z;
167 
169 #endif
170 
171  msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
172 #if MAVLINK_CRC_EXTRA
174 #else
175  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
176 #endif
177 }
178 
187 static inline uint16_t mavlink_msg_image_triggered_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_triggered_t* image_triggered)
188 {
189  return mavlink_msg_image_triggered_pack(system_id, component_id, msg, image_triggered->timestamp, image_triggered->seq, image_triggered->roll, image_triggered->pitch, image_triggered->yaw, image_triggered->local_z, image_triggered->lat, image_triggered->lon, image_triggered->alt, image_triggered->ground_x, image_triggered->ground_y, image_triggered->ground_z);
190 }
191 
201 static inline uint16_t mavlink_msg_image_triggered_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_image_triggered_t* image_triggered)
202 {
203  return mavlink_msg_image_triggered_pack_chan(system_id, component_id, chan, msg, image_triggered->timestamp, image_triggered->seq, image_triggered->roll, image_triggered->pitch, image_triggered->yaw, image_triggered->local_z, image_triggered->lat, image_triggered->lon, image_triggered->alt, image_triggered->ground_x, image_triggered->ground_y, image_triggered->ground_z);
204 }
205 
223 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
224 
225 static inline void mavlink_msg_image_triggered_send(mavlink_channel_t chan, uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
226 {
227 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
229  _mav_put_uint64_t(buf, 0, timestamp);
230  _mav_put_uint32_t(buf, 8, seq);
231  _mav_put_float(buf, 12, roll);
232  _mav_put_float(buf, 16, pitch);
233  _mav_put_float(buf, 20, yaw);
234  _mav_put_float(buf, 24, local_z);
235  _mav_put_float(buf, 28, lat);
236  _mav_put_float(buf, 32, lon);
237  _mav_put_float(buf, 36, alt);
238  _mav_put_float(buf, 40, ground_x);
239  _mav_put_float(buf, 44, ground_y);
240  _mav_put_float(buf, 48, ground_z);
241 
242 #if MAVLINK_CRC_EXTRA
244 #else
245  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
246 #endif
247 #else
249  packet.timestamp = timestamp;
250  packet.seq = seq;
251  packet.roll = roll;
252  packet.pitch = pitch;
253  packet.yaw = yaw;
254  packet.local_z = local_z;
255  packet.lat = lat;
256  packet.lon = lon;
257  packet.alt = alt;
258  packet.ground_x = ground_x;
259  packet.ground_y = ground_y;
260  packet.ground_z = ground_z;
261 
262 #if MAVLINK_CRC_EXTRA
263  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
264 #else
265  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
266 #endif
267 #endif
268 }
269 
270 #if MAVLINK_MSG_ID_IMAGE_TRIGGERED_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_image_triggered_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
279 {
280 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
281  char *buf = (char *)msgbuf;
282  _mav_put_uint64_t(buf, 0, timestamp);
283  _mav_put_uint32_t(buf, 8, seq);
284  _mav_put_float(buf, 12, roll);
285  _mav_put_float(buf, 16, pitch);
286  _mav_put_float(buf, 20, yaw);
287  _mav_put_float(buf, 24, local_z);
288  _mav_put_float(buf, 28, lat);
289  _mav_put_float(buf, 32, lon);
290  _mav_put_float(buf, 36, alt);
291  _mav_put_float(buf, 40, ground_x);
292  _mav_put_float(buf, 44, ground_y);
293  _mav_put_float(buf, 48, ground_z);
294 
295 #if MAVLINK_CRC_EXTRA
297 #else
298  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
299 #endif
300 #else
302  packet->timestamp = timestamp;
303  packet->seq = seq;
304  packet->roll = roll;
305  packet->pitch = pitch;
306  packet->yaw = yaw;
307  packet->local_z = local_z;
308  packet->lat = lat;
309  packet->lon = lon;
310  packet->alt = alt;
311  packet->ground_x = ground_x;
312  packet->ground_y = ground_y;
313  packet->ground_z = ground_z;
314 
315 #if MAVLINK_CRC_EXTRA
316  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
317 #else
318  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
319 #endif
320 #endif
321 }
322 #endif
323 
324 #endif
325 
326 // MESSAGE IMAGE_TRIGGERED UNPACKING
327 
328 
334 static inline uint64_t mavlink_msg_image_triggered_get_timestamp(const mavlink_message_t* msg)
335 {
336  return _MAV_RETURN_uint64_t(msg, 0);
337 }
338 
344 static inline uint32_t mavlink_msg_image_triggered_get_seq(const mavlink_message_t* msg)
345 {
346  return _MAV_RETURN_uint32_t(msg, 8);
347 }
348 
354 static inline float mavlink_msg_image_triggered_get_roll(const mavlink_message_t* msg)
355 {
356  return _MAV_RETURN_float(msg, 12);
357 }
358 
364 static inline float mavlink_msg_image_triggered_get_pitch(const mavlink_message_t* msg)
365 {
366  return _MAV_RETURN_float(msg, 16);
367 }
368 
374 static inline float mavlink_msg_image_triggered_get_yaw(const mavlink_message_t* msg)
375 {
376  return _MAV_RETURN_float(msg, 20);
377 }
378 
384 static inline float mavlink_msg_image_triggered_get_local_z(const mavlink_message_t* msg)
385 {
386  return _MAV_RETURN_float(msg, 24);
387 }
388 
394 static inline float mavlink_msg_image_triggered_get_lat(const mavlink_message_t* msg)
395 {
396  return _MAV_RETURN_float(msg, 28);
397 }
398 
404 static inline float mavlink_msg_image_triggered_get_lon(const mavlink_message_t* msg)
405 {
406  return _MAV_RETURN_float(msg, 32);
407 }
408 
414 static inline float mavlink_msg_image_triggered_get_alt(const mavlink_message_t* msg)
415 {
416  return _MAV_RETURN_float(msg, 36);
417 }
418 
424 static inline float mavlink_msg_image_triggered_get_ground_x(const mavlink_message_t* msg)
425 {
426  return _MAV_RETURN_float(msg, 40);
427 }
428 
434 static inline float mavlink_msg_image_triggered_get_ground_y(const mavlink_message_t* msg)
435 {
436  return _MAV_RETURN_float(msg, 44);
437 }
438 
444 static inline float mavlink_msg_image_triggered_get_ground_z(const mavlink_message_t* msg)
445 {
446  return _MAV_RETURN_float(msg, 48);
447 }
448 
455 static inline void mavlink_msg_image_triggered_decode(const mavlink_message_t* msg, mavlink_image_triggered_t* image_triggered)
456 {
457 #if MAVLINK_NEED_BYTE_SWAP
458  image_triggered->timestamp = mavlink_msg_image_triggered_get_timestamp(msg);
459  image_triggered->seq = mavlink_msg_image_triggered_get_seq(msg);
460  image_triggered->roll = mavlink_msg_image_triggered_get_roll(msg);
461  image_triggered->pitch = mavlink_msg_image_triggered_get_pitch(msg);
462  image_triggered->yaw = mavlink_msg_image_triggered_get_yaw(msg);
463  image_triggered->local_z = mavlink_msg_image_triggered_get_local_z(msg);
464  image_triggered->lat = mavlink_msg_image_triggered_get_lat(msg);
465  image_triggered->lon = mavlink_msg_image_triggered_get_lon(msg);
466  image_triggered->alt = mavlink_msg_image_triggered_get_alt(msg);
467  image_triggered->ground_x = mavlink_msg_image_triggered_get_ground_x(msg);
468  image_triggered->ground_y = mavlink_msg_image_triggered_get_ground_y(msg);
469  image_triggered->ground_z = mavlink_msg_image_triggered_get_ground_z(msg);
470 #else
471  memcpy(image_triggered, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
472 #endif
473 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:143
int16_t pitch
Definition: accelerometer.h:52
int16_t yaw
Definition: sensors.h:31
int16_t roll
Definition: accelerometer.h:51
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:141