Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_follow_target.h
blob01d03ab510fb315c65d1ebdf5d52d6b5711e56b4
1 #pragma once
2 // MESSAGE FOLLOW_TARGET PACKING
4 #define MAVLINK_MSG_ID_FOLLOW_TARGET 144
7 typedef struct __mavlink_follow_target_t {
8 uint64_t timestamp; /*< [ms] Timestamp (time since system boot).*/
9 uint64_t custom_state; /*< button states or switches of a tracker device*/
10 int32_t lat; /*< [degE7] Latitude (WGS84)*/
11 int32_t lon; /*< [degE7] Longitude (WGS84)*/
12 float alt; /*< [m] Altitude (MSL)*/
13 float vel[3]; /*< [m/s] target velocity (0,0,0) for unknown*/
14 float acc[3]; /*< [m/s/s] linear target acceleration (0,0,0) for unknown*/
15 float attitude_q[4]; /*< (1 0 0 0 for unknown)*/
16 float rates[3]; /*< (0 0 0 for unknown)*/
17 float position_cov[3]; /*< eph epv*/
18 uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/
19 } mavlink_follow_target_t;
21 #define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93
22 #define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93
23 #define MAVLINK_MSG_ID_144_LEN 93
24 #define MAVLINK_MSG_ID_144_MIN_LEN 93
26 #define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 127
27 #define MAVLINK_MSG_ID_144_CRC 127
29 #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_VEL_LEN 3
30 #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ACC_LEN 3
31 #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ATTITUDE_Q_LEN 4
32 #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_RATES_LEN 3
33 #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_POSITION_COV_LEN 3
35 #if MAVLINK_COMMAND_24BIT
36 #define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
37 144, \
38 "FOLLOW_TARGET", \
39 11, \
40 { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
41 { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
42 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
43 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
44 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
45 { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
46 { "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
47 { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
48 { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
49 { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
50 { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
51 } \
53 #else
54 #define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
55 "FOLLOW_TARGET", \
56 11, \
57 { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
58 { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
59 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
60 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
61 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
62 { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
63 { "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
64 { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
65 { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
66 { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
67 { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
68 } \
70 #endif
72 /**
73 * @brief Pack a follow_target message
74 * @param system_id ID of this system
75 * @param component_id ID of this component (e.g. 200 for IMU)
76 * @param msg The MAVLink message to compress the data into
78 * @param timestamp [ms] Timestamp (time since system boot).
79 * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
80 * @param lat [degE7] Latitude (WGS84)
81 * @param lon [degE7] Longitude (WGS84)
82 * @param alt [m] Altitude (MSL)
83 * @param vel [m/s] target velocity (0,0,0) for unknown
84 * @param acc [m/s/s] linear target acceleration (0,0,0) for unknown
85 * @param attitude_q (1 0 0 0 for unknown)
86 * @param rates (0 0 0 for unknown)
87 * @param position_cov eph epv
88 * @param custom_state button states or switches of a tracker device
89 * @return length of the message in bytes (excluding serial stream start sign)
91 static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
94 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
96 _mav_put_uint64_t(buf, 0, timestamp);
97 _mav_put_uint64_t(buf, 8, custom_state);
98 _mav_put_int32_t(buf, 16, lat);
99 _mav_put_int32_t(buf, 20, lon);
100 _mav_put_float(buf, 24, alt);
101 _mav_put_uint8_t(buf, 92, est_capabilities);
102 _mav_put_float_array(buf, 28, vel, 3);
103 _mav_put_float_array(buf, 40, acc, 3);
104 _mav_put_float_array(buf, 52, attitude_q, 4);
105 _mav_put_float_array(buf, 68, rates, 3);
106 _mav_put_float_array(buf, 80, position_cov, 3);
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
108 #else
109 mavlink_follow_target_t packet;
110 packet.timestamp = timestamp;
111 packet.custom_state = custom_state;
112 packet.lat = lat;
113 packet.lon = lon;
114 packet.alt = alt;
115 packet.est_capabilities = est_capabilities;
116 mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
117 mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
118 mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
119 mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
120 mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
121 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
122 #endif
124 msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
125 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
129 * @brief Pack a follow_target message on a channel
130 * @param system_id ID of this system
131 * @param component_id ID of this component (e.g. 200 for IMU)
132 * @param chan The MAVLink channel this message will be sent over
133 * @param msg The MAVLink message to compress the data into
134 * @param timestamp [ms] Timestamp (time since system boot).
135 * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
136 * @param lat [degE7] Latitude (WGS84)
137 * @param lon [degE7] Longitude (WGS84)
138 * @param alt [m] Altitude (MSL)
139 * @param vel [m/s] target velocity (0,0,0) for unknown
140 * @param acc [m/s/s] linear target acceleration (0,0,0) for unknown
141 * @param attitude_q (1 0 0 0 for unknown)
142 * @param rates (0 0 0 for unknown)
143 * @param position_cov eph epv
144 * @param custom_state button states or switches of a tracker device
145 * @return length of the message in bytes (excluding serial stream start sign)
147 static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
148 mavlink_message_t* msg,
149 uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state)
151 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
152 char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
153 _mav_put_uint64_t(buf, 0, timestamp);
154 _mav_put_uint64_t(buf, 8, custom_state);
155 _mav_put_int32_t(buf, 16, lat);
156 _mav_put_int32_t(buf, 20, lon);
157 _mav_put_float(buf, 24, alt);
158 _mav_put_uint8_t(buf, 92, est_capabilities);
159 _mav_put_float_array(buf, 28, vel, 3);
160 _mav_put_float_array(buf, 40, acc, 3);
161 _mav_put_float_array(buf, 52, attitude_q, 4);
162 _mav_put_float_array(buf, 68, rates, 3);
163 _mav_put_float_array(buf, 80, position_cov, 3);
164 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
165 #else
166 mavlink_follow_target_t packet;
167 packet.timestamp = timestamp;
168 packet.custom_state = custom_state;
169 packet.lat = lat;
170 packet.lon = lon;
171 packet.alt = alt;
172 packet.est_capabilities = est_capabilities;
173 mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
174 mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
175 mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
176 mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
177 mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
179 #endif
181 msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
182 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
186 * @brief Encode a follow_target struct
188 * @param system_id ID of this system
189 * @param component_id ID of this component (e.g. 200 for IMU)
190 * @param msg The MAVLink message to compress the data into
191 * @param follow_target C-struct to read the message contents from
193 static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
195 return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
199 * @brief Encode a follow_target struct on a channel
201 * @param system_id ID of this system
202 * @param component_id ID of this component (e.g. 200 for IMU)
203 * @param chan The MAVLink channel this message will be sent over
204 * @param msg The MAVLink message to compress the data into
205 * @param follow_target C-struct to read the message contents from
207 static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
209 return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
213 * @brief Send a follow_target message
214 * @param chan MAVLink channel to send the message
216 * @param timestamp [ms] Timestamp (time since system boot).
217 * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
218 * @param lat [degE7] Latitude (WGS84)
219 * @param lon [degE7] Longitude (WGS84)
220 * @param alt [m] Altitude (MSL)
221 * @param vel [m/s] target velocity (0,0,0) for unknown
222 * @param acc [m/s/s] linear target acceleration (0,0,0) for unknown
223 * @param attitude_q (1 0 0 0 for unknown)
224 * @param rates (0 0 0 for unknown)
225 * @param position_cov eph epv
226 * @param custom_state button states or switches of a tracker device
228 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
230 static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
232 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
233 char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
234 _mav_put_uint64_t(buf, 0, timestamp);
235 _mav_put_uint64_t(buf, 8, custom_state);
236 _mav_put_int32_t(buf, 16, lat);
237 _mav_put_int32_t(buf, 20, lon);
238 _mav_put_float(buf, 24, alt);
239 _mav_put_uint8_t(buf, 92, est_capabilities);
240 _mav_put_float_array(buf, 28, vel, 3);
241 _mav_put_float_array(buf, 40, acc, 3);
242 _mav_put_float_array(buf, 52, attitude_q, 4);
243 _mav_put_float_array(buf, 68, rates, 3);
244 _mav_put_float_array(buf, 80, position_cov, 3);
245 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
246 #else
247 mavlink_follow_target_t packet;
248 packet.timestamp = timestamp;
249 packet.custom_state = custom_state;
250 packet.lat = lat;
251 packet.lon = lon;
252 packet.alt = alt;
253 packet.est_capabilities = est_capabilities;
254 mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
255 mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
256 mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
257 mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
258 mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
259 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
260 #endif
264 * @brief Send a follow_target message
265 * @param chan MAVLink channel to send the message
266 * @param struct The MAVLink struct to serialize
268 static inline void mavlink_msg_follow_target_send_struct(mavlink_channel_t chan, const mavlink_follow_target_t* follow_target)
270 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
271 mavlink_msg_follow_target_send(chan, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
272 #else
273 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)follow_target, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
274 #endif
277 #if MAVLINK_MSG_ID_FOLLOW_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
279 This varient of _send() can be used to save stack space by re-using
280 memory from the receive buffer. The caller provides a
281 mavlink_message_t which is the size of a full mavlink message. This
282 is usually the receive buffer for the channel, and allows a reply to an
283 incoming message with minimum stack space usage.
285 static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
287 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
288 char *buf = (char *)msgbuf;
289 _mav_put_uint64_t(buf, 0, timestamp);
290 _mav_put_uint64_t(buf, 8, custom_state);
291 _mav_put_int32_t(buf, 16, lat);
292 _mav_put_int32_t(buf, 20, lon);
293 _mav_put_float(buf, 24, alt);
294 _mav_put_uint8_t(buf, 92, est_capabilities);
295 _mav_put_float_array(buf, 28, vel, 3);
296 _mav_put_float_array(buf, 40, acc, 3);
297 _mav_put_float_array(buf, 52, attitude_q, 4);
298 _mav_put_float_array(buf, 68, rates, 3);
299 _mav_put_float_array(buf, 80, position_cov, 3);
300 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
301 #else
302 mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf;
303 packet->timestamp = timestamp;
304 packet->custom_state = custom_state;
305 packet->lat = lat;
306 packet->lon = lon;
307 packet->alt = alt;
308 packet->est_capabilities = est_capabilities;
309 mav_array_memcpy(packet->vel, vel, sizeof(float)*3);
310 mav_array_memcpy(packet->acc, acc, sizeof(float)*3);
311 mav_array_memcpy(packet->attitude_q, attitude_q, sizeof(float)*4);
312 mav_array_memcpy(packet->rates, rates, sizeof(float)*3);
313 mav_array_memcpy(packet->position_cov, position_cov, sizeof(float)*3);
314 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
315 #endif
317 #endif
319 #endif
321 // MESSAGE FOLLOW_TARGET UNPACKING
325 * @brief Get field timestamp from follow_target message
327 * @return [ms] Timestamp (time since system boot).
329 static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg)
331 return _MAV_RETURN_uint64_t(msg, 0);
335 * @brief Get field est_capabilities from follow_target message
337 * @return bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
339 static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg)
341 return _MAV_RETURN_uint8_t(msg, 92);
345 * @brief Get field lat from follow_target message
347 * @return [degE7] Latitude (WGS84)
349 static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg)
351 return _MAV_RETURN_int32_t(msg, 16);
355 * @brief Get field lon from follow_target message
357 * @return [degE7] Longitude (WGS84)
359 static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg)
361 return _MAV_RETURN_int32_t(msg, 20);
365 * @brief Get field alt from follow_target message
367 * @return [m] Altitude (MSL)
369 static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg)
371 return _MAV_RETURN_float(msg, 24);
375 * @brief Get field vel from follow_target message
377 * @return [m/s] target velocity (0,0,0) for unknown
379 static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel)
381 return _MAV_RETURN_float_array(msg, vel, 3, 28);
385 * @brief Get field acc from follow_target message
387 * @return [m/s/s] linear target acceleration (0,0,0) for unknown
389 static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc)
391 return _MAV_RETURN_float_array(msg, acc, 3, 40);
395 * @brief Get field attitude_q from follow_target message
397 * @return (1 0 0 0 for unknown)
399 static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q)
401 return _MAV_RETURN_float_array(msg, attitude_q, 4, 52);
405 * @brief Get field rates from follow_target message
407 * @return (0 0 0 for unknown)
409 static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates)
411 return _MAV_RETURN_float_array(msg, rates, 3, 68);
415 * @brief Get field position_cov from follow_target message
417 * @return eph epv
419 static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov)
421 return _MAV_RETURN_float_array(msg, position_cov, 3, 80);
425 * @brief Get field custom_state from follow_target message
427 * @return button states or switches of a tracker device
429 static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg)
431 return _MAV_RETURN_uint64_t(msg, 8);
435 * @brief Decode a follow_target message into a struct
437 * @param msg The message to decode
438 * @param follow_target C-struct to decode the message contents into
440 static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg, mavlink_follow_target_t* follow_target)
442 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
443 follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg);
444 follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg);
445 follow_target->lat = mavlink_msg_follow_target_get_lat(msg);
446 follow_target->lon = mavlink_msg_follow_target_get_lon(msg);
447 follow_target->alt = mavlink_msg_follow_target_get_alt(msg);
448 mavlink_msg_follow_target_get_vel(msg, follow_target->vel);
449 mavlink_msg_follow_target_get_acc(msg, follow_target->acc);
450 mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q);
451 mavlink_msg_follow_target_get_rates(msg, follow_target->rates);
452 mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov);
453 follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg);
454 #else
455 uint8_t len = msg->len < MAVLINK_MSG_ID_FOLLOW_TARGET_LEN? msg->len : MAVLINK_MSG_ID_FOLLOW_TARGET_LEN;
456 memset(follow_target, 0, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
457 memcpy(follow_target, _MAV_PAYLOAD(msg), len);
458 #endif