before merging master
[inav.git] / lib / main / MAVLink / common / mavlink_msg_camera_tracking_image_status.h
blob5f703fce5d4ad9efe8a6385f2a3966e0ded491c5
1 #pragma once
2 // MESSAGE CAMERA_TRACKING_IMAGE_STATUS PACKING
4 #define MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS 275
7 typedef struct __mavlink_camera_tracking_image_status_t {
8 float point_x; /*< Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown*/
9 float point_y; /*< Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown*/
10 float radius; /*< Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown*/
11 float rec_top_x; /*< Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown*/
12 float rec_top_y; /*< Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown*/
13 float rec_bottom_x; /*< Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown*/
14 float rec_bottom_y; /*< Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown*/
15 uint8_t tracking_status; /*< Current tracking status*/
16 uint8_t tracking_mode; /*< Current tracking mode*/
17 uint8_t target_data; /*< Defines location of target data*/
18 } mavlink_camera_tracking_image_status_t;
20 #define MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN 31
21 #define MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN 31
22 #define MAVLINK_MSG_ID_275_LEN 31
23 #define MAVLINK_MSG_ID_275_MIN_LEN 31
25 #define MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC 126
26 #define MAVLINK_MSG_ID_275_CRC 126
30 #if MAVLINK_COMMAND_24BIT
31 #define MAVLINK_MESSAGE_INFO_CAMERA_TRACKING_IMAGE_STATUS { \
32 275, \
33 "CAMERA_TRACKING_IMAGE_STATUS", \
34 10, \
35 { { "tracking_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_tracking_image_status_t, tracking_status) }, \
36 { "tracking_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_camera_tracking_image_status_t, tracking_mode) }, \
37 { "target_data", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_camera_tracking_image_status_t, target_data) }, \
38 { "point_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_camera_tracking_image_status_t, point_x) }, \
39 { "point_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_camera_tracking_image_status_t, point_y) }, \
40 { "radius", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_tracking_image_status_t, radius) }, \
41 { "rec_top_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_tracking_image_status_t, rec_top_x) }, \
42 { "rec_top_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_tracking_image_status_t, rec_top_y) }, \
43 { "rec_bottom_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_tracking_image_status_t, rec_bottom_x) }, \
44 { "rec_bottom_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_camera_tracking_image_status_t, rec_bottom_y) }, \
45 } \
47 #else
48 #define MAVLINK_MESSAGE_INFO_CAMERA_TRACKING_IMAGE_STATUS { \
49 "CAMERA_TRACKING_IMAGE_STATUS", \
50 10, \
51 { { "tracking_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_tracking_image_status_t, tracking_status) }, \
52 { "tracking_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_camera_tracking_image_status_t, tracking_mode) }, \
53 { "target_data", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_camera_tracking_image_status_t, target_data) }, \
54 { "point_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_camera_tracking_image_status_t, point_x) }, \
55 { "point_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_camera_tracking_image_status_t, point_y) }, \
56 { "radius", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_tracking_image_status_t, radius) }, \
57 { "rec_top_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_tracking_image_status_t, rec_top_x) }, \
58 { "rec_top_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_tracking_image_status_t, rec_top_y) }, \
59 { "rec_bottom_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_tracking_image_status_t, rec_bottom_x) }, \
60 { "rec_bottom_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_camera_tracking_image_status_t, rec_bottom_y) }, \
61 } \
63 #endif
65 /**
66 * @brief Pack a camera_tracking_image_status message
67 * @param system_id ID of this system
68 * @param component_id ID of this component (e.g. 200 for IMU)
69 * @param msg The MAVLink message to compress the data into
71 * @param tracking_status Current tracking status
72 * @param tracking_mode Current tracking mode
73 * @param target_data Defines location of target data
74 * @param point_x Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown
75 * @param point_y Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
76 * @param radius Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown
77 * @param rec_top_x Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
78 * @param rec_top_y Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
79 * @param rec_bottom_x Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
80 * @param rec_bottom_y Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
81 * @return length of the message in bytes (excluding serial stream start sign)
83 static inline uint16_t mavlink_msg_camera_tracking_image_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
84 uint8_t tracking_status, uint8_t tracking_mode, uint8_t target_data, float point_x, float point_y, float radius, float rec_top_x, float rec_top_y, float rec_bottom_x, float rec_bottom_y)
86 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
87 char buf[MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN];
88 _mav_put_float(buf, 0, point_x);
89 _mav_put_float(buf, 4, point_y);
90 _mav_put_float(buf, 8, radius);
91 _mav_put_float(buf, 12, rec_top_x);
92 _mav_put_float(buf, 16, rec_top_y);
93 _mav_put_float(buf, 20, rec_bottom_x);
94 _mav_put_float(buf, 24, rec_bottom_y);
95 _mav_put_uint8_t(buf, 28, tracking_status);
96 _mav_put_uint8_t(buf, 29, tracking_mode);
97 _mav_put_uint8_t(buf, 30, target_data);
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN);
100 #else
101 mavlink_camera_tracking_image_status_t packet;
102 packet.point_x = point_x;
103 packet.point_y = point_y;
104 packet.radius = radius;
105 packet.rec_top_x = rec_top_x;
106 packet.rec_top_y = rec_top_y;
107 packet.rec_bottom_x = rec_bottom_x;
108 packet.rec_bottom_y = rec_bottom_y;
109 packet.tracking_status = tracking_status;
110 packet.tracking_mode = tracking_mode;
111 packet.target_data = target_data;
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN);
114 #endif
116 msg->msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
117 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
121 * @brief Pack a camera_tracking_image_status message on a channel
122 * @param system_id ID of this system
123 * @param component_id ID of this component (e.g. 200 for IMU)
124 * @param chan The MAVLink channel this message will be sent over
125 * @param msg The MAVLink message to compress the data into
126 * @param tracking_status Current tracking status
127 * @param tracking_mode Current tracking mode
128 * @param target_data Defines location of target data
129 * @param point_x Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown
130 * @param point_y Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
131 * @param radius Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown
132 * @param rec_top_x Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
133 * @param rec_top_y Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
134 * @param rec_bottom_x Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
135 * @param rec_bottom_y Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
136 * @return length of the message in bytes (excluding serial stream start sign)
138 static inline uint16_t mavlink_msg_camera_tracking_image_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
139 mavlink_message_t* msg,
140 uint8_t tracking_status,uint8_t tracking_mode,uint8_t target_data,float point_x,float point_y,float radius,float rec_top_x,float rec_top_y,float rec_bottom_x,float rec_bottom_y)
142 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
143 char buf[MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN];
144 _mav_put_float(buf, 0, point_x);
145 _mav_put_float(buf, 4, point_y);
146 _mav_put_float(buf, 8, radius);
147 _mav_put_float(buf, 12, rec_top_x);
148 _mav_put_float(buf, 16, rec_top_y);
149 _mav_put_float(buf, 20, rec_bottom_x);
150 _mav_put_float(buf, 24, rec_bottom_y);
151 _mav_put_uint8_t(buf, 28, tracking_status);
152 _mav_put_uint8_t(buf, 29, tracking_mode);
153 _mav_put_uint8_t(buf, 30, target_data);
155 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN);
156 #else
157 mavlink_camera_tracking_image_status_t packet;
158 packet.point_x = point_x;
159 packet.point_y = point_y;
160 packet.radius = radius;
161 packet.rec_top_x = rec_top_x;
162 packet.rec_top_y = rec_top_y;
163 packet.rec_bottom_x = rec_bottom_x;
164 packet.rec_bottom_y = rec_bottom_y;
165 packet.tracking_status = tracking_status;
166 packet.tracking_mode = tracking_mode;
167 packet.target_data = target_data;
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN);
170 #endif
172 msg->msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
173 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
177 * @brief Encode a camera_tracking_image_status struct
179 * @param system_id ID of this system
180 * @param component_id ID of this component (e.g. 200 for IMU)
181 * @param msg The MAVLink message to compress the data into
182 * @param camera_tracking_image_status C-struct to read the message contents from
184 static inline uint16_t mavlink_msg_camera_tracking_image_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_tracking_image_status_t* camera_tracking_image_status)
186 return mavlink_msg_camera_tracking_image_status_pack(system_id, component_id, msg, camera_tracking_image_status->tracking_status, camera_tracking_image_status->tracking_mode, camera_tracking_image_status->target_data, camera_tracking_image_status->point_x, camera_tracking_image_status->point_y, camera_tracking_image_status->radius, camera_tracking_image_status->rec_top_x, camera_tracking_image_status->rec_top_y, camera_tracking_image_status->rec_bottom_x, camera_tracking_image_status->rec_bottom_y);
190 * @brief Encode a camera_tracking_image_status struct on a channel
192 * @param system_id ID of this system
193 * @param component_id ID of this component (e.g. 200 for IMU)
194 * @param chan The MAVLink channel this message will be sent over
195 * @param msg The MAVLink message to compress the data into
196 * @param camera_tracking_image_status C-struct to read the message contents from
198 static inline uint16_t mavlink_msg_camera_tracking_image_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_tracking_image_status_t* camera_tracking_image_status)
200 return mavlink_msg_camera_tracking_image_status_pack_chan(system_id, component_id, chan, msg, camera_tracking_image_status->tracking_status, camera_tracking_image_status->tracking_mode, camera_tracking_image_status->target_data, camera_tracking_image_status->point_x, camera_tracking_image_status->point_y, camera_tracking_image_status->radius, camera_tracking_image_status->rec_top_x, camera_tracking_image_status->rec_top_y, camera_tracking_image_status->rec_bottom_x, camera_tracking_image_status->rec_bottom_y);
204 * @brief Send a camera_tracking_image_status message
205 * @param chan MAVLink channel to send the message
207 * @param tracking_status Current tracking status
208 * @param tracking_mode Current tracking mode
209 * @param target_data Defines location of target data
210 * @param point_x Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown
211 * @param point_y Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
212 * @param radius Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown
213 * @param rec_top_x Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
214 * @param rec_top_y Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
215 * @param rec_bottom_x Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
216 * @param rec_bottom_y Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
218 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
220 static inline void mavlink_msg_camera_tracking_image_status_send(mavlink_channel_t chan, uint8_t tracking_status, uint8_t tracking_mode, uint8_t target_data, float point_x, float point_y, float radius, float rec_top_x, float rec_top_y, float rec_bottom_x, float rec_bottom_y)
222 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
223 char buf[MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN];
224 _mav_put_float(buf, 0, point_x);
225 _mav_put_float(buf, 4, point_y);
226 _mav_put_float(buf, 8, radius);
227 _mav_put_float(buf, 12, rec_top_x);
228 _mav_put_float(buf, 16, rec_top_y);
229 _mav_put_float(buf, 20, rec_bottom_x);
230 _mav_put_float(buf, 24, rec_bottom_y);
231 _mav_put_uint8_t(buf, 28, tracking_status);
232 _mav_put_uint8_t(buf, 29, tracking_mode);
233 _mav_put_uint8_t(buf, 30, target_data);
235 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS, buf, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
236 #else
237 mavlink_camera_tracking_image_status_t packet;
238 packet.point_x = point_x;
239 packet.point_y = point_y;
240 packet.radius = radius;
241 packet.rec_top_x = rec_top_x;
242 packet.rec_top_y = rec_top_y;
243 packet.rec_bottom_x = rec_bottom_x;
244 packet.rec_bottom_y = rec_bottom_y;
245 packet.tracking_status = tracking_status;
246 packet.tracking_mode = tracking_mode;
247 packet.target_data = target_data;
249 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
250 #endif
254 * @brief Send a camera_tracking_image_status message
255 * @param chan MAVLink channel to send the message
256 * @param struct The MAVLink struct to serialize
258 static inline void mavlink_msg_camera_tracking_image_status_send_struct(mavlink_channel_t chan, const mavlink_camera_tracking_image_status_t* camera_tracking_image_status)
260 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
261 mavlink_msg_camera_tracking_image_status_send(chan, camera_tracking_image_status->tracking_status, camera_tracking_image_status->tracking_mode, camera_tracking_image_status->target_data, camera_tracking_image_status->point_x, camera_tracking_image_status->point_y, camera_tracking_image_status->radius, camera_tracking_image_status->rec_top_x, camera_tracking_image_status->rec_top_y, camera_tracking_image_status->rec_bottom_x, camera_tracking_image_status->rec_bottom_y);
262 #else
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS, (const char *)camera_tracking_image_status, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
264 #endif
267 #if MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
269 This varient of _send() can be used to save stack space by re-using
270 memory from the receive buffer. The caller provides a
271 mavlink_message_t which is the size of a full mavlink message. This
272 is usually the receive buffer for the channel, and allows a reply to an
273 incoming message with minimum stack space usage.
275 static inline void mavlink_msg_camera_tracking_image_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t tracking_status, uint8_t tracking_mode, uint8_t target_data, float point_x, float point_y, float radius, float rec_top_x, float rec_top_y, float rec_bottom_x, float rec_bottom_y)
277 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
278 char *buf = (char *)msgbuf;
279 _mav_put_float(buf, 0, point_x);
280 _mav_put_float(buf, 4, point_y);
281 _mav_put_float(buf, 8, radius);
282 _mav_put_float(buf, 12, rec_top_x);
283 _mav_put_float(buf, 16, rec_top_y);
284 _mav_put_float(buf, 20, rec_bottom_x);
285 _mav_put_float(buf, 24, rec_bottom_y);
286 _mav_put_uint8_t(buf, 28, tracking_status);
287 _mav_put_uint8_t(buf, 29, tracking_mode);
288 _mav_put_uint8_t(buf, 30, target_data);
290 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS, buf, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
291 #else
292 mavlink_camera_tracking_image_status_t *packet = (mavlink_camera_tracking_image_status_t *)msgbuf;
293 packet->point_x = point_x;
294 packet->point_y = point_y;
295 packet->radius = radius;
296 packet->rec_top_x = rec_top_x;
297 packet->rec_top_y = rec_top_y;
298 packet->rec_bottom_x = rec_bottom_x;
299 packet->rec_bottom_y = rec_bottom_y;
300 packet->tracking_status = tracking_status;
301 packet->tracking_mode = tracking_mode;
302 packet->target_data = target_data;
304 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_CRC);
305 #endif
307 #endif
309 #endif
311 // MESSAGE CAMERA_TRACKING_IMAGE_STATUS UNPACKING
315 * @brief Get field tracking_status from camera_tracking_image_status message
317 * @return Current tracking status
319 static inline uint8_t mavlink_msg_camera_tracking_image_status_get_tracking_status(const mavlink_message_t* msg)
321 return _MAV_RETURN_uint8_t(msg, 28);
325 * @brief Get field tracking_mode from camera_tracking_image_status message
327 * @return Current tracking mode
329 static inline uint8_t mavlink_msg_camera_tracking_image_status_get_tracking_mode(const mavlink_message_t* msg)
331 return _MAV_RETURN_uint8_t(msg, 29);
335 * @brief Get field target_data from camera_tracking_image_status message
337 * @return Defines location of target data
339 static inline uint8_t mavlink_msg_camera_tracking_image_status_get_target_data(const mavlink_message_t* msg)
341 return _MAV_RETURN_uint8_t(msg, 30);
345 * @brief Get field point_x from camera_tracking_image_status message
347 * @return Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown
349 static inline float mavlink_msg_camera_tracking_image_status_get_point_x(const mavlink_message_t* msg)
351 return _MAV_RETURN_float(msg, 0);
355 * @brief Get field point_y from camera_tracking_image_status message
357 * @return Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
359 static inline float mavlink_msg_camera_tracking_image_status_get_point_y(const mavlink_message_t* msg)
361 return _MAV_RETURN_float(msg, 4);
365 * @brief Get field radius from camera_tracking_image_status message
367 * @return Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown
369 static inline float mavlink_msg_camera_tracking_image_status_get_radius(const mavlink_message_t* msg)
371 return _MAV_RETURN_float(msg, 8);
375 * @brief Get field rec_top_x from camera_tracking_image_status message
377 * @return Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
379 static inline float mavlink_msg_camera_tracking_image_status_get_rec_top_x(const mavlink_message_t* msg)
381 return _MAV_RETURN_float(msg, 12);
385 * @brief Get field rec_top_y from camera_tracking_image_status message
387 * @return Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
389 static inline float mavlink_msg_camera_tracking_image_status_get_rec_top_y(const mavlink_message_t* msg)
391 return _MAV_RETURN_float(msg, 16);
395 * @brief Get field rec_bottom_x from camera_tracking_image_status message
397 * @return Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
399 static inline float mavlink_msg_camera_tracking_image_status_get_rec_bottom_x(const mavlink_message_t* msg)
401 return _MAV_RETURN_float(msg, 20);
405 * @brief Get field rec_bottom_y from camera_tracking_image_status message
407 * @return Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
409 static inline float mavlink_msg_camera_tracking_image_status_get_rec_bottom_y(const mavlink_message_t* msg)
411 return _MAV_RETURN_float(msg, 24);
415 * @brief Decode a camera_tracking_image_status message into a struct
417 * @param msg The message to decode
418 * @param camera_tracking_image_status C-struct to decode the message contents into
420 static inline void mavlink_msg_camera_tracking_image_status_decode(const mavlink_message_t* msg, mavlink_camera_tracking_image_status_t* camera_tracking_image_status)
422 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
423 camera_tracking_image_status->point_x = mavlink_msg_camera_tracking_image_status_get_point_x(msg);
424 camera_tracking_image_status->point_y = mavlink_msg_camera_tracking_image_status_get_point_y(msg);
425 camera_tracking_image_status->radius = mavlink_msg_camera_tracking_image_status_get_radius(msg);
426 camera_tracking_image_status->rec_top_x = mavlink_msg_camera_tracking_image_status_get_rec_top_x(msg);
427 camera_tracking_image_status->rec_top_y = mavlink_msg_camera_tracking_image_status_get_rec_top_y(msg);
428 camera_tracking_image_status->rec_bottom_x = mavlink_msg_camera_tracking_image_status_get_rec_bottom_x(msg);
429 camera_tracking_image_status->rec_bottom_y = mavlink_msg_camera_tracking_image_status_get_rec_bottom_y(msg);
430 camera_tracking_image_status->tracking_status = mavlink_msg_camera_tracking_image_status_get_tracking_status(msg);
431 camera_tracking_image_status->tracking_mode = mavlink_msg_camera_tracking_image_status_get_tracking_mode(msg);
432 camera_tracking_image_status->target_data = mavlink_msg_camera_tracking_image_status_get_target_data(msg);
433 #else
434 uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN;
435 memset(camera_tracking_image_status, 0, MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_LEN);
436 memcpy(camera_tracking_image_status, _MAV_PAYLOAD(msg), len);
437 #endif