Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_landing_target.h
blob1d1b41ed8e3b17e59ca2587649309c900069bdb2
1 #pragma once
2 // MESSAGE LANDING_TARGET PACKING
4 #define MAVLINK_MSG_ID_LANDING_TARGET 149
6 MAVPACKED(
7 typedef struct __mavlink_landing_target_t {
8 uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 float angle_x; /*< [rad] X-axis angular offset of the target from the center of the image*/
10 float angle_y; /*< [rad] Y-axis angular offset of the target from the center of the image*/
11 float distance; /*< [m] Distance to the target from the vehicle*/
12 float size_x; /*< [rad] Size of target along x-axis*/
13 float size_y; /*< [rad] Size of target along y-axis*/
14 uint8_t target_num; /*< The ID of the target if multiple targets are present*/
15 uint8_t frame; /*< Coordinate frame used for following fields.*/
16 float x; /*< [m] X Position of the landing target in MAV_FRAME*/
17 float y; /*< [m] Y Position of the landing target in MAV_FRAME*/
18 float z; /*< [m] Z Position of the landing target in MAV_FRAME*/
19 float q[4]; /*< Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
20 uint8_t type; /*< Type of landing target*/
21 uint8_t position_valid; /*< Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid).*/
22 }) mavlink_landing_target_t;
24 #define MAVLINK_MSG_ID_LANDING_TARGET_LEN 60
25 #define MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN 30
26 #define MAVLINK_MSG_ID_149_LEN 60
27 #define MAVLINK_MSG_ID_149_MIN_LEN 30
29 #define MAVLINK_MSG_ID_LANDING_TARGET_CRC 200
30 #define MAVLINK_MSG_ID_149_CRC 200
32 #define MAVLINK_MSG_LANDING_TARGET_FIELD_Q_LEN 4
34 #if MAVLINK_COMMAND_24BIT
35 #define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
36 149, \
37 "LANDING_TARGET", \
38 14, \
39 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
40 { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
41 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
42 { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
43 { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
44 { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
45 { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
46 { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
47 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_landing_target_t, x) }, \
48 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 34, offsetof(mavlink_landing_target_t, y) }, \
49 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 38, offsetof(mavlink_landing_target_t, z) }, \
50 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 42, offsetof(mavlink_landing_target_t, q) }, \
51 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_landing_target_t, type) }, \
52 { "position_valid", NULL, MAVLINK_TYPE_UINT8_T, 0, 59, offsetof(mavlink_landing_target_t, position_valid) }, \
53 } \
55 #else
56 #define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
57 "LANDING_TARGET", \
58 14, \
59 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
60 { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
61 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
62 { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
63 { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
64 { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
65 { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
66 { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
67 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_landing_target_t, x) }, \
68 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 34, offsetof(mavlink_landing_target_t, y) }, \
69 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 38, offsetof(mavlink_landing_target_t, z) }, \
70 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 42, offsetof(mavlink_landing_target_t, q) }, \
71 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_landing_target_t, type) }, \
72 { "position_valid", NULL, MAVLINK_TYPE_UINT8_T, 0, 59, offsetof(mavlink_landing_target_t, position_valid) }, \
73 } \
75 #endif
77 /**
78 * @brief Pack a landing_target message
79 * @param system_id ID of this system
80 * @param component_id ID of this component (e.g. 200 for IMU)
81 * @param msg The MAVLink message to compress the data into
83 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
84 * @param target_num The ID of the target if multiple targets are present
85 * @param frame Coordinate frame used for following fields.
86 * @param angle_x [rad] X-axis angular offset of the target from the center of the image
87 * @param angle_y [rad] Y-axis angular offset of the target from the center of the image
88 * @param distance [m] Distance to the target from the vehicle
89 * @param size_x [rad] Size of target along x-axis
90 * @param size_y [rad] Size of target along y-axis
91 * @param x [m] X Position of the landing target in MAV_FRAME
92 * @param y [m] Y Position of the landing target in MAV_FRAME
93 * @param z [m] Z Position of the landing target in MAV_FRAME
94 * @param q Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
95 * @param type Type of landing target
96 * @param position_valid Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid).
97 * @return length of the message in bytes (excluding serial stream start sign)
99 static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
100 uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y, float x, float y, float z, const float *q, uint8_t type, uint8_t position_valid)
102 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103 char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
104 _mav_put_uint64_t(buf, 0, time_usec);
105 _mav_put_float(buf, 8, angle_x);
106 _mav_put_float(buf, 12, angle_y);
107 _mav_put_float(buf, 16, distance);
108 _mav_put_float(buf, 20, size_x);
109 _mav_put_float(buf, 24, size_y);
110 _mav_put_uint8_t(buf, 28, target_num);
111 _mav_put_uint8_t(buf, 29, frame);
112 _mav_put_float(buf, 30, x);
113 _mav_put_float(buf, 34, y);
114 _mav_put_float(buf, 38, z);
115 _mav_put_uint8_t(buf, 58, type);
116 _mav_put_uint8_t(buf, 59, position_valid);
117 _mav_put_float_array(buf, 42, q, 4);
118 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
119 #else
120 mavlink_landing_target_t packet;
121 packet.time_usec = time_usec;
122 packet.angle_x = angle_x;
123 packet.angle_y = angle_y;
124 packet.distance = distance;
125 packet.size_x = size_x;
126 packet.size_y = size_y;
127 packet.target_num = target_num;
128 packet.frame = frame;
129 packet.x = x;
130 packet.y = y;
131 packet.z = z;
132 packet.type = type;
133 packet.position_valid = position_valid;
134 mav_array_memcpy(packet.q, q, sizeof(float)*4);
135 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
136 #endif
138 msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET;
139 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
143 * @brief Pack a landing_target message on a channel
144 * @param system_id ID of this system
145 * @param component_id ID of this component (e.g. 200 for IMU)
146 * @param chan The MAVLink channel this message will be sent over
147 * @param msg The MAVLink message to compress the data into
148 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
149 * @param target_num The ID of the target if multiple targets are present
150 * @param frame Coordinate frame used for following fields.
151 * @param angle_x [rad] X-axis angular offset of the target from the center of the image
152 * @param angle_y [rad] Y-axis angular offset of the target from the center of the image
153 * @param distance [m] Distance to the target from the vehicle
154 * @param size_x [rad] Size of target along x-axis
155 * @param size_y [rad] Size of target along y-axis
156 * @param x [m] X Position of the landing target in MAV_FRAME
157 * @param y [m] Y Position of the landing target in MAV_FRAME
158 * @param z [m] Z Position of the landing target in MAV_FRAME
159 * @param q Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
160 * @param type Type of landing target
161 * @param position_valid Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid).
162 * @return length of the message in bytes (excluding serial stream start sign)
164 static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
165 mavlink_message_t* msg,
166 uint64_t time_usec,uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance,float size_x,float size_y,float x,float y,float z,const float *q,uint8_t type,uint8_t position_valid)
168 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
169 char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
170 _mav_put_uint64_t(buf, 0, time_usec);
171 _mav_put_float(buf, 8, angle_x);
172 _mav_put_float(buf, 12, angle_y);
173 _mav_put_float(buf, 16, distance);
174 _mav_put_float(buf, 20, size_x);
175 _mav_put_float(buf, 24, size_y);
176 _mav_put_uint8_t(buf, 28, target_num);
177 _mav_put_uint8_t(buf, 29, frame);
178 _mav_put_float(buf, 30, x);
179 _mav_put_float(buf, 34, y);
180 _mav_put_float(buf, 38, z);
181 _mav_put_uint8_t(buf, 58, type);
182 _mav_put_uint8_t(buf, 59, position_valid);
183 _mav_put_float_array(buf, 42, q, 4);
184 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
185 #else
186 mavlink_landing_target_t packet;
187 packet.time_usec = time_usec;
188 packet.angle_x = angle_x;
189 packet.angle_y = angle_y;
190 packet.distance = distance;
191 packet.size_x = size_x;
192 packet.size_y = size_y;
193 packet.target_num = target_num;
194 packet.frame = frame;
195 packet.x = x;
196 packet.y = y;
197 packet.z = z;
198 packet.type = type;
199 packet.position_valid = position_valid;
200 mav_array_memcpy(packet.q, q, sizeof(float)*4);
201 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
202 #endif
204 msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET;
205 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
209 * @brief Encode a landing_target struct
211 * @param system_id ID of this system
212 * @param component_id ID of this component (e.g. 200 for IMU)
213 * @param msg The MAVLink message to compress the data into
214 * @param landing_target C-struct to read the message contents from
216 static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
218 return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);
222 * @brief Encode a landing_target struct on a channel
224 * @param system_id ID of this system
225 * @param component_id ID of this component (e.g. 200 for IMU)
226 * @param chan The MAVLink channel this message will be sent over
227 * @param msg The MAVLink message to compress the data into
228 * @param landing_target C-struct to read the message contents from
230 static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
232 return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);
236 * @brief Send a landing_target message
237 * @param chan MAVLink channel to send the message
239 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
240 * @param target_num The ID of the target if multiple targets are present
241 * @param frame Coordinate frame used for following fields.
242 * @param angle_x [rad] X-axis angular offset of the target from the center of the image
243 * @param angle_y [rad] Y-axis angular offset of the target from the center of the image
244 * @param distance [m] Distance to the target from the vehicle
245 * @param size_x [rad] Size of target along x-axis
246 * @param size_y [rad] Size of target along y-axis
247 * @param x [m] X Position of the landing target in MAV_FRAME
248 * @param y [m] Y Position of the landing target in MAV_FRAME
249 * @param z [m] Z Position of the landing target in MAV_FRAME
250 * @param q Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
251 * @param type Type of landing target
252 * @param position_valid Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid).
254 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
256 static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y, float x, float y, float z, const float *q, uint8_t type, uint8_t position_valid)
258 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
259 char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
260 _mav_put_uint64_t(buf, 0, time_usec);
261 _mav_put_float(buf, 8, angle_x);
262 _mav_put_float(buf, 12, angle_y);
263 _mav_put_float(buf, 16, distance);
264 _mav_put_float(buf, 20, size_x);
265 _mav_put_float(buf, 24, size_y);
266 _mav_put_uint8_t(buf, 28, target_num);
267 _mav_put_uint8_t(buf, 29, frame);
268 _mav_put_float(buf, 30, x);
269 _mav_put_float(buf, 34, y);
270 _mav_put_float(buf, 38, z);
271 _mav_put_uint8_t(buf, 58, type);
272 _mav_put_uint8_t(buf, 59, position_valid);
273 _mav_put_float_array(buf, 42, q, 4);
274 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
275 #else
276 mavlink_landing_target_t packet;
277 packet.time_usec = time_usec;
278 packet.angle_x = angle_x;
279 packet.angle_y = angle_y;
280 packet.distance = distance;
281 packet.size_x = size_x;
282 packet.size_y = size_y;
283 packet.target_num = target_num;
284 packet.frame = frame;
285 packet.x = x;
286 packet.y = y;
287 packet.z = z;
288 packet.type = type;
289 packet.position_valid = position_valid;
290 mav_array_memcpy(packet.q, q, sizeof(float)*4);
291 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)&packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
292 #endif
296 * @brief Send a landing_target message
297 * @param chan MAVLink channel to send the message
298 * @param struct The MAVLink struct to serialize
300 static inline void mavlink_msg_landing_target_send_struct(mavlink_channel_t chan, const mavlink_landing_target_t* landing_target)
302 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
303 mavlink_msg_landing_target_send(chan, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);
304 #else
305 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)landing_target, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
306 #endif
309 #if MAVLINK_MSG_ID_LANDING_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
311 This varient of _send() can be used to save stack space by re-using
312 memory from the receive buffer. The caller provides a
313 mavlink_message_t which is the size of a full mavlink message. This
314 is usually the receive buffer for the channel, and allows a reply to an
315 incoming message with minimum stack space usage.
317 static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y, float x, float y, float z, const float *q, uint8_t type, uint8_t position_valid)
319 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
320 char *buf = (char *)msgbuf;
321 _mav_put_uint64_t(buf, 0, time_usec);
322 _mav_put_float(buf, 8, angle_x);
323 _mav_put_float(buf, 12, angle_y);
324 _mav_put_float(buf, 16, distance);
325 _mav_put_float(buf, 20, size_x);
326 _mav_put_float(buf, 24, size_y);
327 _mav_put_uint8_t(buf, 28, target_num);
328 _mav_put_uint8_t(buf, 29, frame);
329 _mav_put_float(buf, 30, x);
330 _mav_put_float(buf, 34, y);
331 _mav_put_float(buf, 38, z);
332 _mav_put_uint8_t(buf, 58, type);
333 _mav_put_uint8_t(buf, 59, position_valid);
334 _mav_put_float_array(buf, 42, q, 4);
335 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
336 #else
337 mavlink_landing_target_t *packet = (mavlink_landing_target_t *)msgbuf;
338 packet->time_usec = time_usec;
339 packet->angle_x = angle_x;
340 packet->angle_y = angle_y;
341 packet->distance = distance;
342 packet->size_x = size_x;
343 packet->size_y = size_y;
344 packet->target_num = target_num;
345 packet->frame = frame;
346 packet->x = x;
347 packet->y = y;
348 packet->z = z;
349 packet->type = type;
350 packet->position_valid = position_valid;
351 mav_array_memcpy(packet->q, q, sizeof(float)*4);
352 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
353 #endif
355 #endif
357 #endif
359 // MESSAGE LANDING_TARGET UNPACKING
363 * @brief Get field time_usec from landing_target message
365 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
367 static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_message_t* msg)
369 return _MAV_RETURN_uint64_t(msg, 0);
373 * @brief Get field target_num from landing_target message
375 * @return The ID of the target if multiple targets are present
377 static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_message_t* msg)
379 return _MAV_RETURN_uint8_t(msg, 28);
383 * @brief Get field frame from landing_target message
385 * @return Coordinate frame used for following fields.
387 static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message_t* msg)
389 return _MAV_RETURN_uint8_t(msg, 29);
393 * @brief Get field angle_x from landing_target message
395 * @return [rad] X-axis angular offset of the target from the center of the image
397 static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message_t* msg)
399 return _MAV_RETURN_float(msg, 8);
403 * @brief Get field angle_y from landing_target message
405 * @return [rad] Y-axis angular offset of the target from the center of the image
407 static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message_t* msg)
409 return _MAV_RETURN_float(msg, 12);
413 * @brief Get field distance from landing_target message
415 * @return [m] Distance to the target from the vehicle
417 static inline float mavlink_msg_landing_target_get_distance(const mavlink_message_t* msg)
419 return _MAV_RETURN_float(msg, 16);
423 * @brief Get field size_x from landing_target message
425 * @return [rad] Size of target along x-axis
427 static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_t* msg)
429 return _MAV_RETURN_float(msg, 20);
433 * @brief Get field size_y from landing_target message
435 * @return [rad] Size of target along y-axis
437 static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_t* msg)
439 return _MAV_RETURN_float(msg, 24);
443 * @brief Get field x from landing_target message
445 * @return [m] X Position of the landing target in MAV_FRAME
447 static inline float mavlink_msg_landing_target_get_x(const mavlink_message_t* msg)
449 return _MAV_RETURN_float(msg, 30);
453 * @brief Get field y from landing_target message
455 * @return [m] Y Position of the landing target in MAV_FRAME
457 static inline float mavlink_msg_landing_target_get_y(const mavlink_message_t* msg)
459 return _MAV_RETURN_float(msg, 34);
463 * @brief Get field z from landing_target message
465 * @return [m] Z Position of the landing target in MAV_FRAME
467 static inline float mavlink_msg_landing_target_get_z(const mavlink_message_t* msg)
469 return _MAV_RETURN_float(msg, 38);
473 * @brief Get field q from landing_target message
475 * @return Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
477 static inline uint16_t mavlink_msg_landing_target_get_q(const mavlink_message_t* msg, float *q)
479 return _MAV_RETURN_float_array(msg, q, 4, 42);
483 * @brief Get field type from landing_target message
485 * @return Type of landing target
487 static inline uint8_t mavlink_msg_landing_target_get_type(const mavlink_message_t* msg)
489 return _MAV_RETURN_uint8_t(msg, 58);
493 * @brief Get field position_valid from landing_target message
495 * @return Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid).
497 static inline uint8_t mavlink_msg_landing_target_get_position_valid(const mavlink_message_t* msg)
499 return _MAV_RETURN_uint8_t(msg, 59);
503 * @brief Decode a landing_target message into a struct
505 * @param msg The message to decode
506 * @param landing_target C-struct to decode the message contents into
508 static inline void mavlink_msg_landing_target_decode(const mavlink_message_t* msg, mavlink_landing_target_t* landing_target)
510 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
511 landing_target->time_usec = mavlink_msg_landing_target_get_time_usec(msg);
512 landing_target->angle_x = mavlink_msg_landing_target_get_angle_x(msg);
513 landing_target->angle_y = mavlink_msg_landing_target_get_angle_y(msg);
514 landing_target->distance = mavlink_msg_landing_target_get_distance(msg);
515 landing_target->size_x = mavlink_msg_landing_target_get_size_x(msg);
516 landing_target->size_y = mavlink_msg_landing_target_get_size_y(msg);
517 landing_target->target_num = mavlink_msg_landing_target_get_target_num(msg);
518 landing_target->frame = mavlink_msg_landing_target_get_frame(msg);
519 landing_target->x = mavlink_msg_landing_target_get_x(msg);
520 landing_target->y = mavlink_msg_landing_target_get_y(msg);
521 landing_target->z = mavlink_msg_landing_target_get_z(msg);
522 mavlink_msg_landing_target_get_q(msg, landing_target->q);
523 landing_target->type = mavlink_msg_landing_target_get_type(msg);
524 landing_target->position_valid = mavlink_msg_landing_target_get_position_valid(msg);
525 #else
526 uint8_t len = msg->len < MAVLINK_MSG_ID_LANDING_TARGET_LEN? msg->len : MAVLINK_MSG_ID_LANDING_TARGET_LEN;
527 memset(landing_target, 0, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
528 memcpy(landing_target, _MAV_PAYLOAD(msg), len);
529 #endif