Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_autopilot_state_for_gimbal_device.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE AUTOPILOT_STATE_FOR_GIMBAL_DEVICE PACKING
3
4#define MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE 286
5
6MAVPACKED(
7typedef struct __mavlink_autopilot_state_for_gimbal_device_t {
8 uint64_t time_boot_us; /*< [us] Timestamp (time since system boot).*/
9 float q[4]; /*< Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).*/
10 uint32_t q_estimated_delay_us; /*< [us] Estimated delay of the attitude data. 0 if unknown.*/
11 float vx; /*< [m/s] X Speed in NED (North, East, Down). NAN if unknown.*/
12 float vy; /*< [m/s] Y Speed in NED (North, East, Down). NAN if unknown.*/
13 float vz; /*< [m/s] Z Speed in NED (North, East, Down). NAN if unknown.*/
14 uint32_t v_estimated_delay_us; /*< [us] Estimated delay of the speed data. 0 if unknown.*/
15 float feed_forward_angular_velocity_z; /*< [rad/s] Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.*/
16 uint16_t estimator_status; /*< Bitmap indicating which estimator outputs are valid.*/
17 uint8_t target_system; /*< System ID*/
18 uint8_t target_component; /*< Component ID*/
19 uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/
20 float angular_velocity_z; /*< [rad/s] Z component of angular velocity in NED (North, East, Down). NaN if unknown.*/
21}) mavlink_autopilot_state_for_gimbal_device_t;
22
23#define MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN 57
24#define MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN 53
25#define MAVLINK_MSG_ID_286_LEN 57
26#define MAVLINK_MSG_ID_286_MIN_LEN 53
27
28#define MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC 210
29#define MAVLINK_MSG_ID_286_CRC 210
30
31#define MAVLINK_MSG_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_FIELD_Q_LEN 4
32
33#if MAVLINK_COMMAND_24BIT
34#define MAVLINK_MESSAGE_INFO_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE {
35 286,
36 "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE",
37 13,
38 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_autopilot_state_for_gimbal_device_t, target_system) },
39 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_autopilot_state_for_gimbal_device_t, target_component) },
40 { "time_boot_us", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_state_for_gimbal_device_t, time_boot_us) },
41 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_autopilot_state_for_gimbal_device_t, q) },
42 { "q_estimated_delay_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_state_for_gimbal_device_t, q_estimated_delay_us) },
43 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_autopilot_state_for_gimbal_device_t, vx) },
44 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_autopilot_state_for_gimbal_device_t, vy) },
45 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_autopilot_state_for_gimbal_device_t, vz) },
46 { "v_estimated_delay_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 40, offsetof(mavlink_autopilot_state_for_gimbal_device_t, v_estimated_delay_us) },
47 { "feed_forward_angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_autopilot_state_for_gimbal_device_t, feed_forward_angular_velocity_z) },
48 { "estimator_status", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_autopilot_state_for_gimbal_device_t, estimator_status) },
49 { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_autopilot_state_for_gimbal_device_t, landed_state) },
50 { "angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 53, offsetof(mavlink_autopilot_state_for_gimbal_device_t, angular_velocity_z) },
51 } \
52}
53#else
54#define MAVLINK_MESSAGE_INFO_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE {
55 "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE",
56 13,
57 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_autopilot_state_for_gimbal_device_t, target_system) },
58 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_autopilot_state_for_gimbal_device_t, target_component) },
59 { "time_boot_us", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_state_for_gimbal_device_t, time_boot_us) },
60 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_autopilot_state_for_gimbal_device_t, q) },
61 { "q_estimated_delay_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_state_for_gimbal_device_t, q_estimated_delay_us) },
62 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_autopilot_state_for_gimbal_device_t, vx) },
63 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_autopilot_state_for_gimbal_device_t, vy) },
64 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_autopilot_state_for_gimbal_device_t, vz) },
65 { "v_estimated_delay_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 40, offsetof(mavlink_autopilot_state_for_gimbal_device_t, v_estimated_delay_us) },
66 { "feed_forward_angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_autopilot_state_for_gimbal_device_t, feed_forward_angular_velocity_z) },
67 { "estimator_status", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_autopilot_state_for_gimbal_device_t, estimator_status) },
68 { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_autopilot_state_for_gimbal_device_t, landed_state) },
69 { "angular_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 53, offsetof(mavlink_autopilot_state_for_gimbal_device_t, angular_velocity_z) },
70 } \
71}
72#endif
73
74/**
75 * @brief Pack a autopilot_state_for_gimbal_device message
76 * @param system_id ID of this system
77 * @param component_id ID of this component (e.g. 200 for IMU)
78 * @param msg The MAVLink message to compress the data into
79 *
80 * @param target_system System ID
81 * @param target_component Component ID
82 * @param time_boot_us [us] Timestamp (time since system boot).
83 * @param q Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).
84 * @param q_estimated_delay_us [us] Estimated delay of the attitude data. 0 if unknown.
85 * @param vx [m/s] X Speed in NED (North, East, Down). NAN if unknown.
86 * @param vy [m/s] Y Speed in NED (North, East, Down). NAN if unknown.
87 * @param vz [m/s] Z Speed in NED (North, East, Down). NAN if unknown.
88 * @param v_estimated_delay_us [us] Estimated delay of the speed data. 0 if unknown.
89 * @param feed_forward_angular_velocity_z [rad/s] Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.
90 * @param estimator_status Bitmap indicating which estimator outputs are valid.
91 * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
92 * @param angular_velocity_z [rad/s] Z component of angular velocity in NED (North, East, Down). NaN if unknown.
93 * @return length of the message in bytes (excluding serial stream start sign)
94 */
95static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
96 uint8_t target_system, uint8_t target_component, uint64_t time_boot_us, const float *q, uint32_t q_estimated_delay_us, float vx, float vy, float vz, uint32_t v_estimated_delay_us, float feed_forward_angular_velocity_z, uint16_t estimator_status, uint8_t landed_state, float angular_velocity_z)
97{
98#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
100 _mav_put_uint64_t(buf, 0, time_boot_us);
101 _mav_put_uint32_t(buf, 24, q_estimated_delay_us);
102 _mav_put_float(buf, 28, vx);
103 _mav_put_float(buf, 32, vy);
104 _mav_put_float(buf, 36, vz);
105 _mav_put_uint32_t(buf, 40, v_estimated_delay_us);
106 _mav_put_float(buf, 44, feed_forward_angular_velocity_z);
107 _mav_put_uint16_t(buf, 48, estimator_status);
108 _mav_put_uint8_t(buf, 50, target_system);
109 _mav_put_uint8_t(buf, 51, target_component);
110 _mav_put_uint8_t(buf, 52, landed_state);
111 _mav_put_float(buf, 53, angular_velocity_z);
112 _mav_put_float_array(buf, 8, q, 4);
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
114#else
115 mavlink_autopilot_state_for_gimbal_device_t packet;
116 packet.time_boot_us = time_boot_us;
117 packet.q_estimated_delay_us = q_estimated_delay_us;
118 packet.vx = vx;
119 packet.vy = vy;
120 packet.vz = vz;
121 packet.v_estimated_delay_us = v_estimated_delay_us;
122 packet.feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
123 packet.estimator_status = estimator_status;
124 packet.target_system = target_system;
125 packet.target_component = target_component;
126 packet.landed_state = landed_state;
127 packet.angular_velocity_z = angular_velocity_z;
128 mav_array_memcpy(packet.q, q, sizeof(float)*4);
129 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
130#endif
131
134}
135
136/**
137 * @brief Pack a autopilot_state_for_gimbal_device message
138 * @param system_id ID of this system
139 * @param component_id ID of this component (e.g. 200 for IMU)
140 * @param status MAVLink status structure
141 * @param msg The MAVLink message to compress the data into
142 *
143 * @param target_system System ID
144 * @param target_component Component ID
145 * @param time_boot_us [us] Timestamp (time since system boot).
146 * @param q Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).
147 * @param q_estimated_delay_us [us] Estimated delay of the attitude data. 0 if unknown.
148 * @param vx [m/s] X Speed in NED (North, East, Down). NAN if unknown.
149 * @param vy [m/s] Y Speed in NED (North, East, Down). NAN if unknown.
150 * @param vz [m/s] Z Speed in NED (North, East, Down). NAN if unknown.
151 * @param v_estimated_delay_us [us] Estimated delay of the speed data. 0 if unknown.
152 * @param feed_forward_angular_velocity_z [rad/s] Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.
153 * @param estimator_status Bitmap indicating which estimator outputs are valid.
154 * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
155 * @param angular_velocity_z [rad/s] Z component of angular velocity in NED (North, East, Down). NaN if unknown.
156 * @return length of the message in bytes (excluding serial stream start sign)
157 */
158static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
159 uint8_t target_system, uint8_t target_component, uint64_t time_boot_us, const float *q, uint32_t q_estimated_delay_us, float vx, float vy, float vz, uint32_t v_estimated_delay_us, float feed_forward_angular_velocity_z, uint16_t estimator_status, uint8_t landed_state, float angular_velocity_z)
160{
161#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
163 _mav_put_uint64_t(buf, 0, time_boot_us);
164 _mav_put_uint32_t(buf, 24, q_estimated_delay_us);
165 _mav_put_float(buf, 28, vx);
166 _mav_put_float(buf, 32, vy);
167 _mav_put_float(buf, 36, vz);
168 _mav_put_uint32_t(buf, 40, v_estimated_delay_us);
169 _mav_put_float(buf, 44, feed_forward_angular_velocity_z);
170 _mav_put_uint16_t(buf, 48, estimator_status);
171 _mav_put_uint8_t(buf, 50, target_system);
172 _mav_put_uint8_t(buf, 51, target_component);
173 _mav_put_uint8_t(buf, 52, landed_state);
174 _mav_put_float(buf, 53, angular_velocity_z);
175 _mav_put_float_array(buf, 8, q, 4);
176 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
177#else
178 mavlink_autopilot_state_for_gimbal_device_t packet;
179 packet.time_boot_us = time_boot_us;
180 packet.q_estimated_delay_us = q_estimated_delay_us;
181 packet.vx = vx;
182 packet.vy = vy;
183 packet.vz = vz;
184 packet.v_estimated_delay_us = v_estimated_delay_us;
185 packet.feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
186 packet.estimator_status = estimator_status;
187 packet.target_system = target_system;
188 packet.target_component = target_component;
189 packet.landed_state = landed_state;
190 packet.angular_velocity_z = angular_velocity_z;
191 mav_array_memcpy(packet.q, q, sizeof(float)*4);
192 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
193#endif
194
196#if MAVLINK_CRC_EXTRA
197 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC);
198#else
199 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
200#endif
201}
202
203/**
204 * @brief Pack a autopilot_state_for_gimbal_device message on a channel
205 * @param system_id ID of this system
206 * @param component_id ID of this component (e.g. 200 for IMU)
207 * @param chan The MAVLink channel this message will be sent over
208 * @param msg The MAVLink message to compress the data into
209 * @param target_system System ID
210 * @param target_component Component ID
211 * @param time_boot_us [us] Timestamp (time since system boot).
212 * @param q Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).
213 * @param q_estimated_delay_us [us] Estimated delay of the attitude data. 0 if unknown.
214 * @param vx [m/s] X Speed in NED (North, East, Down). NAN if unknown.
215 * @param vy [m/s] Y Speed in NED (North, East, Down). NAN if unknown.
216 * @param vz [m/s] Z Speed in NED (North, East, Down). NAN if unknown.
217 * @param v_estimated_delay_us [us] Estimated delay of the speed data. 0 if unknown.
218 * @param feed_forward_angular_velocity_z [rad/s] Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.
219 * @param estimator_status Bitmap indicating which estimator outputs are valid.
220 * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
221 * @param angular_velocity_z [rad/s] Z component of angular velocity in NED (North, East, Down). NaN if unknown.
222 * @return length of the message in bytes (excluding serial stream start sign)
223 */
224static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
225 mavlink_message_t* msg,
226 uint8_t target_system,uint8_t target_component,uint64_t time_boot_us,const float *q,uint32_t q_estimated_delay_us,float vx,float vy,float vz,uint32_t v_estimated_delay_us,float feed_forward_angular_velocity_z,uint16_t estimator_status,uint8_t landed_state,float angular_velocity_z)
227{
228#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 _mav_put_uint64_t(buf, 0, time_boot_us);
231 _mav_put_uint32_t(buf, 24, q_estimated_delay_us);
232 _mav_put_float(buf, 28, vx);
233 _mav_put_float(buf, 32, vy);
234 _mav_put_float(buf, 36, vz);
235 _mav_put_uint32_t(buf, 40, v_estimated_delay_us);
236 _mav_put_float(buf, 44, feed_forward_angular_velocity_z);
237 _mav_put_uint16_t(buf, 48, estimator_status);
238 _mav_put_uint8_t(buf, 50, target_system);
239 _mav_put_uint8_t(buf, 51, target_component);
240 _mav_put_uint8_t(buf, 52, landed_state);
241 _mav_put_float(buf, 53, angular_velocity_z);
242 _mav_put_float_array(buf, 8, q, 4);
243 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
244#else
245 mavlink_autopilot_state_for_gimbal_device_t packet;
246 packet.time_boot_us = time_boot_us;
247 packet.q_estimated_delay_us = q_estimated_delay_us;
248 packet.vx = vx;
249 packet.vy = vy;
250 packet.vz = vz;
251 packet.v_estimated_delay_us = v_estimated_delay_us;
252 packet.feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
253 packet.estimator_status = estimator_status;
254 packet.target_system = target_system;
255 packet.target_component = target_component;
256 packet.landed_state = landed_state;
257 packet.angular_velocity_z = angular_velocity_z;
258 mav_array_memcpy(packet.q, q, sizeof(float)*4);
259 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
260#endif
261
264}
265
266/**
267 * @brief Encode a autopilot_state_for_gimbal_device struct
268 *
269 * @param system_id ID of this system
270 * @param component_id ID of this component (e.g. 200 for IMU)
271 * @param msg The MAVLink message to compress the data into
272 * @param autopilot_state_for_gimbal_device C-struct to read the message contents from
273 */
274static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_autopilot_state_for_gimbal_device_t* autopilot_state_for_gimbal_device)
275{
276 return mavlink_msg_autopilot_state_for_gimbal_device_pack(system_id, component_id, msg, autopilot_state_for_gimbal_device->target_system, autopilot_state_for_gimbal_device->target_component, autopilot_state_for_gimbal_device->time_boot_us, autopilot_state_for_gimbal_device->q, autopilot_state_for_gimbal_device->q_estimated_delay_us, autopilot_state_for_gimbal_device->vx, autopilot_state_for_gimbal_device->vy, autopilot_state_for_gimbal_device->vz, autopilot_state_for_gimbal_device->v_estimated_delay_us, autopilot_state_for_gimbal_device->feed_forward_angular_velocity_z, autopilot_state_for_gimbal_device->estimator_status, autopilot_state_for_gimbal_device->landed_state, autopilot_state_for_gimbal_device->angular_velocity_z);
277}
278
279/**
280 * @brief Encode a autopilot_state_for_gimbal_device struct on a channel
281 *
282 * @param system_id ID of this system
283 * @param component_id ID of this component (e.g. 200 for IMU)
284 * @param chan The MAVLink channel this message will be sent over
285 * @param msg The MAVLink message to compress the data into
286 * @param autopilot_state_for_gimbal_device C-struct to read the message contents from
287 */
288static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_autopilot_state_for_gimbal_device_t* autopilot_state_for_gimbal_device)
289{
290 return mavlink_msg_autopilot_state_for_gimbal_device_pack_chan(system_id, component_id, chan, msg, autopilot_state_for_gimbal_device->target_system, autopilot_state_for_gimbal_device->target_component, autopilot_state_for_gimbal_device->time_boot_us, autopilot_state_for_gimbal_device->q, autopilot_state_for_gimbal_device->q_estimated_delay_us, autopilot_state_for_gimbal_device->vx, autopilot_state_for_gimbal_device->vy, autopilot_state_for_gimbal_device->vz, autopilot_state_for_gimbal_device->v_estimated_delay_us, autopilot_state_for_gimbal_device->feed_forward_angular_velocity_z, autopilot_state_for_gimbal_device->estimator_status, autopilot_state_for_gimbal_device->landed_state, autopilot_state_for_gimbal_device->angular_velocity_z);
291}
292
293/**
294 * @brief Encode a autopilot_state_for_gimbal_device struct with provided status structure
295 *
296 * @param system_id ID of this system
297 * @param component_id ID of this component (e.g. 200 for IMU)
298 * @param status MAVLink status structure
299 * @param msg The MAVLink message to compress the data into
300 * @param autopilot_state_for_gimbal_device C-struct to read the message contents from
301 */
302static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_autopilot_state_for_gimbal_device_t* autopilot_state_for_gimbal_device)
303{
304 return mavlink_msg_autopilot_state_for_gimbal_device_pack_status(system_id, component_id, _status, msg, autopilot_state_for_gimbal_device->target_system, autopilot_state_for_gimbal_device->target_component, autopilot_state_for_gimbal_device->time_boot_us, autopilot_state_for_gimbal_device->q, autopilot_state_for_gimbal_device->q_estimated_delay_us, autopilot_state_for_gimbal_device->vx, autopilot_state_for_gimbal_device->vy, autopilot_state_for_gimbal_device->vz, autopilot_state_for_gimbal_device->v_estimated_delay_us, autopilot_state_for_gimbal_device->feed_forward_angular_velocity_z, autopilot_state_for_gimbal_device->estimator_status, autopilot_state_for_gimbal_device->landed_state, autopilot_state_for_gimbal_device->angular_velocity_z);
305}
306
307/**
308 * @brief Send a autopilot_state_for_gimbal_device message
309 * @param chan MAVLink channel to send the message
310 *
311 * @param target_system System ID
312 * @param target_component Component ID
313 * @param time_boot_us [us] Timestamp (time since system boot).
314 * @param q Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).
315 * @param q_estimated_delay_us [us] Estimated delay of the attitude data. 0 if unknown.
316 * @param vx [m/s] X Speed in NED (North, East, Down). NAN if unknown.
317 * @param vy [m/s] Y Speed in NED (North, East, Down). NAN if unknown.
318 * @param vz [m/s] Z Speed in NED (North, East, Down). NAN if unknown.
319 * @param v_estimated_delay_us [us] Estimated delay of the speed data. 0 if unknown.
320 * @param feed_forward_angular_velocity_z [rad/s] Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.
321 * @param estimator_status Bitmap indicating which estimator outputs are valid.
322 * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
323 * @param angular_velocity_z [rad/s] Z component of angular velocity in NED (North, East, Down). NaN if unknown.
324 */
325#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
326
327static inline void mavlink_msg_autopilot_state_for_gimbal_device_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint64_t time_boot_us, const float *q, uint32_t q_estimated_delay_us, float vx, float vy, float vz, uint32_t v_estimated_delay_us, float feed_forward_angular_velocity_z, uint16_t estimator_status, uint8_t landed_state, float angular_velocity_z)
328{
329#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
330 char buf[MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN];
331 _mav_put_uint64_t(buf, 0, time_boot_us);
332 _mav_put_uint32_t(buf, 24, q_estimated_delay_us);
333 _mav_put_float(buf, 28, vx);
334 _mav_put_float(buf, 32, vy);
335 _mav_put_float(buf, 36, vz);
336 _mav_put_uint32_t(buf, 40, v_estimated_delay_us);
337 _mav_put_float(buf, 44, feed_forward_angular_velocity_z);
338 _mav_put_uint16_t(buf, 48, estimator_status);
339 _mav_put_uint8_t(buf, 50, target_system);
340 _mav_put_uint8_t(buf, 51, target_component);
341 _mav_put_uint8_t(buf, 52, landed_state);
342 _mav_put_float(buf, 53, angular_velocity_z);
343 _mav_put_float_array(buf, 8, q, 4);
344 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE, buf, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC);
345#else
346 mavlink_autopilot_state_for_gimbal_device_t packet;
347 packet.time_boot_us = time_boot_us;
348 packet.q_estimated_delay_us = q_estimated_delay_us;
349 packet.vx = vx;
350 packet.vy = vy;
351 packet.vz = vz;
352 packet.v_estimated_delay_us = v_estimated_delay_us;
353 packet.feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
354 packet.estimator_status = estimator_status;
355 packet.target_system = target_system;
356 packet.target_component = target_component;
357 packet.landed_state = landed_state;
358 packet.angular_velocity_z = angular_velocity_z;
359 mav_array_memcpy(packet.q, q, sizeof(float)*4);
360 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC);
361#endif
362}
363
364/**
365 * @brief Send a autopilot_state_for_gimbal_device message
366 * @param chan MAVLink channel to send the message
367 * @param struct The MAVLink struct to serialize
368 */
369static inline void mavlink_msg_autopilot_state_for_gimbal_device_send_struct(mavlink_channel_t chan, const mavlink_autopilot_state_for_gimbal_device_t* autopilot_state_for_gimbal_device)
370{
371#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
372 mavlink_msg_autopilot_state_for_gimbal_device_send(chan, autopilot_state_for_gimbal_device->target_system, autopilot_state_for_gimbal_device->target_component, autopilot_state_for_gimbal_device->time_boot_us, autopilot_state_for_gimbal_device->q, autopilot_state_for_gimbal_device->q_estimated_delay_us, autopilot_state_for_gimbal_device->vx, autopilot_state_for_gimbal_device->vy, autopilot_state_for_gimbal_device->vz, autopilot_state_for_gimbal_device->v_estimated_delay_us, autopilot_state_for_gimbal_device->feed_forward_angular_velocity_z, autopilot_state_for_gimbal_device->estimator_status, autopilot_state_for_gimbal_device->landed_state, autopilot_state_for_gimbal_device->angular_velocity_z);
373#else
374 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE, (const char *)autopilot_state_for_gimbal_device, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC);
375#endif
376}
377
378#if MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
379/*
380 This variant of _send() can be used to save stack space by reusing
381 memory from the receive buffer. The caller provides a
382 mavlink_message_t which is the size of a full mavlink message. This
383 is usually the receive buffer for the channel, and allows a reply to an
384 incoming message with minimum stack space usage.
385 */
386static inline void mavlink_msg_autopilot_state_for_gimbal_device_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint64_t time_boot_us, const float *q, uint32_t q_estimated_delay_us, float vx, float vy, float vz, uint32_t v_estimated_delay_us, float feed_forward_angular_velocity_z, uint16_t estimator_status, uint8_t landed_state, float angular_velocity_z)
387{
388#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
389 char *buf = (char *)msgbuf;
390 _mav_put_uint64_t(buf, 0, time_boot_us);
391 _mav_put_uint32_t(buf, 24, q_estimated_delay_us);
392 _mav_put_float(buf, 28, vx);
393 _mav_put_float(buf, 32, vy);
394 _mav_put_float(buf, 36, vz);
395 _mav_put_uint32_t(buf, 40, v_estimated_delay_us);
396 _mav_put_float(buf, 44, feed_forward_angular_velocity_z);
397 _mav_put_uint16_t(buf, 48, estimator_status);
398 _mav_put_uint8_t(buf, 50, target_system);
399 _mav_put_uint8_t(buf, 51, target_component);
400 _mav_put_uint8_t(buf, 52, landed_state);
401 _mav_put_float(buf, 53, angular_velocity_z);
402 _mav_put_float_array(buf, 8, q, 4);
403 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE, buf, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC);
404#else
405 mavlink_autopilot_state_for_gimbal_device_t *packet = (mavlink_autopilot_state_for_gimbal_device_t *)msgbuf;
406 packet->time_boot_us = time_boot_us;
407 packet->q_estimated_delay_us = q_estimated_delay_us;
408 packet->vx = vx;
409 packet->vy = vy;
410 packet->vz = vz;
411 packet->v_estimated_delay_us = v_estimated_delay_us;
412 packet->feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
413 packet->estimator_status = estimator_status;
414 packet->target_system = target_system;
415 packet->target_component = target_component;
416 packet->landed_state = landed_state;
417 packet->angular_velocity_z = angular_velocity_z;
418 mav_array_memcpy(packet->q, q, sizeof(float)*4);
419 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_CRC);
420#endif
421}
422#endif
423
424#endif
425
426// MESSAGE AUTOPILOT_STATE_FOR_GIMBAL_DEVICE UNPACKING
427
428
429/**
430 * @brief Get field target_system from autopilot_state_for_gimbal_device message
431 *
432 * @return System ID
433 */
434static inline uint8_t mavlink_msg_autopilot_state_for_gimbal_device_get_target_system(const mavlink_message_t* msg)
435{
436 return _MAV_RETURN_uint8_t(msg, 50);
437}
438
439/**
440 * @brief Get field target_component from autopilot_state_for_gimbal_device message
441 *
442 * @return Component ID
443 */
444static inline uint8_t mavlink_msg_autopilot_state_for_gimbal_device_get_target_component(const mavlink_message_t* msg)
445{
446 return _MAV_RETURN_uint8_t(msg, 51);
447}
448
449/**
450 * @brief Get field time_boot_us from autopilot_state_for_gimbal_device message
451 *
452 * @return [us] Timestamp (time since system boot).
453 */
454static inline uint64_t mavlink_msg_autopilot_state_for_gimbal_device_get_time_boot_us(const mavlink_message_t* msg)
455{
456 return _MAV_RETURN_uint64_t(msg, 0);
457}
458
459/**
460 * @brief Get field q from autopilot_state_for_gimbal_device message
461 *
462 * @return Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).
463 */
464static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_get_q(const mavlink_message_t* msg, float *q)
465{
466 return _MAV_RETURN_float_array(msg, q, 4, 8);
467}
468
469/**
470 * @brief Get field q_estimated_delay_us from autopilot_state_for_gimbal_device message
471 *
472 * @return [us] Estimated delay of the attitude data. 0 if unknown.
473 */
474static inline uint32_t mavlink_msg_autopilot_state_for_gimbal_device_get_q_estimated_delay_us(const mavlink_message_t* msg)
475{
476 return _MAV_RETURN_uint32_t(msg, 24);
477}
478
479/**
480 * @brief Get field vx from autopilot_state_for_gimbal_device message
481 *
482 * @return [m/s] X Speed in NED (North, East, Down). NAN if unknown.
483 */
484static inline float mavlink_msg_autopilot_state_for_gimbal_device_get_vx(const mavlink_message_t* msg)
485{
486 return _MAV_RETURN_float(msg, 28);
487}
488
489/**
490 * @brief Get field vy from autopilot_state_for_gimbal_device message
491 *
492 * @return [m/s] Y Speed in NED (North, East, Down). NAN if unknown.
493 */
494static inline float mavlink_msg_autopilot_state_for_gimbal_device_get_vy(const mavlink_message_t* msg)
495{
496 return _MAV_RETURN_float(msg, 32);
497}
498
499/**
500 * @brief Get field vz from autopilot_state_for_gimbal_device message
501 *
502 * @return [m/s] Z Speed in NED (North, East, Down). NAN if unknown.
503 */
504static inline float mavlink_msg_autopilot_state_for_gimbal_device_get_vz(const mavlink_message_t* msg)
505{
506 return _MAV_RETURN_float(msg, 36);
507}
508
509/**
510 * @brief Get field v_estimated_delay_us from autopilot_state_for_gimbal_device message
511 *
512 * @return [us] Estimated delay of the speed data. 0 if unknown.
513 */
514static inline uint32_t mavlink_msg_autopilot_state_for_gimbal_device_get_v_estimated_delay_us(const mavlink_message_t* msg)
515{
516 return _MAV_RETURN_uint32_t(msg, 40);
517}
518
519/**
520 * @brief Get field feed_forward_angular_velocity_z from autopilot_state_for_gimbal_device message
521 *
522 * @return [rad/s] Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.
523 */
524static inline float mavlink_msg_autopilot_state_for_gimbal_device_get_feed_forward_angular_velocity_z(const mavlink_message_t* msg)
525{
526 return _MAV_RETURN_float(msg, 44);
527}
528
529/**
530 * @brief Get field estimator_status from autopilot_state_for_gimbal_device message
531 *
532 * @return Bitmap indicating which estimator outputs are valid.
533 */
534static inline uint16_t mavlink_msg_autopilot_state_for_gimbal_device_get_estimator_status(const mavlink_message_t* msg)
535{
536 return _MAV_RETURN_uint16_t(msg, 48);
537}
538
539/**
540 * @brief Get field landed_state from autopilot_state_for_gimbal_device message
541 *
542 * @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
543 */
544static inline uint8_t mavlink_msg_autopilot_state_for_gimbal_device_get_landed_state(const mavlink_message_t* msg)
545{
546 return _MAV_RETURN_uint8_t(msg, 52);
547}
548
549/**
550 * @brief Get field angular_velocity_z from autopilot_state_for_gimbal_device message
551 *
552 * @return [rad/s] Z component of angular velocity in NED (North, East, Down). NaN if unknown.
553 */
554static inline float mavlink_msg_autopilot_state_for_gimbal_device_get_angular_velocity_z(const mavlink_message_t* msg)
555{
556 return _MAV_RETURN_float(msg, 53);
557}
558
559/**
560 * @brief Decode a autopilot_state_for_gimbal_device message into a struct
561 *
562 * @param msg The message to decode
563 * @param autopilot_state_for_gimbal_device C-struct to decode the message contents into
564 */
565static inline void mavlink_msg_autopilot_state_for_gimbal_device_decode(const mavlink_message_t* msg, mavlink_autopilot_state_for_gimbal_device_t* autopilot_state_for_gimbal_device)
566{
567#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
568 autopilot_state_for_gimbal_device->time_boot_us = mavlink_msg_autopilot_state_for_gimbal_device_get_time_boot_us(msg);
569 mavlink_msg_autopilot_state_for_gimbal_device_get_q(msg, autopilot_state_for_gimbal_device->q);
570 autopilot_state_for_gimbal_device->q_estimated_delay_us = mavlink_msg_autopilot_state_for_gimbal_device_get_q_estimated_delay_us(msg);
571 autopilot_state_for_gimbal_device->vx = mavlink_msg_autopilot_state_for_gimbal_device_get_vx(msg);
572 autopilot_state_for_gimbal_device->vy = mavlink_msg_autopilot_state_for_gimbal_device_get_vy(msg);
573 autopilot_state_for_gimbal_device->vz = mavlink_msg_autopilot_state_for_gimbal_device_get_vz(msg);
574 autopilot_state_for_gimbal_device->v_estimated_delay_us = mavlink_msg_autopilot_state_for_gimbal_device_get_v_estimated_delay_us(msg);
575 autopilot_state_for_gimbal_device->feed_forward_angular_velocity_z = mavlink_msg_autopilot_state_for_gimbal_device_get_feed_forward_angular_velocity_z(msg);
576 autopilot_state_for_gimbal_device->estimator_status = mavlink_msg_autopilot_state_for_gimbal_device_get_estimator_status(msg);
577 autopilot_state_for_gimbal_device->target_system = mavlink_msg_autopilot_state_for_gimbal_device_get_target_system(msg);
578 autopilot_state_for_gimbal_device->target_component = mavlink_msg_autopilot_state_for_gimbal_device_get_target_component(msg);
579 autopilot_state_for_gimbal_device->landed_state = mavlink_msg_autopilot_state_for_gimbal_device_get_landed_state(msg);
580 autopilot_state_for_gimbal_device->angular_velocity_z = mavlink_msg_autopilot_state_for_gimbal_device_get_angular_velocity_z(msg);
581#else
582 uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN;
583 memset(autopilot_state_for_gimbal_device, 0, MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_LEN);
584 memcpy(autopilot_state_for_gimbal_device, _MAV_PAYLOAD(msg), len);
585#endif
586}