mavlink_msg_camera_fov_status.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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
  110. * @param system_id ID of this system
  111. * @param component_id ID of this component (e.g. 200 for IMU)
  112. * @param status MAVLink status structure
  113. * @param msg The MAVLink message to compress the data into
  114. *
  115. * @param time_boot_ms [ms] Timestamp (time since system boot).
  116. * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
  117. * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
  118. * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  119. * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  120. * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  121. * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  122. * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  123. * @param hfov [deg] Horizontal field of view (NaN if unknown).
  124. * @param vfov [deg] Vertical field of view (NaN if unknown).
  125. * @return length of the message in bytes (excluding serial stream start sign)
  126. */
  127. static 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,
  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. #if MAVLINK_CRC_EXTRA
  159. 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);
  160. #else
  161. 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);
  162. #endif
  163. }
  164. /**
  165. * @brief Pack a camera_fov_status message on a channel
  166. * @param system_id ID of this system
  167. * @param component_id ID of this component (e.g. 200 for IMU)
  168. * @param chan The MAVLink channel this message will be sent over
  169. * @param msg The MAVLink message to compress the data into
  170. * @param time_boot_ms [ms] Timestamp (time since system boot).
  171. * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
  172. * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
  173. * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  174. * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  175. * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  176. * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  177. * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  178. * @param hfov [deg] Horizontal field of view (NaN if unknown).
  179. * @param vfov [deg] Vertical field of view (NaN if unknown).
  180. * @return length of the message in bytes (excluding serial stream start sign)
  181. */
  182. static inline uint16_t mavlink_msg_camera_fov_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  183. mavlink_message_t* msg,
  184. 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)
  185. {
  186. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  187. char buf[MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN];
  188. _mav_put_uint32_t(buf, 0, time_boot_ms);
  189. _mav_put_int32_t(buf, 4, lat_camera);
  190. _mav_put_int32_t(buf, 8, lon_camera);
  191. _mav_put_int32_t(buf, 12, alt_camera);
  192. _mav_put_int32_t(buf, 16, lat_image);
  193. _mav_put_int32_t(buf, 20, lon_image);
  194. _mav_put_int32_t(buf, 24, alt_image);
  195. _mav_put_float(buf, 44, hfov);
  196. _mav_put_float(buf, 48, vfov);
  197. _mav_put_float_array(buf, 28, q, 4);
  198. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  199. #else
  200. mavlink_camera_fov_status_t packet;
  201. packet.time_boot_ms = time_boot_ms;
  202. packet.lat_camera = lat_camera;
  203. packet.lon_camera = lon_camera;
  204. packet.alt_camera = alt_camera;
  205. packet.lat_image = lat_image;
  206. packet.lon_image = lon_image;
  207. packet.alt_image = alt_image;
  208. packet.hfov = hfov;
  209. packet.vfov = vfov;
  210. mav_array_memcpy(packet.q, q, sizeof(float)*4);
  211. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  212. #endif
  213. msg->msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
  214. 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);
  215. }
  216. /**
  217. * @brief Encode a camera_fov_status struct
  218. *
  219. * @param system_id ID of this system
  220. * @param component_id ID of this component (e.g. 200 for IMU)
  221. * @param msg The MAVLink message to compress the data into
  222. * @param camera_fov_status C-struct to read the message contents from
  223. */
  224. 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)
  225. {
  226. 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);
  227. }
  228. /**
  229. * @brief Encode a camera_fov_status struct on a channel
  230. *
  231. * @param system_id ID of this system
  232. * @param component_id ID of this component (e.g. 200 for IMU)
  233. * @param chan The MAVLink channel this message will be sent over
  234. * @param msg The MAVLink message to compress the data into
  235. * @param camera_fov_status C-struct to read the message contents from
  236. */
  237. 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)
  238. {
  239. 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);
  240. }
  241. /**
  242. * @brief Encode a camera_fov_status struct with provided status structure
  243. *
  244. * @param system_id ID of this system
  245. * @param component_id ID of this component (e.g. 200 for IMU)
  246. * @param status MAVLink status structure
  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. */
  250. static 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)
  251. {
  252. 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);
  253. }
  254. /**
  255. * @brief Send a camera_fov_status message
  256. * @param chan MAVLink channel to send the message
  257. *
  258. * @param time_boot_ms [ms] Timestamp (time since system boot).
  259. * @param lat_camera [degE7] Latitude of camera (INT32_MAX if unknown).
  260. * @param lon_camera [degE7] Longitude of camera (INT32_MAX if unknown).
  261. * @param alt_camera [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  262. * @param lat_image [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  263. * @param lon_image [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  264. * @param alt_image [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  265. * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  266. * @param hfov [deg] Horizontal field of view (NaN if unknown).
  267. * @param vfov [deg] Vertical field of view (NaN if unknown).
  268. */
  269. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  270. 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)
  271. {
  272. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  273. char buf[MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN];
  274. _mav_put_uint32_t(buf, 0, time_boot_ms);
  275. _mav_put_int32_t(buf, 4, lat_camera);
  276. _mav_put_int32_t(buf, 8, lon_camera);
  277. _mav_put_int32_t(buf, 12, alt_camera);
  278. _mav_put_int32_t(buf, 16, lat_image);
  279. _mav_put_int32_t(buf, 20, lon_image);
  280. _mav_put_int32_t(buf, 24, alt_image);
  281. _mav_put_float(buf, 44, hfov);
  282. _mav_put_float(buf, 48, vfov);
  283. _mav_put_float_array(buf, 28, q, 4);
  284. _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);
  285. #else
  286. mavlink_camera_fov_status_t packet;
  287. packet.time_boot_ms = time_boot_ms;
  288. packet.lat_camera = lat_camera;
  289. packet.lon_camera = lon_camera;
  290. packet.alt_camera = alt_camera;
  291. packet.lat_image = lat_image;
  292. packet.lon_image = lon_image;
  293. packet.alt_image = alt_image;
  294. packet.hfov = hfov;
  295. packet.vfov = vfov;
  296. mav_array_memcpy(packet.q, q, sizeof(float)*4);
  297. _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);
  298. #endif
  299. }
  300. /**
  301. * @brief Send a camera_fov_status message
  302. * @param chan MAVLink channel to send the message
  303. * @param struct The MAVLink struct to serialize
  304. */
  305. static inline void mavlink_msg_camera_fov_status_send_struct(mavlink_channel_t chan, const mavlink_camera_fov_status_t* camera_fov_status)
  306. {
  307. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  308. 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);
  309. #else
  310. _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);
  311. #endif
  312. }
  313. #if MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  314. /*
  315. This variant of _send() can be used to save stack space by re-using
  316. memory from the receive buffer. The caller provides a
  317. mavlink_message_t which is the size of a full mavlink message. This
  318. is usually the receive buffer for the channel, and allows a reply to an
  319. incoming message with minimum stack space usage.
  320. */
  321. 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)
  322. {
  323. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  324. char *buf = (char *)msgbuf;
  325. _mav_put_uint32_t(buf, 0, time_boot_ms);
  326. _mav_put_int32_t(buf, 4, lat_camera);
  327. _mav_put_int32_t(buf, 8, lon_camera);
  328. _mav_put_int32_t(buf, 12, alt_camera);
  329. _mav_put_int32_t(buf, 16, lat_image);
  330. _mav_put_int32_t(buf, 20, lon_image);
  331. _mav_put_int32_t(buf, 24, alt_image);
  332. _mav_put_float(buf, 44, hfov);
  333. _mav_put_float(buf, 48, vfov);
  334. _mav_put_float_array(buf, 28, q, 4);
  335. _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);
  336. #else
  337. mavlink_camera_fov_status_t *packet = (mavlink_camera_fov_status_t *)msgbuf;
  338. packet->time_boot_ms = time_boot_ms;
  339. packet->lat_camera = lat_camera;
  340. packet->lon_camera = lon_camera;
  341. packet->alt_camera = alt_camera;
  342. packet->lat_image = lat_image;
  343. packet->lon_image = lon_image;
  344. packet->alt_image = alt_image;
  345. packet->hfov = hfov;
  346. packet->vfov = vfov;
  347. mav_array_memcpy(packet->q, q, sizeof(float)*4);
  348. _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);
  349. #endif
  350. }
  351. #endif
  352. #endif
  353. // MESSAGE CAMERA_FOV_STATUS UNPACKING
  354. /**
  355. * @brief Get field time_boot_ms from camera_fov_status message
  356. *
  357. * @return [ms] Timestamp (time since system boot).
  358. */
  359. static inline uint32_t mavlink_msg_camera_fov_status_get_time_boot_ms(const mavlink_message_t* msg)
  360. {
  361. return _MAV_RETURN_uint32_t(msg, 0);
  362. }
  363. /**
  364. * @brief Get field lat_camera from camera_fov_status message
  365. *
  366. * @return [degE7] Latitude of camera (INT32_MAX if unknown).
  367. */
  368. static inline int32_t mavlink_msg_camera_fov_status_get_lat_camera(const mavlink_message_t* msg)
  369. {
  370. return _MAV_RETURN_int32_t(msg, 4);
  371. }
  372. /**
  373. * @brief Get field lon_camera from camera_fov_status message
  374. *
  375. * @return [degE7] Longitude of camera (INT32_MAX if unknown).
  376. */
  377. static inline int32_t mavlink_msg_camera_fov_status_get_lon_camera(const mavlink_message_t* msg)
  378. {
  379. return _MAV_RETURN_int32_t(msg, 8);
  380. }
  381. /**
  382. * @brief Get field alt_camera from camera_fov_status message
  383. *
  384. * @return [mm] Altitude (MSL) of camera (INT32_MAX if unknown).
  385. */
  386. static inline int32_t mavlink_msg_camera_fov_status_get_alt_camera(const mavlink_message_t* msg)
  387. {
  388. return _MAV_RETURN_int32_t(msg, 12);
  389. }
  390. /**
  391. * @brief Get field lat_image from camera_fov_status message
  392. *
  393. * @return [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  394. */
  395. static inline int32_t mavlink_msg_camera_fov_status_get_lat_image(const mavlink_message_t* msg)
  396. {
  397. return _MAV_RETURN_int32_t(msg, 16);
  398. }
  399. /**
  400. * @brief Get field lon_image from camera_fov_status message
  401. *
  402. * @return [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  403. */
  404. static inline int32_t mavlink_msg_camera_fov_status_get_lon_image(const mavlink_message_t* msg)
  405. {
  406. return _MAV_RETURN_int32_t(msg, 20);
  407. }
  408. /**
  409. * @brief Get field alt_image from camera_fov_status message
  410. *
  411. * @return [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
  412. */
  413. static inline int32_t mavlink_msg_camera_fov_status_get_alt_image(const mavlink_message_t* msg)
  414. {
  415. return _MAV_RETURN_int32_t(msg, 24);
  416. }
  417. /**
  418. * @brief Get field q from camera_fov_status message
  419. *
  420. * @return Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
  421. */
  422. static inline uint16_t mavlink_msg_camera_fov_status_get_q(const mavlink_message_t* msg, float *q)
  423. {
  424. return _MAV_RETURN_float_array(msg, q, 4, 28);
  425. }
  426. /**
  427. * @brief Get field hfov from camera_fov_status message
  428. *
  429. * @return [deg] Horizontal field of view (NaN if unknown).
  430. */
  431. static inline float mavlink_msg_camera_fov_status_get_hfov(const mavlink_message_t* msg)
  432. {
  433. return _MAV_RETURN_float(msg, 44);
  434. }
  435. /**
  436. * @brief Get field vfov from camera_fov_status message
  437. *
  438. * @return [deg] Vertical field of view (NaN if unknown).
  439. */
  440. static inline float mavlink_msg_camera_fov_status_get_vfov(const mavlink_message_t* msg)
  441. {
  442. return _MAV_RETURN_float(msg, 48);
  443. }
  444. /**
  445. * @brief Decode a camera_fov_status message into a struct
  446. *
  447. * @param msg The message to decode
  448. * @param camera_fov_status C-struct to decode the message contents into
  449. */
  450. static inline void mavlink_msg_camera_fov_status_decode(const mavlink_message_t* msg, mavlink_camera_fov_status_t* camera_fov_status)
  451. {
  452. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  453. camera_fov_status->time_boot_ms = mavlink_msg_camera_fov_status_get_time_boot_ms(msg);
  454. camera_fov_status->lat_camera = mavlink_msg_camera_fov_status_get_lat_camera(msg);
  455. camera_fov_status->lon_camera = mavlink_msg_camera_fov_status_get_lon_camera(msg);
  456. camera_fov_status->alt_camera = mavlink_msg_camera_fov_status_get_alt_camera(msg);
  457. camera_fov_status->lat_image = mavlink_msg_camera_fov_status_get_lat_image(msg);
  458. camera_fov_status->lon_image = mavlink_msg_camera_fov_status_get_lon_image(msg);
  459. camera_fov_status->alt_image = mavlink_msg_camera_fov_status_get_alt_image(msg);
  460. mavlink_msg_camera_fov_status_get_q(msg, camera_fov_status->q);
  461. camera_fov_status->hfov = mavlink_msg_camera_fov_status_get_hfov(msg);
  462. camera_fov_status->vfov = mavlink_msg_camera_fov_status_get_vfov(msg);
  463. #else
  464. uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN;
  465. memset(camera_fov_status, 0, MAVLINK_MSG_ID_CAMERA_FOV_STATUS_LEN);
  466. memcpy(camera_fov_status, _MAV_PAYLOAD(msg), len);
  467. #endif
  468. }