Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_camera_fov_status.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE CAMERA_FOV_STATUS PACKING
3
4#define MAVLINK_MSG_ID_CAMERA_FOV_STATUS 271
5
6
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
9 int32_t lat_camera; /*< [degE7] Latitude of camera (INT32_MAX if unknown).*/
10 int32_t lon_camera; /*< [degE7] Longitude of camera (INT32_MAX if unknown).*/
11 int32_t alt_camera; /*< [mm] Altitude (MSL) of camera (INT32_MAX if unknown).*/
12 int32_t lat_image; /*< [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).*/
13 int32_t lon_image; /*< [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).*/
14 int32_t alt_image; /*< [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).*/
15 float q[4]; /*< Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
16 float hfov; /*< [deg] Horizontal field of view (NaN if unknown).*/
17 float vfov; /*< [deg] Vertical field of view (NaN if unknown).*/
18 uint8_t camera_device_id; /*< Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).*/
19} mavlink_camera_fov_status_t;
20
21#define MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN 53
22#define MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN 52
23#define MAVLINK_MSG_ID_271_LEN 53
24#define MAVLINK_MSG_ID_271_MIN_LEN 52
25
26#define MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC 22
27#define MAVLINK_MSG_ID_271_CRC 22
28
29#define MAVLINK_MSG_CAMERA_FOV_STATUS_FIELD_Q_LEN 4
30
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_CAMERA_FOV_STATUS {
33 271,
34 "CAMERA_FOV_STATUS",
35 11,
36 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_fov_status_t, time_boot_ms) },
37 { "lat_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_camera_fov_status_t, lat_camera) },
38 { "lon_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_fov_status_t, lon_camera) },
39 { "alt_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_fov_status_t, alt_camera) },
40 { "lat_image", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_fov_status_t, lat_image) },
41 { "lon_image", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_fov_status_t, lon_image) },
42 { "alt_image", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_fov_status_t, alt_image) },
43 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_fov_status_t, q) },
44 { "hfov", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_camera_fov_status_t, hfov) },
45 { "vfov", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_camera_fov_status_t, vfov) },
46 { "camera_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_camera_fov_status_t, camera_device_id) },
47 } \
48}
49#else
50#define MAVLINK_MESSAGE_INFO_CAMERA_FOV_STATUS {
51 "CAMERA_FOV_STATUS",
52 11,
53 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_fov_status_t, time_boot_ms) },
54 { "lat_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_camera_fov_status_t, lat_camera) },
55 { "lon_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_fov_status_t, lon_camera) },
56 { "alt_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_fov_status_t, alt_camera) },
57 { "lat_image", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_fov_status_t, lat_image) },
58 { "lon_image", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_fov_status_t, lon_image) },
59 { "alt_image", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_fov_status_t, alt_image) },
60 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_fov_status_t, q) },
61 { "hfov", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_camera_fov_status_t, hfov) },
62 { "vfov", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_camera_fov_status_t, vfov) },
63 { "camera_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_camera_fov_status_t, camera_device_id) },
64 } \
65}
66#endif
67
68/**
69 * @brief Pack a camera_fov_status message
70 * @param system_id ID of this system
71 * @param component_id ID of this component (e.g. 200 for IMU)
72 * @param msg The MAVLink message to compress the data into
73 *
74 * @param time_boot_ms [ms] Timestamp (time since system boot).
75 * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
76 * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
77 * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
78 * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
79 * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
80 * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
81 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
82 * @param hfov [deg] Horizontal field of view (NaN if unknown).
83 * @param vfov [deg] Vertical field of view (NaN if unknown).
84 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
85 * @return length of the message in bytes (excluding serial stream start sign)
86 */
87static inline uint16_t mavlink_msg_camera_fov_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint32_t time_boot_ms, int32_t lat_camera, int32_t lon_camera, int32_t alt_camera, int32_t lat_image, int32_t lon_image, int32_t alt_image, const float *q, float hfov, float vfov, uint8_t camera_device_id)
89{
90#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
92 _mav_put_uint32_t(buf, 0, time_boot_ms);
93 _mav_put_int32_t(buf, 4, lat_camera);
94 _mav_put_int32_t(buf, 8, lon_camera);
95 _mav_put_int32_t(buf, 12, alt_camera);
96 _mav_put_int32_t(buf, 16, lat_image);
97 _mav_put_int32_t(buf, 20, lon_image);
98 _mav_put_int32_t(buf, 24, alt_image);
99 _mav_put_float(buf, 44, hfov);
100 _mav_put_float(buf, 48, vfov);
101 _mav_put_uint8_t(buf, 52, camera_device_id);
102 _mav_put_float_array(buf, 28, q, 4);
103 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
104#else
105 mavlink_camera_fov_status_t packet;
106 packet.time_boot_ms = time_boot_ms;
107 packet.lat_camera = lat_camera;
108 packet.lon_camera = lon_camera;
109 packet.alt_camera = alt_camera;
110 packet.lat_image = lat_image;
111 packet.lon_image = lon_image;
112 packet.alt_image = alt_image;
113 packet.hfov = hfov;
114 packet.vfov = vfov;
115 packet.camera_device_id = camera_device_id;
116 mav_array_memcpy(packet.q, q, sizeof(float)*4);
117 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
118#endif
119
122}
123
124/**
125 * @brief Pack a camera_fov_status message
126 * @param system_id ID of this system
127 * @param component_id ID of this component (e.g. 200 for IMU)
128 * @param status MAVLink status structure
129 * @param msg The MAVLink message to compress the data into
130 *
131 * @param time_boot_ms [ms] Timestamp (time since system boot).
132 * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
133 * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
134 * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
135 * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
136 * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
137 * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
138 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
139 * @param hfov [deg] Horizontal field of view (NaN if unknown).
140 * @param vfov [deg] Vertical field of view (NaN if unknown).
141 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
142 * @return length of the message in bytes (excluding serial stream start sign)
143 */
144static inline uint16_t mavlink_msg_camera_fov_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
145 uint32_t time_boot_ms, int32_t lat_camera, int32_t lon_camera, int32_t alt_camera, int32_t lat_image, int32_t lon_image, int32_t alt_image, const float *q, float hfov, float vfov, uint8_t camera_device_id)
146{
147#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
149 _mav_put_uint32_t(buf, 0, time_boot_ms);
150 _mav_put_int32_t(buf, 4, lat_camera);
151 _mav_put_int32_t(buf, 8, lon_camera);
152 _mav_put_int32_t(buf, 12, alt_camera);
153 _mav_put_int32_t(buf, 16, lat_image);
154 _mav_put_int32_t(buf, 20, lon_image);
155 _mav_put_int32_t(buf, 24, alt_image);
156 _mav_put_float(buf, 44, hfov);
157 _mav_put_float(buf, 48, vfov);
158 _mav_put_uint8_t(buf, 52, camera_device_id);
159 _mav_put_float_array(buf, 28, q, 4);
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
161#else
162 mavlink_camera_fov_status_t packet;
163 packet.time_boot_ms = time_boot_ms;
164 packet.lat_camera = lat_camera;
165 packet.lon_camera = lon_camera;
166 packet.alt_camera = alt_camera;
167 packet.lat_image = lat_image;
168 packet.lon_image = lon_image;
169 packet.alt_image = alt_image;
170 packet.hfov = hfov;
171 packet.vfov = vfov;
172 packet.camera_device_id = camera_device_id;
173 mav_array_memcpy(packet.q, q, sizeof(float)*4);
174 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
175#endif
176
178#if MAVLINK_CRC_EXTRA
179 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
180#else
181 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
182#endif
183}
184
185/**
186 * @brief Pack a camera_fov_status message on a channel
187 * @param system_id ID of this system
188 * @param component_id ID of this component (e.g. 200 for IMU)
189 * @param chan The MAVLink channel this message will be sent over
190 * @param msg The MAVLink message to compress the data into
191 * @param time_boot_ms [ms] Timestamp (time since system boot).
192 * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
193 * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
194 * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
195 * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
196 * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
197 * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
198 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
199 * @param hfov [deg] Horizontal field of view (NaN if unknown).
200 * @param vfov [deg] Vertical field of view (NaN if unknown).
201 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
202 * @return length of the message in bytes (excluding serial stream start sign)
203 */
204static inline uint16_t mavlink_msg_camera_fov_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
205 mavlink_message_t* msg,
206 uint32_t time_boot_ms,int32_t lat_camera,int32_t lon_camera,int32_t alt_camera,int32_t lat_image,int32_t lon_image,int32_t alt_image,const float *q,float hfov,float vfov,uint8_t camera_device_id)
207{
208#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
210 _mav_put_uint32_t(buf, 0, time_boot_ms);
211 _mav_put_int32_t(buf, 4, lat_camera);
212 _mav_put_int32_t(buf, 8, lon_camera);
213 _mav_put_int32_t(buf, 12, alt_camera);
214 _mav_put_int32_t(buf, 16, lat_image);
215 _mav_put_int32_t(buf, 20, lon_image);
216 _mav_put_int32_t(buf, 24, alt_image);
217 _mav_put_float(buf, 44, hfov);
218 _mav_put_float(buf, 48, vfov);
219 _mav_put_uint8_t(buf, 52, camera_device_id);
220 _mav_put_float_array(buf, 28, q, 4);
221 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
222#else
223 mavlink_camera_fov_status_t packet;
224 packet.time_boot_ms = time_boot_ms;
225 packet.lat_camera = lat_camera;
226 packet.lon_camera = lon_camera;
227 packet.alt_camera = alt_camera;
228 packet.lat_image = lat_image;
229 packet.lon_image = lon_image;
230 packet.alt_image = alt_image;
231 packet.hfov = hfov;
232 packet.vfov = vfov;
233 packet.camera_device_id = camera_device_id;
234 mav_array_memcpy(packet.q, q, sizeof(float)*4);
235 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
236#endif
237
239 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
240}
241
242/**
243 * @brief Encode a camera_fov_status struct
244 *
245 * @param system_id ID of this system
246 * @param component_id ID of this component (e.g. 200 for IMU)
247 * @param msg The MAVLink message to compress the data into
248 * @param camera_fov_status C-struct to read the message contents from
249 */
250static inline uint16_t mavlink_msg_camera_fov_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_fov_status_t* camera_fov_status)
251{
252 return mavlink_msg_camera_fov_status_pack(system_id, component_id, msg, camera_fov_status->time_boot_ms, camera_fov_status->lat_camera, camera_fov_status->lon_camera, camera_fov_status->alt_camera, camera_fov_status->lat_image, camera_fov_status->lon_image, camera_fov_status->alt_image, camera_fov_status->q, camera_fov_status->hfov, camera_fov_status->vfov, camera_fov_status->camera_device_id);
253}
254
255/**
256 * @brief Encode a camera_fov_status struct on a channel
257 *
258 * @param system_id ID of this system
259 * @param component_id ID of this component (e.g. 200 for IMU)
260 * @param chan The MAVLink channel this message will be sent over
261 * @param msg The MAVLink message to compress the data into
262 * @param camera_fov_status C-struct to read the message contents from
263 */
264static inline uint16_t mavlink_msg_camera_fov_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_fov_status_t* camera_fov_status)
265{
266 return mavlink_msg_camera_fov_status_pack_chan(system_id, component_id, chan, msg, camera_fov_status->time_boot_ms, camera_fov_status->lat_camera, camera_fov_status->lon_camera, camera_fov_status->alt_camera, camera_fov_status->lat_image, camera_fov_status->lon_image, camera_fov_status->alt_image, camera_fov_status->q, camera_fov_status->hfov, camera_fov_status->vfov, camera_fov_status->camera_device_id);
267}
268
269/**
270 * @brief Encode a camera_fov_status struct with provided status structure
271 *
272 * @param system_id ID of this system
273 * @param component_id ID of this component (e.g. 200 for IMU)
274 * @param status MAVLink status structure
275 * @param msg The MAVLink message to compress the data into
276 * @param camera_fov_status C-struct to read the message contents from
277 */
278static inline uint16_t mavlink_msg_camera_fov_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_camera_fov_status_t* camera_fov_status)
279{
280 return mavlink_msg_camera_fov_status_pack_status(system_id, component_id, _status, msg, camera_fov_status->time_boot_ms, camera_fov_status->lat_camera, camera_fov_status->lon_camera, camera_fov_status->alt_camera, camera_fov_status->lat_image, camera_fov_status->lon_image, camera_fov_status->alt_image, camera_fov_status->q, camera_fov_status->hfov, camera_fov_status->vfov, camera_fov_status->camera_device_id);
281}
282
283/**
284 * @brief Send a camera_fov_status message
285 * @param chan MAVLink channel to send the message
286 *
287 * @param time_boot_ms [ms] Timestamp (time since system boot).
288 * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
289 * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
290 * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
291 * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
292 * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
293 * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
294 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
295 * @param hfov [deg] Horizontal field of view (NaN if unknown).
296 * @param vfov [deg] Vertical field of view (NaN if unknown).
297 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
298 */
299#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
300
301static inline void mavlink_msg_camera_fov_status_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat_camera, int32_t lon_camera, int32_t alt_camera, int32_t lat_image, int32_t lon_image, int32_t alt_image, const float *q, float hfov, float vfov, uint8_t camera_device_id)
302{
303#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
304 char buf[MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN];
305 _mav_put_uint32_t(buf, 0, time_boot_ms);
306 _mav_put_int32_t(buf, 4, lat_camera);
307 _mav_put_int32_t(buf, 8, lon_camera);
308 _mav_put_int32_t(buf, 12, alt_camera);
309 _mav_put_int32_t(buf, 16, lat_image);
310 _mav_put_int32_t(buf, 20, lon_image);
311 _mav_put_int32_t(buf, 24, alt_image);
312 _mav_put_float(buf, 44, hfov);
313 _mav_put_float(buf, 48, vfov);
314 _mav_put_uint8_t(buf, 52, camera_device_id);
315 _mav_put_float_array(buf, 28, q, 4);
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FOV_STATUS, buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
317#else
318 mavlink_camera_fov_status_t packet;
319 packet.time_boot_ms = time_boot_ms;
320 packet.lat_camera = lat_camera;
321 packet.lon_camera = lon_camera;
322 packet.alt_camera = alt_camera;
323 packet.lat_image = lat_image;
324 packet.lon_image = lon_image;
325 packet.alt_image = alt_image;
326 packet.hfov = hfov;
327 packet.vfov = vfov;
328 packet.camera_device_id = camera_device_id;
329 mav_array_memcpy(packet.q, q, sizeof(float)*4);
330 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FOV_STATUS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
331#endif
332}
333
334/**
335 * @brief Send a camera_fov_status message
336 * @param chan MAVLink channel to send the message
337 * @param struct The MAVLink struct to serialize
338 */
339static inline void mavlink_msg_camera_fov_status_send_struct(mavlink_channel_t chan, const mavlink_camera_fov_status_t* camera_fov_status)
340{
341#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
342 mavlink_msg_camera_fov_status_send(chan, camera_fov_status->time_boot_ms, camera_fov_status->lat_camera, camera_fov_status->lon_camera, camera_fov_status->alt_camera, camera_fov_status->lat_image, camera_fov_status->lon_image, camera_fov_status->alt_image, camera_fov_status->q, camera_fov_status->hfov, camera_fov_status->vfov, camera_fov_status->camera_device_id);
343#else
344 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FOV_STATUS, (const char *)camera_fov_status, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
345#endif
346}
347
348#if MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
349/*
350 This variant of _send() can be used to save stack space by reusing
351 memory from the receive buffer. The caller provides a
352 mavlink_message_t which is the size of a full mavlink message. This
353 is usually the receive buffer for the channel, and allows a reply to an
354 incoming message with minimum stack space usage.
355 */
356static inline void mavlink_msg_camera_fov_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat_camera, int32_t lon_camera, int32_t alt_camera, int32_t lat_image, int32_t lon_image, int32_t alt_image, const float *q, float hfov, float vfov, uint8_t camera_device_id)
357{
358#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
359 char *buf = (char *)msgbuf;
360 _mav_put_uint32_t(buf, 0, time_boot_ms);
361 _mav_put_int32_t(buf, 4, lat_camera);
362 _mav_put_int32_t(buf, 8, lon_camera);
363 _mav_put_int32_t(buf, 12, alt_camera);
364 _mav_put_int32_t(buf, 16, lat_image);
365 _mav_put_int32_t(buf, 20, lon_image);
366 _mav_put_int32_t(buf, 24, alt_image);
367 _mav_put_float(buf, 44, hfov);
368 _mav_put_float(buf, 48, vfov);
369 _mav_put_uint8_t(buf, 52, camera_device_id);
370 _mav_put_float_array(buf, 28, q, 4);
371 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FOV_STATUS, buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
372#else
373 mavlink_camera_fov_status_t *packet = (mavlink_camera_fov_status_t *)msgbuf;
374 packet->time_boot_ms = time_boot_ms;
375 packet->lat_camera = lat_camera;
376 packet->lon_camera = lon_camera;
377 packet->alt_camera = alt_camera;
378 packet->lat_image = lat_image;
379 packet->lon_image = lon_image;
380 packet->alt_image = alt_image;
381 packet->hfov = hfov;
382 packet->vfov = vfov;
383 packet->camera_device_id = camera_device_id;
384 mav_array_memcpy(packet->q, q, sizeof(float)*4);
385 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FOV_STATUS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
386#endif
387}
388#endif
389
390#endif
391
392// MESSAGE CAMERA_FOV_STATUS UNPACKING
393
394
395/**
396 * @brief Get field time_boot_ms from camera_fov_status message
397 *
398 * @return [ms] Timestamp (time since system boot).
399 */
400static inline uint32_t mavlink_msg_camera_fov_status_get_time_boot_ms(const mavlink_message_t* msg)
401{
402 return _MAV_RETURN_uint32_t(msg, 0);
403}
404
405/**
406 * @brief Get field lat_camera from camera_fov_status message
407 *
408 * @return [degE7] Latitude of camera (INT32_MAX if unknown).
409 */
410static inline int32_t mavlink_msg_camera_fov_status_get_lat_camera(const mavlink_message_t* msg)
411{
412 return _MAV_RETURN_int32_t(msg, 4);
413}
414
415/**
416 * @brief Get field lon_camera from camera_fov_status message
417 *
418 * @return [degE7] Longitude of camera (INT32_MAX if unknown).
419 */
420static inline int32_t mavlink_msg_camera_fov_status_get_lon_camera(const mavlink_message_t* msg)
421{
422 return _MAV_RETURN_int32_t(msg, 8);
423}
424
425/**
426 * @brief Get field alt_camera from camera_fov_status message
427 *
428 * @return [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
429 */
430static inline int32_t mavlink_msg_camera_fov_status_get_alt_camera(const mavlink_message_t* msg)
431{
432 return _MAV_RETURN_int32_t(msg, 12);
433}
434
435/**
436 * @brief Get field lat_image from camera_fov_status message
437 *
438 * @return [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
439 */
440static inline int32_t mavlink_msg_camera_fov_status_get_lat_image(const mavlink_message_t* msg)
441{
442 return _MAV_RETURN_int32_t(msg, 16);
443}
444
445/**
446 * @brief Get field lon_image from camera_fov_status message
447 *
448 * @return [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
449 */
450static inline int32_t mavlink_msg_camera_fov_status_get_lon_image(const mavlink_message_t* msg)
451{
452 return _MAV_RETURN_int32_t(msg, 20);
453}
454
455/**
456 * @brief Get field alt_image from camera_fov_status message
457 *
458 * @return [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
459 */
460static inline int32_t mavlink_msg_camera_fov_status_get_alt_image(const mavlink_message_t* msg)
461{
462 return _MAV_RETURN_int32_t(msg, 24);
463}
464
465/**
466 * @brief Get field q from camera_fov_status message
467 *
468 * @return Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
469 */
470static inline uint16_t mavlink_msg_camera_fov_status_get_q(const mavlink_message_t* msg, float *q)
471{
472 return _MAV_RETURN_float_array(msg, q, 4, 28);
473}
474
475/**
476 * @brief Get field hfov from camera_fov_status message
477 *
478 * @return [deg] Horizontal field of view (NaN if unknown).
479 */
480static inline float mavlink_msg_camera_fov_status_get_hfov(const mavlink_message_t* msg)
481{
482 return _MAV_RETURN_float(msg, 44);
483}
484
485/**
486 * @brief Get field vfov from camera_fov_status message
487 *
488 * @return [deg] Vertical field of view (NaN if unknown).
489 */
490static inline float mavlink_msg_camera_fov_status_get_vfov(const mavlink_message_t* msg)
491{
492 return _MAV_RETURN_float(msg, 48);
493}
494
495/**
496 * @brief Get field camera_device_id from camera_fov_status message
497 *
498 * @return Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
499 */
500static inline uint8_t mavlink_msg_camera_fov_status_get_camera_device_id(const mavlink_message_t* msg)
501{
502 return _MAV_RETURN_uint8_t(msg, 52);
503}
504
505/**
506 * @brief Decode a camera_fov_status message into a struct
507 *
508 * @param msg The message to decode
509 * @param camera_fov_status C-struct to decode the message contents into
510 */
511static inline void mavlink_msg_camera_fov_status_decode(const mavlink_message_t* msg, mavlink_camera_fov_status_t* camera_fov_status)
512{
513#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
514 camera_fov_status->time_boot_ms = mavlink_msg_camera_fov_status_get_time_boot_ms(msg);
515 camera_fov_status->lat_camera = mavlink_msg_camera_fov_status_get_lat_camera(msg);
516 camera_fov_status->lon_camera = mavlink_msg_camera_fov_status_get_lon_camera(msg);
517 camera_fov_status->alt_camera = mavlink_msg_camera_fov_status_get_alt_camera(msg);
518 camera_fov_status->lat_image = mavlink_msg_camera_fov_status_get_lat_image(msg);
519 camera_fov_status->lon_image = mavlink_msg_camera_fov_status_get_lon_image(msg);
520 camera_fov_status->alt_image = mavlink_msg_camera_fov_status_get_alt_image(msg);
521 mavlink_msg_camera_fov_status_get_q(msg, camera_fov_status->q);
522 camera_fov_status->hfov = mavlink_msg_camera_fov_status_get_hfov(msg);
523 camera_fov_status->vfov = mavlink_msg_camera_fov_status_get_vfov(msg);
524 camera_fov_status->camera_device_id = mavlink_msg_camera_fov_status_get_camera_device_id(msg);
525#else
526 uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN;
527 memset(camera_fov_status, 0, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
528 memcpy(camera_fov_status, _MAV_PAYLOAD(msg), len);
529#endif
530}