mavlink_msg_camera_fov_status.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. #pragma once
  2. // MESSAGE CAMERA_FOV_STATUS PACKING
  3. #define MAVLINK_MSG_ID_CAMERA_FOV_STATUS 271
  4. typedef struct __mavlink_camera_fov_status_t {
  5. uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
  6. int32_t lat_camera; /*< [degE7] Latitude of camera (INT32_MAX if unknown).*/
  7. int32_t lon_camera; /*< [degE7] Longitude of camera (INT32_MAX if unknown).*/
  8. int32_t alt_camera; /*< [mm] Altitude (MSL) of camera (INT32_MAX if unknown).*/
  9. int32_t lat_image; /*< [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).*/
  10. int32_t lon_image; /*< [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).*/
  11. int32_t alt_image; /*< [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).*/
  12. float q[4]; /*< Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
  13. float hfov; /*< [deg] Horizontal field of view (NaN if unknown).*/
  14. float vfov; /*< [deg] Vertical field of view (NaN if unknown).*/
  15. } mavlink_camera_fov_status_t;
  16. #define MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN 52
  17. #define MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN 52
  18. #define MAVLINK_MSG_ID_271_LEN 52
  19. #define MAVLINK_MSG_ID_271_MIN_LEN 52
  20. #define MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC 22
  21. #define MAVLINK_MSG_ID_271_CRC 22
  22. #define MAVLINK_MSG_CAMERA_FOV_STATUS_FIELD_Q_LEN 4
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_CAMERA_FOV_STATUS { \
  25. 271, \
  26. "CAMERA_FOV_STATUS", \
  27. 10, \
  28. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_fov_status_t, time_boot_ms) }, \
  29. { "lat_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_camera_fov_status_t, lat_camera) }, \
  30. { "lon_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_fov_status_t, lon_camera) }, \
  31. { "alt_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_fov_status_t, alt_camera) }, \
  32. { "lat_image", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_fov_status_t, lat_image) }, \
  33. { "lon_image", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_fov_status_t, lon_image) }, \
  34. { "alt_image", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_fov_status_t, alt_image) }, \
  35. { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_fov_status_t, q) }, \
  36. { "hfov", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_camera_fov_status_t, hfov) }, \
  37. { "vfov", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_camera_fov_status_t, vfov) }, \
  38. } \
  39. }
  40. #else
  41. #define MAVLINK_MESSAGE_INFO_CAMERA_FOV_STATUS { \
  42. "CAMERA_FOV_STATUS", \
  43. 10, \
  44. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_fov_status_t, time_boot_ms) }, \
  45. { "lat_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_camera_fov_status_t, lat_camera) }, \
  46. { "lon_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_fov_status_t, lon_camera) }, \
  47. { "alt_camera", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_fov_status_t, alt_camera) }, \
  48. { "lat_image", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_fov_status_t, lat_image) }, \
  49. { "lon_image", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_fov_status_t, lon_image) }, \
  50. { "alt_image", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_fov_status_t, alt_image) }, \
  51. { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_fov_status_t, q) }, \
  52. { "hfov", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_camera_fov_status_t, hfov) }, \
  53. { "vfov", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_camera_fov_status_t, vfov) }, \
  54. } \
  55. }
  56. #endif
  57. /**
  58. * @brief Pack a camera_fov_status message
  59. * @param system_id ID of this system
  60. * @param component_id ID of this component (e.g. 200 for IMU)
  61. * @param msg The MAVLink message to compress the data into
  62. *
  63. * @param time_boot_ms [ms] Timestamp (time since system boot).
  64. * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
  65. * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
  66. * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  67. * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  68. * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  69. * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  70. * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  71. * @param hfov [deg] Horizontal field of view (NaN if unknown).
  72. * @param vfov [deg] Vertical field of view (NaN if unknown).
  73. * @return length of the message in bytes (excluding serial stream start sign)
  74. */
  75. static inline uint16_t mavlink_msg_camera_fov_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  76. 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)
  77. {
  78. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  79. char buf[MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN];
  80. _mav_put_uint32_t(buf, 0, time_boot_ms);
  81. _mav_put_int32_t(buf, 4, lat_camera);
  82. _mav_put_int32_t(buf, 8, lon_camera);
  83. _mav_put_int32_t(buf, 12, alt_camera);
  84. _mav_put_int32_t(buf, 16, lat_image);
  85. _mav_put_int32_t(buf, 20, lon_image);
  86. _mav_put_int32_t(buf, 24, alt_image);
  87. _mav_put_float(buf, 44, hfov);
  88. _mav_put_float(buf, 48, vfov);
  89. _mav_put_float_array(buf, 28, q, 4);
  90. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  91. #else
  92. mavlink_camera_fov_status_t packet;
  93. packet.time_boot_ms = time_boot_ms;
  94. packet.lat_camera = lat_camera;
  95. packet.lon_camera = lon_camera;
  96. packet.alt_camera = alt_camera;
  97. packet.lat_image = lat_image;
  98. packet.lon_image = lon_image;
  99. packet.alt_image = alt_image;
  100. packet.hfov = hfov;
  101. packet.vfov = vfov;
  102. mav_array_memcpy(packet.q, q, sizeof(float)*4);
  103. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  104. #endif
  105. msg->msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
  106. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_CRC);
  107. }
  108. /**
  109. * @brief Pack a camera_fov_status message on a channel
  110. * @param system_id ID of this system
  111. * @param component_id ID of this component (e.g. 200 for IMU)
  112. * @param chan The MAVLink channel this message will be sent over
  113. * @param msg The MAVLink message to compress the data into
  114. * @param time_boot_ms [ms] Timestamp (time since system boot).
  115. * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
  116. * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
  117. * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  118. * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  119. * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  120. * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  121. * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  122. * @param hfov [deg] Horizontal field of view (NaN if unknown).
  123. * @param vfov [deg] Vertical field of view (NaN if unknown).
  124. * @return length of the message in bytes (excluding serial stream start sign)
  125. */
  126. static inline uint16_t mavlink_msg_camera_fov_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  127. mavlink_message_t* msg,
  128. 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)
  129. {
  130. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  131. char buf[MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN];
  132. _mav_put_uint32_t(buf, 0, time_boot_ms);
  133. _mav_put_int32_t(buf, 4, lat_camera);
  134. _mav_put_int32_t(buf, 8, lon_camera);
  135. _mav_put_int32_t(buf, 12, alt_camera);
  136. _mav_put_int32_t(buf, 16, lat_image);
  137. _mav_put_int32_t(buf, 20, lon_image);
  138. _mav_put_int32_t(buf, 24, alt_image);
  139. _mav_put_float(buf, 44, hfov);
  140. _mav_put_float(buf, 48, vfov);
  141. _mav_put_float_array(buf, 28, q, 4);
  142. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  143. #else
  144. mavlink_camera_fov_status_t packet;
  145. packet.time_boot_ms = time_boot_ms;
  146. packet.lat_camera = lat_camera;
  147. packet.lon_camera = lon_camera;
  148. packet.alt_camera = alt_camera;
  149. packet.lat_image = lat_image;
  150. packet.lon_image = lon_image;
  151. packet.alt_image = alt_image;
  152. packet.hfov = hfov;
  153. packet.vfov = vfov;
  154. mav_array_memcpy(packet.q, q, sizeof(float)*4);
  155. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  156. #endif
  157. msg->msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
  158. 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);
  159. }
  160. /**
  161. * @brief Encode a camera_fov_status struct
  162. *
  163. * @param system_id ID of this system
  164. * @param component_id ID of this component (e.g. 200 for IMU)
  165. * @param msg The MAVLink message to compress the data into
  166. * @param camera_fov_status C-struct to read the message contents from
  167. */
  168. static 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)
  169. {
  170. 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);
  171. }
  172. /**
  173. * @brief Encode a camera_fov_status struct on a channel
  174. *
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param chan The MAVLink channel this message will be sent over
  178. * @param msg The MAVLink message to compress the data into
  179. * @param camera_fov_status C-struct to read the message contents from
  180. */
  181. static 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)
  182. {
  183. 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);
  184. }
  185. /**
  186. * @brief Send a camera_fov_status message
  187. * @param chan MAVLink channel to send the message
  188. *
  189. * @param time_boot_ms [ms] Timestamp (time since system boot).
  190. * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
  191. * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
  192. * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  193. * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  194. * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  195. * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  196. * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  197. * @param hfov [deg] Horizontal field of view (NaN if unknown).
  198. * @param vfov [deg] Vertical field of view (NaN if unknown).
  199. */
  200. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  201. static 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)
  202. {
  203. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  204. char buf[MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN];
  205. _mav_put_uint32_t(buf, 0, time_boot_ms);
  206. _mav_put_int32_t(buf, 4, lat_camera);
  207. _mav_put_int32_t(buf, 8, lon_camera);
  208. _mav_put_int32_t(buf, 12, alt_camera);
  209. _mav_put_int32_t(buf, 16, lat_image);
  210. _mav_put_int32_t(buf, 20, lon_image);
  211. _mav_put_int32_t(buf, 24, alt_image);
  212. _mav_put_float(buf, 44, hfov);
  213. _mav_put_float(buf, 48, vfov);
  214. _mav_put_float_array(buf, 28, q, 4);
  215. _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);
  216. #else
  217. mavlink_camera_fov_status_t packet;
  218. packet.time_boot_ms = time_boot_ms;
  219. packet.lat_camera = lat_camera;
  220. packet.lon_camera = lon_camera;
  221. packet.alt_camera = alt_camera;
  222. packet.lat_image = lat_image;
  223. packet.lon_image = lon_image;
  224. packet.alt_image = alt_image;
  225. packet.hfov = hfov;
  226. packet.vfov = vfov;
  227. mav_array_memcpy(packet.q, q, sizeof(float)*4);
  228. _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);
  229. #endif
  230. }
  231. /**
  232. * @brief Send a camera_fov_status message
  233. * @param chan MAVLink channel to send the message
  234. * @param struct The MAVLink struct to serialize
  235. */
  236. static inline void mavlink_msg_camera_fov_status_send_struct(mavlink_channel_t chan, const mavlink_camera_fov_status_t* camera_fov_status)
  237. {
  238. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  239. 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);
  240. #else
  241. _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);
  242. #endif
  243. }
  244. #if MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  245. /*
  246. This variant of _send() can be used to save stack space by re-using
  247. memory from the receive buffer. The caller provides a
  248. mavlink_message_t which is the size of a full mavlink message. This
  249. is usually the receive buffer for the channel, and allows a reply to an
  250. incoming message with minimum stack space usage.
  251. */
  252. static 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)
  253. {
  254. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  255. char *buf = (char *)msgbuf;
  256. _mav_put_uint32_t(buf, 0, time_boot_ms);
  257. _mav_put_int32_t(buf, 4, lat_camera);
  258. _mav_put_int32_t(buf, 8, lon_camera);
  259. _mav_put_int32_t(buf, 12, alt_camera);
  260. _mav_put_int32_t(buf, 16, lat_image);
  261. _mav_put_int32_t(buf, 20, lon_image);
  262. _mav_put_int32_t(buf, 24, alt_image);
  263. _mav_put_float(buf, 44, hfov);
  264. _mav_put_float(buf, 48, vfov);
  265. _mav_put_float_array(buf, 28, q, 4);
  266. _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);
  267. #else
  268. mavlink_camera_fov_status_t *packet = (mavlink_camera_fov_status_t *)msgbuf;
  269. packet->time_boot_ms = time_boot_ms;
  270. packet->lat_camera = lat_camera;
  271. packet->lon_camera = lon_camera;
  272. packet->alt_camera = alt_camera;
  273. packet->lat_image = lat_image;
  274. packet->lon_image = lon_image;
  275. packet->alt_image = alt_image;
  276. packet->hfov = hfov;
  277. packet->vfov = vfov;
  278. mav_array_memcpy(packet->q, q, sizeof(float)*4);
  279. _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);
  280. #endif
  281. }
  282. #endif
  283. #endif
  284. // MESSAGE CAMERA_FOV_STATUS UNPACKING
  285. /**
  286. * @brief Get field time_boot_ms from camera_fov_status message
  287. *
  288. * @return [ms] Timestamp (time since system boot).
  289. */
  290. static inline uint32_t mavlink_msg_camera_fov_status_get_time_boot_ms(const mavlink_message_t* msg)
  291. {
  292. return _MAV_RETURN_uint32_t(msg, 0);
  293. }
  294. /**
  295. * @brief Get field lat_camera from camera_fov_status message
  296. *
  297. * @return [degE7] Latitude of camera (INT32_MAX if unknown).
  298. */
  299. static inline int32_t mavlink_msg_camera_fov_status_get_lat_camera(const mavlink_message_t* msg)
  300. {
  301. return _MAV_RETURN_int32_t(msg, 4);
  302. }
  303. /**
  304. * @brief Get field lon_camera from camera_fov_status message
  305. *
  306. * @return [degE7] Longitude of camera (INT32_MAX if unknown).
  307. */
  308. static inline int32_t mavlink_msg_camera_fov_status_get_lon_camera(const mavlink_message_t* msg)
  309. {
  310. return _MAV_RETURN_int32_t(msg, 8);
  311. }
  312. /**
  313. * @brief Get field alt_camera from camera_fov_status message
  314. *
  315. * @return [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  316. */
  317. static inline int32_t mavlink_msg_camera_fov_status_get_alt_camera(const mavlink_message_t* msg)
  318. {
  319. return _MAV_RETURN_int32_t(msg, 12);
  320. }
  321. /**
  322. * @brief Get field lat_image from camera_fov_status message
  323. *
  324. * @return [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  325. */
  326. static inline int32_t mavlink_msg_camera_fov_status_get_lat_image(const mavlink_message_t* msg)
  327. {
  328. return _MAV_RETURN_int32_t(msg, 16);
  329. }
  330. /**
  331. * @brief Get field lon_image from camera_fov_status message
  332. *
  333. * @return [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  334. */
  335. static inline int32_t mavlink_msg_camera_fov_status_get_lon_image(const mavlink_message_t* msg)
  336. {
  337. return _MAV_RETURN_int32_t(msg, 20);
  338. }
  339. /**
  340. * @brief Get field alt_image from camera_fov_status message
  341. *
  342. * @return [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  343. */
  344. static inline int32_t mavlink_msg_camera_fov_status_get_alt_image(const mavlink_message_t* msg)
  345. {
  346. return _MAV_RETURN_int32_t(msg, 24);
  347. }
  348. /**
  349. * @brief Get field q from camera_fov_status message
  350. *
  351. * @return Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  352. */
  353. static inline uint16_t mavlink_msg_camera_fov_status_get_q(const mavlink_message_t* msg, float *q)
  354. {
  355. return _MAV_RETURN_float_array(msg, q, 4, 28);
  356. }
  357. /**
  358. * @brief Get field hfov from camera_fov_status message
  359. *
  360. * @return [deg] Horizontal field of view (NaN if unknown).
  361. */
  362. static inline float mavlink_msg_camera_fov_status_get_hfov(const mavlink_message_t* msg)
  363. {
  364. return _MAV_RETURN_float(msg, 44);
  365. }
  366. /**
  367. * @brief Get field vfov from camera_fov_status message
  368. *
  369. * @return [deg] Vertical field of view (NaN if unknown).
  370. */
  371. static inline float mavlink_msg_camera_fov_status_get_vfov(const mavlink_message_t* msg)
  372. {
  373. return _MAV_RETURN_float(msg, 48);
  374. }
  375. /**
  376. * @brief Decode a camera_fov_status message into a struct
  377. *
  378. * @param msg The message to decode
  379. * @param camera_fov_status C-struct to decode the message contents into
  380. */
  381. static inline void mavlink_msg_camera_fov_status_decode(const mavlink_message_t* msg, mavlink_camera_fov_status_t* camera_fov_status)
  382. {
  383. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  384. camera_fov_status->time_boot_ms = mavlink_msg_camera_fov_status_get_time_boot_ms(msg);
  385. camera_fov_status->lat_camera = mavlink_msg_camera_fov_status_get_lat_camera(msg);
  386. camera_fov_status->lon_camera = mavlink_msg_camera_fov_status_get_lon_camera(msg);
  387. camera_fov_status->alt_camera = mavlink_msg_camera_fov_status_get_alt_camera(msg);
  388. camera_fov_status->lat_image = mavlink_msg_camera_fov_status_get_lat_image(msg);
  389. camera_fov_status->lon_image = mavlink_msg_camera_fov_status_get_lon_image(msg);
  390. camera_fov_status->alt_image = mavlink_msg_camera_fov_status_get_alt_image(msg);
  391. mavlink_msg_camera_fov_status_get_q(msg, camera_fov_status->q);
  392. camera_fov_status->hfov = mavlink_msg_camera_fov_status_get_hfov(msg);
  393. camera_fov_status->vfov = mavlink_msg_camera_fov_status_get_vfov(msg);
  394. #else
  395. uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN;
  396. memset(camera_fov_status, 0, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  397. memcpy(camera_fov_status, _MAV_PAYLOAD(msg), len);
  398. #endif
  399. }