mavlink_msg_gimbal_manager_information.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. #pragma once
  2. // MESSAGE GIMBAL_MANAGER_INFORMATION PACKING
  3. #define MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION 280
  4. typedef struct __mavlink_gimbal_manager_information_t {
  5. uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
  6. uint32_t cap_flags; /*< Bitmap of gimbal capability flags.*/
  7. float roll_min; /*< [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)*/
  8. float roll_max; /*< [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)*/
  9. float pitch_min; /*< [rad] Minimum pitch angle (positive: up, negative: down)*/
  10. float pitch_max; /*< [rad] Maximum pitch angle (positive: up, negative: down)*/
  11. float yaw_min; /*< [rad] Minimum yaw angle (positive: to the right, negative: to the left)*/
  12. float yaw_max; /*< [rad] Maximum yaw angle (positive: to the right, negative: to the left)*/
  13. uint8_t gimbal_device_id; /*< Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal).*/
  14. } mavlink_gimbal_manager_information_t;
  15. #define MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN 33
  16. #define MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN 33
  17. #define MAVLINK_MSG_ID_280_LEN 33
  18. #define MAVLINK_MSG_ID_280_MIN_LEN 33
  19. #define MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC 70
  20. #define MAVLINK_MSG_ID_280_CRC 70
  21. #if MAVLINK_COMMAND_24BIT
  22. #define MAVLINK_MESSAGE_INFO_GIMBAL_MANAGER_INFORMATION { \
  23. 280, \
  24. "GIMBAL_MANAGER_INFORMATION", \
  25. 9, \
  26. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gimbal_manager_information_t, time_boot_ms) }, \
  27. { "cap_flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gimbal_manager_information_t, cap_flags) }, \
  28. { "gimbal_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gimbal_manager_information_t, gimbal_device_id) }, \
  29. { "roll_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_manager_information_t, roll_min) }, \
  30. { "roll_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_manager_information_t, roll_max) }, \
  31. { "pitch_min", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_manager_information_t, pitch_min) }, \
  32. { "pitch_max", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_manager_information_t, pitch_max) }, \
  33. { "yaw_min", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_manager_information_t, yaw_min) }, \
  34. { "yaw_max", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_manager_information_t, yaw_max) }, \
  35. } \
  36. }
  37. #else
  38. #define MAVLINK_MESSAGE_INFO_GIMBAL_MANAGER_INFORMATION { \
  39. "GIMBAL_MANAGER_INFORMATION", \
  40. 9, \
  41. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gimbal_manager_information_t, time_boot_ms) }, \
  42. { "cap_flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gimbal_manager_information_t, cap_flags) }, \
  43. { "gimbal_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gimbal_manager_information_t, gimbal_device_id) }, \
  44. { "roll_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_manager_information_t, roll_min) }, \
  45. { "roll_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_manager_information_t, roll_max) }, \
  46. { "pitch_min", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_manager_information_t, pitch_min) }, \
  47. { "pitch_max", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_manager_information_t, pitch_max) }, \
  48. { "yaw_min", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_manager_information_t, yaw_min) }, \
  49. { "yaw_max", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_manager_information_t, yaw_max) }, \
  50. } \
  51. }
  52. #endif
  53. /**
  54. * @brief Pack a gimbal_manager_information message
  55. * @param system_id ID of this system
  56. * @param component_id ID of this component (e.g. 200 for IMU)
  57. * @param msg The MAVLink message to compress the data into
  58. *
  59. * @param time_boot_ms [ms] Timestamp (time since system boot).
  60. * @param cap_flags Bitmap of gimbal capability flags.
  61. * @param gimbal_device_id Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal).
  62. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  63. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  64. * @param pitch_min [rad] Minimum pitch angle (positive: up, negative: down)
  65. * @param pitch_max [rad] Maximum pitch angle (positive: up, negative: down)
  66. * @param yaw_min [rad] Minimum yaw angle (positive: to the right, negative: to the left)
  67. * @param yaw_max [rad] Maximum yaw angle (positive: to the right, negative: to the left)
  68. * @return length of the message in bytes (excluding serial stream start sign)
  69. */
  70. static inline uint16_t mavlink_msg_gimbal_manager_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  71. uint32_t time_boot_ms, uint32_t cap_flags, uint8_t gimbal_device_id, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max)
  72. {
  73. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  74. char buf[MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN];
  75. _mav_put_uint32_t(buf, 0, time_boot_ms);
  76. _mav_put_uint32_t(buf, 4, cap_flags);
  77. _mav_put_float(buf, 8, roll_min);
  78. _mav_put_float(buf, 12, roll_max);
  79. _mav_put_float(buf, 16, pitch_min);
  80. _mav_put_float(buf, 20, pitch_max);
  81. _mav_put_float(buf, 24, yaw_min);
  82. _mav_put_float(buf, 28, yaw_max);
  83. _mav_put_uint8_t(buf, 32, gimbal_device_id);
  84. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN);
  85. #else
  86. mavlink_gimbal_manager_information_t packet;
  87. packet.time_boot_ms = time_boot_ms;
  88. packet.cap_flags = cap_flags;
  89. packet.roll_min = roll_min;
  90. packet.roll_max = roll_max;
  91. packet.pitch_min = pitch_min;
  92. packet.pitch_max = pitch_max;
  93. packet.yaw_min = yaw_min;
  94. packet.yaw_max = yaw_max;
  95. packet.gimbal_device_id = gimbal_device_id;
  96. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN);
  97. #endif
  98. msg->msgid = MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION;
  99. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  100. }
  101. /**
  102. * @brief Pack a gimbal_manager_information message on a channel
  103. * @param system_id ID of this system
  104. * @param component_id ID of this component (e.g. 200 for IMU)
  105. * @param chan The MAVLink channel this message will be sent over
  106. * @param msg The MAVLink message to compress the data into
  107. * @param time_boot_ms [ms] Timestamp (time since system boot).
  108. * @param cap_flags Bitmap of gimbal capability flags.
  109. * @param gimbal_device_id Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal).
  110. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  111. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  112. * @param pitch_min [rad] Minimum pitch angle (positive: up, negative: down)
  113. * @param pitch_max [rad] Maximum pitch angle (positive: up, negative: down)
  114. * @param yaw_min [rad] Minimum yaw angle (positive: to the right, negative: to the left)
  115. * @param yaw_max [rad] Maximum yaw angle (positive: to the right, negative: to the left)
  116. * @return length of the message in bytes (excluding serial stream start sign)
  117. */
  118. static inline uint16_t mavlink_msg_gimbal_manager_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  119. mavlink_message_t* msg,
  120. uint32_t time_boot_ms,uint32_t cap_flags,uint8_t gimbal_device_id,float roll_min,float roll_max,float pitch_min,float pitch_max,float yaw_min,float yaw_max)
  121. {
  122. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  123. char buf[MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN];
  124. _mav_put_uint32_t(buf, 0, time_boot_ms);
  125. _mav_put_uint32_t(buf, 4, cap_flags);
  126. _mav_put_float(buf, 8, roll_min);
  127. _mav_put_float(buf, 12, roll_max);
  128. _mav_put_float(buf, 16, pitch_min);
  129. _mav_put_float(buf, 20, pitch_max);
  130. _mav_put_float(buf, 24, yaw_min);
  131. _mav_put_float(buf, 28, yaw_max);
  132. _mav_put_uint8_t(buf, 32, gimbal_device_id);
  133. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN);
  134. #else
  135. mavlink_gimbal_manager_information_t packet;
  136. packet.time_boot_ms = time_boot_ms;
  137. packet.cap_flags = cap_flags;
  138. packet.roll_min = roll_min;
  139. packet.roll_max = roll_max;
  140. packet.pitch_min = pitch_min;
  141. packet.pitch_max = pitch_max;
  142. packet.yaw_min = yaw_min;
  143. packet.yaw_max = yaw_max;
  144. packet.gimbal_device_id = gimbal_device_id;
  145. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN);
  146. #endif
  147. msg->msgid = MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION;
  148. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  149. }
  150. /**
  151. * @brief Encode a gimbal_manager_information struct
  152. *
  153. * @param system_id ID of this system
  154. * @param component_id ID of this component (e.g. 200 for IMU)
  155. * @param msg The MAVLink message to compress the data into
  156. * @param gimbal_manager_information C-struct to read the message contents from
  157. */
  158. static inline uint16_t mavlink_msg_gimbal_manager_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_manager_information_t* gimbal_manager_information)
  159. {
  160. return mavlink_msg_gimbal_manager_information_pack(system_id, component_id, msg, gimbal_manager_information->time_boot_ms, gimbal_manager_information->cap_flags, gimbal_manager_information->gimbal_device_id, gimbal_manager_information->roll_min, gimbal_manager_information->roll_max, gimbal_manager_information->pitch_min, gimbal_manager_information->pitch_max, gimbal_manager_information->yaw_min, gimbal_manager_information->yaw_max);
  161. }
  162. /**
  163. * @brief Encode a gimbal_manager_information struct on a channel
  164. *
  165. * @param system_id ID of this system
  166. * @param component_id ID of this component (e.g. 200 for IMU)
  167. * @param chan The MAVLink channel this message will be sent over
  168. * @param msg The MAVLink message to compress the data into
  169. * @param gimbal_manager_information C-struct to read the message contents from
  170. */
  171. static inline uint16_t mavlink_msg_gimbal_manager_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_manager_information_t* gimbal_manager_information)
  172. {
  173. return mavlink_msg_gimbal_manager_information_pack_chan(system_id, component_id, chan, msg, gimbal_manager_information->time_boot_ms, gimbal_manager_information->cap_flags, gimbal_manager_information->gimbal_device_id, gimbal_manager_information->roll_min, gimbal_manager_information->roll_max, gimbal_manager_information->pitch_min, gimbal_manager_information->pitch_max, gimbal_manager_information->yaw_min, gimbal_manager_information->yaw_max);
  174. }
  175. /**
  176. * @brief Send a gimbal_manager_information message
  177. * @param chan MAVLink channel to send the message
  178. *
  179. * @param time_boot_ms [ms] Timestamp (time since system boot).
  180. * @param cap_flags Bitmap of gimbal capability flags.
  181. * @param gimbal_device_id Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal).
  182. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  183. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  184. * @param pitch_min [rad] Minimum pitch angle (positive: up, negative: down)
  185. * @param pitch_max [rad] Maximum pitch angle (positive: up, negative: down)
  186. * @param yaw_min [rad] Minimum yaw angle (positive: to the right, negative: to the left)
  187. * @param yaw_max [rad] Maximum yaw angle (positive: to the right, negative: to the left)
  188. */
  189. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  190. static inline void mavlink_msg_gimbal_manager_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t cap_flags, uint8_t gimbal_device_id, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max)
  191. {
  192. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  193. char buf[MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN];
  194. _mav_put_uint32_t(buf, 0, time_boot_ms);
  195. _mav_put_uint32_t(buf, 4, cap_flags);
  196. _mav_put_float(buf, 8, roll_min);
  197. _mav_put_float(buf, 12, roll_max);
  198. _mav_put_float(buf, 16, pitch_min);
  199. _mav_put_float(buf, 20, pitch_max);
  200. _mav_put_float(buf, 24, yaw_min);
  201. _mav_put_float(buf, 28, yaw_max);
  202. _mav_put_uint8_t(buf, 32, gimbal_device_id);
  203. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION, buf, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  204. #else
  205. mavlink_gimbal_manager_information_t packet;
  206. packet.time_boot_ms = time_boot_ms;
  207. packet.cap_flags = cap_flags;
  208. packet.roll_min = roll_min;
  209. packet.roll_max = roll_max;
  210. packet.pitch_min = pitch_min;
  211. packet.pitch_max = pitch_max;
  212. packet.yaw_min = yaw_min;
  213. packet.yaw_max = yaw_max;
  214. packet.gimbal_device_id = gimbal_device_id;
  215. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  216. #endif
  217. }
  218. /**
  219. * @brief Send a gimbal_manager_information message
  220. * @param chan MAVLink channel to send the message
  221. * @param struct The MAVLink struct to serialize
  222. */
  223. static inline void mavlink_msg_gimbal_manager_information_send_struct(mavlink_channel_t chan, const mavlink_gimbal_manager_information_t* gimbal_manager_information)
  224. {
  225. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  226. mavlink_msg_gimbal_manager_information_send(chan, gimbal_manager_information->time_boot_ms, gimbal_manager_information->cap_flags, gimbal_manager_information->gimbal_device_id, gimbal_manager_information->roll_min, gimbal_manager_information->roll_max, gimbal_manager_information->pitch_min, gimbal_manager_information->pitch_max, gimbal_manager_information->yaw_min, gimbal_manager_information->yaw_max);
  227. #else
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION, (const char *)gimbal_manager_information, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  229. #endif
  230. }
  231. #if MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  232. /*
  233. This variant of _send() can be used to save stack space by re-using
  234. memory from the receive buffer. The caller provides a
  235. mavlink_message_t which is the size of a full mavlink message. This
  236. is usually the receive buffer for the channel, and allows a reply to an
  237. incoming message with minimum stack space usage.
  238. */
  239. static inline void mavlink_msg_gimbal_manager_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t cap_flags, uint8_t gimbal_device_id, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max)
  240. {
  241. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  242. char *buf = (char *)msgbuf;
  243. _mav_put_uint32_t(buf, 0, time_boot_ms);
  244. _mav_put_uint32_t(buf, 4, cap_flags);
  245. _mav_put_float(buf, 8, roll_min);
  246. _mav_put_float(buf, 12, roll_max);
  247. _mav_put_float(buf, 16, pitch_min);
  248. _mav_put_float(buf, 20, pitch_max);
  249. _mav_put_float(buf, 24, yaw_min);
  250. _mav_put_float(buf, 28, yaw_max);
  251. _mav_put_uint8_t(buf, 32, gimbal_device_id);
  252. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION, buf, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  253. #else
  254. mavlink_gimbal_manager_information_t *packet = (mavlink_gimbal_manager_information_t *)msgbuf;
  255. packet->time_boot_ms = time_boot_ms;
  256. packet->cap_flags = cap_flags;
  257. packet->roll_min = roll_min;
  258. packet->roll_max = roll_max;
  259. packet->pitch_min = pitch_min;
  260. packet->pitch_max = pitch_max;
  261. packet->yaw_min = yaw_min;
  262. packet->yaw_max = yaw_max;
  263. packet->gimbal_device_id = gimbal_device_id;
  264. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_CRC);
  265. #endif
  266. }
  267. #endif
  268. #endif
  269. // MESSAGE GIMBAL_MANAGER_INFORMATION UNPACKING
  270. /**
  271. * @brief Get field time_boot_ms from gimbal_manager_information message
  272. *
  273. * @return [ms] Timestamp (time since system boot).
  274. */
  275. static inline uint32_t mavlink_msg_gimbal_manager_information_get_time_boot_ms(const mavlink_message_t* msg)
  276. {
  277. return _MAV_RETURN_uint32_t(msg, 0);
  278. }
  279. /**
  280. * @brief Get field cap_flags from gimbal_manager_information message
  281. *
  282. * @return Bitmap of gimbal capability flags.
  283. */
  284. static inline uint32_t mavlink_msg_gimbal_manager_information_get_cap_flags(const mavlink_message_t* msg)
  285. {
  286. return _MAV_RETURN_uint32_t(msg, 4);
  287. }
  288. /**
  289. * @brief Get field gimbal_device_id from gimbal_manager_information message
  290. *
  291. * @return Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal).
  292. */
  293. static inline uint8_t mavlink_msg_gimbal_manager_information_get_gimbal_device_id(const mavlink_message_t* msg)
  294. {
  295. return _MAV_RETURN_uint8_t(msg, 32);
  296. }
  297. /**
  298. * @brief Get field roll_min from gimbal_manager_information message
  299. *
  300. * @return [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  301. */
  302. static inline float mavlink_msg_gimbal_manager_information_get_roll_min(const mavlink_message_t* msg)
  303. {
  304. return _MAV_RETURN_float(msg, 8);
  305. }
  306. /**
  307. * @brief Get field roll_max from gimbal_manager_information message
  308. *
  309. * @return [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
  310. */
  311. static inline float mavlink_msg_gimbal_manager_information_get_roll_max(const mavlink_message_t* msg)
  312. {
  313. return _MAV_RETURN_float(msg, 12);
  314. }
  315. /**
  316. * @brief Get field pitch_min from gimbal_manager_information message
  317. *
  318. * @return [rad] Minimum pitch angle (positive: up, negative: down)
  319. */
  320. static inline float mavlink_msg_gimbal_manager_information_get_pitch_min(const mavlink_message_t* msg)
  321. {
  322. return _MAV_RETURN_float(msg, 16);
  323. }
  324. /**
  325. * @brief Get field pitch_max from gimbal_manager_information message
  326. *
  327. * @return [rad] Maximum pitch angle (positive: up, negative: down)
  328. */
  329. static inline float mavlink_msg_gimbal_manager_information_get_pitch_max(const mavlink_message_t* msg)
  330. {
  331. return _MAV_RETURN_float(msg, 20);
  332. }
  333. /**
  334. * @brief Get field yaw_min from gimbal_manager_information message
  335. *
  336. * @return [rad] Minimum yaw angle (positive: to the right, negative: to the left)
  337. */
  338. static inline float mavlink_msg_gimbal_manager_information_get_yaw_min(const mavlink_message_t* msg)
  339. {
  340. return _MAV_RETURN_float(msg, 24);
  341. }
  342. /**
  343. * @brief Get field yaw_max from gimbal_manager_information message
  344. *
  345. * @return [rad] Maximum yaw angle (positive: to the right, negative: to the left)
  346. */
  347. static inline float mavlink_msg_gimbal_manager_information_get_yaw_max(const mavlink_message_t* msg)
  348. {
  349. return _MAV_RETURN_float(msg, 28);
  350. }
  351. /**
  352. * @brief Decode a gimbal_manager_information message into a struct
  353. *
  354. * @param msg The message to decode
  355. * @param gimbal_manager_information C-struct to decode the message contents into
  356. */
  357. static inline void mavlink_msg_gimbal_manager_information_decode(const mavlink_message_t* msg, mavlink_gimbal_manager_information_t* gimbal_manager_information)
  358. {
  359. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  360. gimbal_manager_information->time_boot_ms = mavlink_msg_gimbal_manager_information_get_time_boot_ms(msg);
  361. gimbal_manager_information->cap_flags = mavlink_msg_gimbal_manager_information_get_cap_flags(msg);
  362. gimbal_manager_information->roll_min = mavlink_msg_gimbal_manager_information_get_roll_min(msg);
  363. gimbal_manager_information->roll_max = mavlink_msg_gimbal_manager_information_get_roll_max(msg);
  364. gimbal_manager_information->pitch_min = mavlink_msg_gimbal_manager_information_get_pitch_min(msg);
  365. gimbal_manager_information->pitch_max = mavlink_msg_gimbal_manager_information_get_pitch_max(msg);
  366. gimbal_manager_information->yaw_min = mavlink_msg_gimbal_manager_information_get_yaw_min(msg);
  367. gimbal_manager_information->yaw_max = mavlink_msg_gimbal_manager_information_get_yaw_max(msg);
  368. gimbal_manager_information->gimbal_device_id = mavlink_msg_gimbal_manager_information_get_gimbal_device_id(msg);
  369. #else
  370. uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN;
  371. memset(gimbal_manager_information, 0, MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_LEN);
  372. memcpy(gimbal_manager_information, _MAV_PAYLOAD(msg), len);
  373. #endif
  374. }