mavlink_msg_gimbal_device_information.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. #pragma once
  2. // MESSAGE GIMBAL_DEVICE_INFORMATION PACKING
  3. #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION 283
  4. typedef struct __mavlink_gimbal_device_information_t {
  5. uint64_t uid; /*< UID of gimbal hardware (0 if unknown).*/
  6. uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
  7. uint32_t firmware_version; /*< Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).*/
  8. uint32_t hardware_version; /*< Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).*/
  9. float roll_min; /*< [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.*/
  10. float roll_max; /*< [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.*/
  11. float pitch_min; /*< [rad] Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.*/
  12. float pitch_max; /*< [rad] Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.*/
  13. float yaw_min; /*< [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.*/
  14. float yaw_max; /*< [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.*/
  15. uint16_t cap_flags; /*< Bitmap of gimbal capability flags.*/
  16. uint16_t custom_cap_flags; /*< Bitmap for use for gimbal-specific capability flags.*/
  17. char vendor_name[32]; /*< Name of the gimbal vendor.*/
  18. char model_name[32]; /*< Name of the gimbal model.*/
  19. char custom_name[32]; /*< Custom name of the gimbal given to it by the user.*/
  20. uint8_t gimbal_device_id; /*< This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0.*/
  21. } mavlink_gimbal_device_information_t;
  22. #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN 145
  23. #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN 144
  24. #define MAVLINK_MSG_ID_283_LEN 145
  25. #define MAVLINK_MSG_ID_283_MIN_LEN 144
  26. #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC 74
  27. #define MAVLINK_MSG_ID_283_CRC 74
  28. #define MAVLINK_MSG_GIMBAL_DEVICE_INFORMATION_FIELD_VENDOR_NAME_LEN 32
  29. #define MAVLINK_MSG_GIMBAL_DEVICE_INFORMATION_FIELD_MODEL_NAME_LEN 32
  30. #define MAVLINK_MSG_GIMBAL_DEVICE_INFORMATION_FIELD_CUSTOM_NAME_LEN 32
  31. #if MAVLINK_COMMAND_24BIT
  32. #define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_INFORMATION { \
  33. 283, \
  34. "GIMBAL_DEVICE_INFORMATION", \
  35. 16, \
  36. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gimbal_device_information_t, time_boot_ms) }, \
  37. { "vendor_name", NULL, MAVLINK_TYPE_CHAR, 32, 48, offsetof(mavlink_gimbal_device_information_t, vendor_name) }, \
  38. { "model_name", NULL, MAVLINK_TYPE_CHAR, 32, 80, offsetof(mavlink_gimbal_device_information_t, model_name) }, \
  39. { "custom_name", NULL, MAVLINK_TYPE_CHAR, 32, 112, offsetof(mavlink_gimbal_device_information_t, custom_name) }, \
  40. { "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_gimbal_device_information_t, firmware_version) }, \
  41. { "hardware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gimbal_device_information_t, hardware_version) }, \
  42. { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gimbal_device_information_t, uid) }, \
  43. { "cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 44, offsetof(mavlink_gimbal_device_information_t, cap_flags) }, \
  44. { "custom_cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 46, offsetof(mavlink_gimbal_device_information_t, custom_cap_flags) }, \
  45. { "roll_min", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_information_t, roll_min) }, \
  46. { "roll_max", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_information_t, roll_max) }, \
  47. { "pitch_min", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_device_information_t, pitch_min) }, \
  48. { "pitch_max", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_device_information_t, pitch_max) }, \
  49. { "yaw_min", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_device_information_t, yaw_min) }, \
  50. { "yaw_max", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gimbal_device_information_t, yaw_max) }, \
  51. { "gimbal_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 144, offsetof(mavlink_gimbal_device_information_t, gimbal_device_id) }, \
  52. } \
  53. }
  54. #else
  55. #define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_INFORMATION { \
  56. "GIMBAL_DEVICE_INFORMATION", \
  57. 16, \
  58. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gimbal_device_information_t, time_boot_ms) }, \
  59. { "vendor_name", NULL, MAVLINK_TYPE_CHAR, 32, 48, offsetof(mavlink_gimbal_device_information_t, vendor_name) }, \
  60. { "model_name", NULL, MAVLINK_TYPE_CHAR, 32, 80, offsetof(mavlink_gimbal_device_information_t, model_name) }, \
  61. { "custom_name", NULL, MAVLINK_TYPE_CHAR, 32, 112, offsetof(mavlink_gimbal_device_information_t, custom_name) }, \
  62. { "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_gimbal_device_information_t, firmware_version) }, \
  63. { "hardware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gimbal_device_information_t, hardware_version) }, \
  64. { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gimbal_device_information_t, uid) }, \
  65. { "cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 44, offsetof(mavlink_gimbal_device_information_t, cap_flags) }, \
  66. { "custom_cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 46, offsetof(mavlink_gimbal_device_information_t, custom_cap_flags) }, \
  67. { "roll_min", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_information_t, roll_min) }, \
  68. { "roll_max", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_information_t, roll_max) }, \
  69. { "pitch_min", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_device_information_t, pitch_min) }, \
  70. { "pitch_max", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_device_information_t, pitch_max) }, \
  71. { "yaw_min", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_device_information_t, yaw_min) }, \
  72. { "yaw_max", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gimbal_device_information_t, yaw_max) }, \
  73. { "gimbal_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 144, offsetof(mavlink_gimbal_device_information_t, gimbal_device_id) }, \
  74. } \
  75. }
  76. #endif
  77. /**
  78. * @brief Pack a gimbal_device_information message
  79. * @param system_id ID of this system
  80. * @param component_id ID of this component (e.g. 200 for IMU)
  81. * @param msg The MAVLink message to compress the data into
  82. *
  83. * @param time_boot_ms [ms] Timestamp (time since system boot).
  84. * @param vendor_name Name of the gimbal vendor.
  85. * @param model_name Name of the gimbal model.
  86. * @param custom_name Custom name of the gimbal given to it by the user.
  87. * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  88. * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  89. * @param uid UID of gimbal hardware (0 if unknown).
  90. * @param cap_flags Bitmap of gimbal capability flags.
  91. * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
  92. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  93. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  94. * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  95. * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  96. * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  97. * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  98. * @param gimbal_device_id This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0.
  99. * @return length of the message in bytes (excluding serial stream start sign)
  100. */
  101. static inline uint16_t mavlink_msg_gimbal_device_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  102. uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max, uint8_t gimbal_device_id)
  103. {
  104. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  105. char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
  106. _mav_put_uint64_t(buf, 0, uid);
  107. _mav_put_uint32_t(buf, 8, time_boot_ms);
  108. _mav_put_uint32_t(buf, 12, firmware_version);
  109. _mav_put_uint32_t(buf, 16, hardware_version);
  110. _mav_put_float(buf, 20, roll_min);
  111. _mav_put_float(buf, 24, roll_max);
  112. _mav_put_float(buf, 28, pitch_min);
  113. _mav_put_float(buf, 32, pitch_max);
  114. _mav_put_float(buf, 36, yaw_min);
  115. _mav_put_float(buf, 40, yaw_max);
  116. _mav_put_uint16_t(buf, 44, cap_flags);
  117. _mav_put_uint16_t(buf, 46, custom_cap_flags);
  118. _mav_put_uint8_t(buf, 144, gimbal_device_id);
  119. _mav_put_char_array(buf, 48, vendor_name, 32);
  120. _mav_put_char_array(buf, 80, model_name, 32);
  121. _mav_put_char_array(buf, 112, custom_name, 32);
  122. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  123. #else
  124. mavlink_gimbal_device_information_t packet;
  125. packet.uid = uid;
  126. packet.time_boot_ms = time_boot_ms;
  127. packet.firmware_version = firmware_version;
  128. packet.hardware_version = hardware_version;
  129. packet.roll_min = roll_min;
  130. packet.roll_max = roll_max;
  131. packet.pitch_min = pitch_min;
  132. packet.pitch_max = pitch_max;
  133. packet.yaw_min = yaw_min;
  134. packet.yaw_max = yaw_max;
  135. packet.cap_flags = cap_flags;
  136. packet.custom_cap_flags = custom_cap_flags;
  137. packet.gimbal_device_id = gimbal_device_id;
  138. mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
  139. mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
  140. mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
  141. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  142. #endif
  143. msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION;
  144. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  145. }
  146. /**
  147. * @brief Pack a gimbal_device_information message
  148. * @param system_id ID of this system
  149. * @param component_id ID of this component (e.g. 200 for IMU)
  150. * @param status MAVLink status structure
  151. * @param msg The MAVLink message to compress the data into
  152. *
  153. * @param time_boot_ms [ms] Timestamp (time since system boot).
  154. * @param vendor_name Name of the gimbal vendor.
  155. * @param model_name Name of the gimbal model.
  156. * @param custom_name Custom name of the gimbal given to it by the user.
  157. * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  158. * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  159. * @param uid UID of gimbal hardware (0 if unknown).
  160. * @param cap_flags Bitmap of gimbal capability flags.
  161. * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
  162. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  163. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  164. * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  165. * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  166. * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  167. * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  168. * @param gimbal_device_id This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0.
  169. * @return length of the message in bytes (excluding serial stream start sign)
  170. */
  171. static inline uint16_t mavlink_msg_gimbal_device_information_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  172. uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max, uint8_t gimbal_device_id)
  173. {
  174. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  175. char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
  176. _mav_put_uint64_t(buf, 0, uid);
  177. _mav_put_uint32_t(buf, 8, time_boot_ms);
  178. _mav_put_uint32_t(buf, 12, firmware_version);
  179. _mav_put_uint32_t(buf, 16, hardware_version);
  180. _mav_put_float(buf, 20, roll_min);
  181. _mav_put_float(buf, 24, roll_max);
  182. _mav_put_float(buf, 28, pitch_min);
  183. _mav_put_float(buf, 32, pitch_max);
  184. _mav_put_float(buf, 36, yaw_min);
  185. _mav_put_float(buf, 40, yaw_max);
  186. _mav_put_uint16_t(buf, 44, cap_flags);
  187. _mav_put_uint16_t(buf, 46, custom_cap_flags);
  188. _mav_put_uint8_t(buf, 144, gimbal_device_id);
  189. _mav_put_char_array(buf, 48, vendor_name, 32);
  190. _mav_put_char_array(buf, 80, model_name, 32);
  191. _mav_put_char_array(buf, 112, custom_name, 32);
  192. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  193. #else
  194. mavlink_gimbal_device_information_t packet;
  195. packet.uid = uid;
  196. packet.time_boot_ms = time_boot_ms;
  197. packet.firmware_version = firmware_version;
  198. packet.hardware_version = hardware_version;
  199. packet.roll_min = roll_min;
  200. packet.roll_max = roll_max;
  201. packet.pitch_min = pitch_min;
  202. packet.pitch_max = pitch_max;
  203. packet.yaw_min = yaw_min;
  204. packet.yaw_max = yaw_max;
  205. packet.cap_flags = cap_flags;
  206. packet.custom_cap_flags = custom_cap_flags;
  207. packet.gimbal_device_id = gimbal_device_id;
  208. mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
  209. mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
  210. mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
  211. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  212. #endif
  213. msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION;
  214. #if MAVLINK_CRC_EXTRA
  215. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  216. #else
  217. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  218. #endif
  219. }
  220. /**
  221. * @brief Pack a gimbal_device_information message on a channel
  222. * @param system_id ID of this system
  223. * @param component_id ID of this component (e.g. 200 for IMU)
  224. * @param chan The MAVLink channel this message will be sent over
  225. * @param msg The MAVLink message to compress the data into
  226. * @param time_boot_ms [ms] Timestamp (time since system boot).
  227. * @param vendor_name Name of the gimbal vendor.
  228. * @param model_name Name of the gimbal model.
  229. * @param custom_name Custom name of the gimbal given to it by the user.
  230. * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  231. * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  232. * @param uid UID of gimbal hardware (0 if unknown).
  233. * @param cap_flags Bitmap of gimbal capability flags.
  234. * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
  235. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  236. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  237. * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  238. * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  239. * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  240. * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  241. * @param gimbal_device_id This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0.
  242. * @return length of the message in bytes (excluding serial stream start sign)
  243. */
  244. static inline uint16_t mavlink_msg_gimbal_device_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  245. mavlink_message_t* msg,
  246. uint32_t time_boot_ms,const char *vendor_name,const char *model_name,const char *custom_name,uint32_t firmware_version,uint32_t hardware_version,uint64_t uid,uint16_t cap_flags,uint16_t custom_cap_flags,float roll_min,float roll_max,float pitch_min,float pitch_max,float yaw_min,float yaw_max,uint8_t gimbal_device_id)
  247. {
  248. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  249. char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
  250. _mav_put_uint64_t(buf, 0, uid);
  251. _mav_put_uint32_t(buf, 8, time_boot_ms);
  252. _mav_put_uint32_t(buf, 12, firmware_version);
  253. _mav_put_uint32_t(buf, 16, hardware_version);
  254. _mav_put_float(buf, 20, roll_min);
  255. _mav_put_float(buf, 24, roll_max);
  256. _mav_put_float(buf, 28, pitch_min);
  257. _mav_put_float(buf, 32, pitch_max);
  258. _mav_put_float(buf, 36, yaw_min);
  259. _mav_put_float(buf, 40, yaw_max);
  260. _mav_put_uint16_t(buf, 44, cap_flags);
  261. _mav_put_uint16_t(buf, 46, custom_cap_flags);
  262. _mav_put_uint8_t(buf, 144, gimbal_device_id);
  263. _mav_put_char_array(buf, 48, vendor_name, 32);
  264. _mav_put_char_array(buf, 80, model_name, 32);
  265. _mav_put_char_array(buf, 112, custom_name, 32);
  266. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  267. #else
  268. mavlink_gimbal_device_information_t packet;
  269. packet.uid = uid;
  270. packet.time_boot_ms = time_boot_ms;
  271. packet.firmware_version = firmware_version;
  272. packet.hardware_version = hardware_version;
  273. packet.roll_min = roll_min;
  274. packet.roll_max = roll_max;
  275. packet.pitch_min = pitch_min;
  276. packet.pitch_max = pitch_max;
  277. packet.yaw_min = yaw_min;
  278. packet.yaw_max = yaw_max;
  279. packet.cap_flags = cap_flags;
  280. packet.custom_cap_flags = custom_cap_flags;
  281. packet.gimbal_device_id = gimbal_device_id;
  282. mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
  283. mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
  284. mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
  285. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  286. #endif
  287. msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION;
  288. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  289. }
  290. /**
  291. * @brief Encode a gimbal_device_information struct
  292. *
  293. * @param system_id ID of this system
  294. * @param component_id ID of this component (e.g. 200 for IMU)
  295. * @param msg The MAVLink message to compress the data into
  296. * @param gimbal_device_information C-struct to read the message contents from
  297. */
  298. static inline uint16_t mavlink_msg_gimbal_device_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_device_information_t* gimbal_device_information)
  299. {
  300. return mavlink_msg_gimbal_device_information_pack(system_id, component_id, msg, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max, gimbal_device_information->gimbal_device_id);
  301. }
  302. /**
  303. * @brief Encode a gimbal_device_information struct on a channel
  304. *
  305. * @param system_id ID of this system
  306. * @param component_id ID of this component (e.g. 200 for IMU)
  307. * @param chan The MAVLink channel this message will be sent over
  308. * @param msg The MAVLink message to compress the data into
  309. * @param gimbal_device_information C-struct to read the message contents from
  310. */
  311. static inline uint16_t mavlink_msg_gimbal_device_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_device_information_t* gimbal_device_information)
  312. {
  313. return mavlink_msg_gimbal_device_information_pack_chan(system_id, component_id, chan, msg, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max, gimbal_device_information->gimbal_device_id);
  314. }
  315. /**
  316. * @brief Encode a gimbal_device_information struct with provided status structure
  317. *
  318. * @param system_id ID of this system
  319. * @param component_id ID of this component (e.g. 200 for IMU)
  320. * @param status MAVLink status structure
  321. * @param msg The MAVLink message to compress the data into
  322. * @param gimbal_device_information C-struct to read the message contents from
  323. */
  324. static inline uint16_t mavlink_msg_gimbal_device_information_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_gimbal_device_information_t* gimbal_device_information)
  325. {
  326. return mavlink_msg_gimbal_device_information_pack_status(system_id, component_id, _status, msg, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max, gimbal_device_information->gimbal_device_id);
  327. }
  328. /**
  329. * @brief Send a gimbal_device_information message
  330. * @param chan MAVLink channel to send the message
  331. *
  332. * @param time_boot_ms [ms] Timestamp (time since system boot).
  333. * @param vendor_name Name of the gimbal vendor.
  334. * @param model_name Name of the gimbal model.
  335. * @param custom_name Custom name of the gimbal given to it by the user.
  336. * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  337. * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  338. * @param uid UID of gimbal hardware (0 if unknown).
  339. * @param cap_flags Bitmap of gimbal capability flags.
  340. * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
  341. * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  342. * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  343. * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  344. * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  345. * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  346. * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  347. * @param gimbal_device_id This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0.
  348. */
  349. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  350. static inline void mavlink_msg_gimbal_device_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max, uint8_t gimbal_device_id)
  351. {
  352. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  353. char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
  354. _mav_put_uint64_t(buf, 0, uid);
  355. _mav_put_uint32_t(buf, 8, time_boot_ms);
  356. _mav_put_uint32_t(buf, 12, firmware_version);
  357. _mav_put_uint32_t(buf, 16, hardware_version);
  358. _mav_put_float(buf, 20, roll_min);
  359. _mav_put_float(buf, 24, roll_max);
  360. _mav_put_float(buf, 28, pitch_min);
  361. _mav_put_float(buf, 32, pitch_max);
  362. _mav_put_float(buf, 36, yaw_min);
  363. _mav_put_float(buf, 40, yaw_max);
  364. _mav_put_uint16_t(buf, 44, cap_flags);
  365. _mav_put_uint16_t(buf, 46, custom_cap_flags);
  366. _mav_put_uint8_t(buf, 144, gimbal_device_id);
  367. _mav_put_char_array(buf, 48, vendor_name, 32);
  368. _mav_put_char_array(buf, 80, model_name, 32);
  369. _mav_put_char_array(buf, 112, custom_name, 32);
  370. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  371. #else
  372. mavlink_gimbal_device_information_t packet;
  373. packet.uid = uid;
  374. packet.time_boot_ms = time_boot_ms;
  375. packet.firmware_version = firmware_version;
  376. packet.hardware_version = hardware_version;
  377. packet.roll_min = roll_min;
  378. packet.roll_max = roll_max;
  379. packet.pitch_min = pitch_min;
  380. packet.pitch_max = pitch_max;
  381. packet.yaw_min = yaw_min;
  382. packet.yaw_max = yaw_max;
  383. packet.cap_flags = cap_flags;
  384. packet.custom_cap_flags = custom_cap_flags;
  385. packet.gimbal_device_id = gimbal_device_id;
  386. mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
  387. mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
  388. mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
  389. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  390. #endif
  391. }
  392. /**
  393. * @brief Send a gimbal_device_information message
  394. * @param chan MAVLink channel to send the message
  395. * @param struct The MAVLink struct to serialize
  396. */
  397. static inline void mavlink_msg_gimbal_device_information_send_struct(mavlink_channel_t chan, const mavlink_gimbal_device_information_t* gimbal_device_information)
  398. {
  399. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  400. mavlink_msg_gimbal_device_information_send(chan, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max, gimbal_device_information->gimbal_device_id);
  401. #else
  402. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, (const char *)gimbal_device_information, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  403. #endif
  404. }
  405. #if MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  406. /*
  407. This variant of _send() can be used to save stack space by re-using
  408. memory from the receive buffer. The caller provides a
  409. mavlink_message_t which is the size of a full mavlink message. This
  410. is usually the receive buffer for the channel, and allows a reply to an
  411. incoming message with minimum stack space usage.
  412. */
  413. static inline void mavlink_msg_gimbal_device_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max, uint8_t gimbal_device_id)
  414. {
  415. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  416. char *buf = (char *)msgbuf;
  417. _mav_put_uint64_t(buf, 0, uid);
  418. _mav_put_uint32_t(buf, 8, time_boot_ms);
  419. _mav_put_uint32_t(buf, 12, firmware_version);
  420. _mav_put_uint32_t(buf, 16, hardware_version);
  421. _mav_put_float(buf, 20, roll_min);
  422. _mav_put_float(buf, 24, roll_max);
  423. _mav_put_float(buf, 28, pitch_min);
  424. _mav_put_float(buf, 32, pitch_max);
  425. _mav_put_float(buf, 36, yaw_min);
  426. _mav_put_float(buf, 40, yaw_max);
  427. _mav_put_uint16_t(buf, 44, cap_flags);
  428. _mav_put_uint16_t(buf, 46, custom_cap_flags);
  429. _mav_put_uint8_t(buf, 144, gimbal_device_id);
  430. _mav_put_char_array(buf, 48, vendor_name, 32);
  431. _mav_put_char_array(buf, 80, model_name, 32);
  432. _mav_put_char_array(buf, 112, custom_name, 32);
  433. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  434. #else
  435. mavlink_gimbal_device_information_t *packet = (mavlink_gimbal_device_information_t *)msgbuf;
  436. packet->uid = uid;
  437. packet->time_boot_ms = time_boot_ms;
  438. packet->firmware_version = firmware_version;
  439. packet->hardware_version = hardware_version;
  440. packet->roll_min = roll_min;
  441. packet->roll_max = roll_max;
  442. packet->pitch_min = pitch_min;
  443. packet->pitch_max = pitch_max;
  444. packet->yaw_min = yaw_min;
  445. packet->yaw_max = yaw_max;
  446. packet->cap_flags = cap_flags;
  447. packet->custom_cap_flags = custom_cap_flags;
  448. packet->gimbal_device_id = gimbal_device_id;
  449. mav_array_memcpy(packet->vendor_name, vendor_name, sizeof(char)*32);
  450. mav_array_memcpy(packet->model_name, model_name, sizeof(char)*32);
  451. mav_array_memcpy(packet->custom_name, custom_name, sizeof(char)*32);
  452. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
  453. #endif
  454. }
  455. #endif
  456. #endif
  457. // MESSAGE GIMBAL_DEVICE_INFORMATION UNPACKING
  458. /**
  459. * @brief Get field time_boot_ms from gimbal_device_information message
  460. *
  461. * @return [ms] Timestamp (time since system boot).
  462. */
  463. static inline uint32_t mavlink_msg_gimbal_device_information_get_time_boot_ms(const mavlink_message_t* msg)
  464. {
  465. return _MAV_RETURN_uint32_t(msg, 8);
  466. }
  467. /**
  468. * @brief Get field vendor_name from gimbal_device_information message
  469. *
  470. * @return Name of the gimbal vendor.
  471. */
  472. static inline uint16_t mavlink_msg_gimbal_device_information_get_vendor_name(const mavlink_message_t* msg, char *vendor_name)
  473. {
  474. return _MAV_RETURN_char_array(msg, vendor_name, 32, 48);
  475. }
  476. /**
  477. * @brief Get field model_name from gimbal_device_information message
  478. *
  479. * @return Name of the gimbal model.
  480. */
  481. static inline uint16_t mavlink_msg_gimbal_device_information_get_model_name(const mavlink_message_t* msg, char *model_name)
  482. {
  483. return _MAV_RETURN_char_array(msg, model_name, 32, 80);
  484. }
  485. /**
  486. * @brief Get field custom_name from gimbal_device_information message
  487. *
  488. * @return Custom name of the gimbal given to it by the user.
  489. */
  490. static inline uint16_t mavlink_msg_gimbal_device_information_get_custom_name(const mavlink_message_t* msg, char *custom_name)
  491. {
  492. return _MAV_RETURN_char_array(msg, custom_name, 32, 112);
  493. }
  494. /**
  495. * @brief Get field firmware_version from gimbal_device_information message
  496. *
  497. * @return Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  498. */
  499. static inline uint32_t mavlink_msg_gimbal_device_information_get_firmware_version(const mavlink_message_t* msg)
  500. {
  501. return _MAV_RETURN_uint32_t(msg, 12);
  502. }
  503. /**
  504. * @brief Get field hardware_version from gimbal_device_information message
  505. *
  506. * @return Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
  507. */
  508. static inline uint32_t mavlink_msg_gimbal_device_information_get_hardware_version(const mavlink_message_t* msg)
  509. {
  510. return _MAV_RETURN_uint32_t(msg, 16);
  511. }
  512. /**
  513. * @brief Get field uid from gimbal_device_information message
  514. *
  515. * @return UID of gimbal hardware (0 if unknown).
  516. */
  517. static inline uint64_t mavlink_msg_gimbal_device_information_get_uid(const mavlink_message_t* msg)
  518. {
  519. return _MAV_RETURN_uint64_t(msg, 0);
  520. }
  521. /**
  522. * @brief Get field cap_flags from gimbal_device_information message
  523. *
  524. * @return Bitmap of gimbal capability flags.
  525. */
  526. static inline uint16_t mavlink_msg_gimbal_device_information_get_cap_flags(const mavlink_message_t* msg)
  527. {
  528. return _MAV_RETURN_uint16_t(msg, 44);
  529. }
  530. /**
  531. * @brief Get field custom_cap_flags from gimbal_device_information message
  532. *
  533. * @return Bitmap for use for gimbal-specific capability flags.
  534. */
  535. static inline uint16_t mavlink_msg_gimbal_device_information_get_custom_cap_flags(const mavlink_message_t* msg)
  536. {
  537. return _MAV_RETURN_uint16_t(msg, 46);
  538. }
  539. /**
  540. * @brief Get field roll_min from gimbal_device_information message
  541. *
  542. * @return [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  543. */
  544. static inline float mavlink_msg_gimbal_device_information_get_roll_min(const mavlink_message_t* msg)
  545. {
  546. return _MAV_RETURN_float(msg, 20);
  547. }
  548. /**
  549. * @brief Get field roll_max from gimbal_device_information message
  550. *
  551. * @return [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.
  552. */
  553. static inline float mavlink_msg_gimbal_device_information_get_roll_max(const mavlink_message_t* msg)
  554. {
  555. return _MAV_RETURN_float(msg, 24);
  556. }
  557. /**
  558. * @brief Get field pitch_min from gimbal_device_information message
  559. *
  560. * @return [rad] Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  561. */
  562. static inline float mavlink_msg_gimbal_device_information_get_pitch_min(const mavlink_message_t* msg)
  563. {
  564. return _MAV_RETURN_float(msg, 28);
  565. }
  566. /**
  567. * @brief Get field pitch_max from gimbal_device_information message
  568. *
  569. * @return [rad] Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.
  570. */
  571. static inline float mavlink_msg_gimbal_device_information_get_pitch_max(const mavlink_message_t* msg)
  572. {
  573. return _MAV_RETURN_float(msg, 32);
  574. }
  575. /**
  576. * @brief Get field yaw_min from gimbal_device_information message
  577. *
  578. * @return [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  579. */
  580. static inline float mavlink_msg_gimbal_device_information_get_yaw_min(const mavlink_message_t* msg)
  581. {
  582. return _MAV_RETURN_float(msg, 36);
  583. }
  584. /**
  585. * @brief Get field yaw_max from gimbal_device_information message
  586. *
  587. * @return [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.
  588. */
  589. static inline float mavlink_msg_gimbal_device_information_get_yaw_max(const mavlink_message_t* msg)
  590. {
  591. return _MAV_RETURN_float(msg, 40);
  592. }
  593. /**
  594. * @brief Get field gimbal_device_id from gimbal_device_information message
  595. *
  596. * @return This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0.
  597. */
  598. static inline uint8_t mavlink_msg_gimbal_device_information_get_gimbal_device_id(const mavlink_message_t* msg)
  599. {
  600. return _MAV_RETURN_uint8_t(msg, 144);
  601. }
  602. /**
  603. * @brief Decode a gimbal_device_information message into a struct
  604. *
  605. * @param msg The message to decode
  606. * @param gimbal_device_information C-struct to decode the message contents into
  607. */
  608. static inline void mavlink_msg_gimbal_device_information_decode(const mavlink_message_t* msg, mavlink_gimbal_device_information_t* gimbal_device_information)
  609. {
  610. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  611. gimbal_device_information->uid = mavlink_msg_gimbal_device_information_get_uid(msg);
  612. gimbal_device_information->time_boot_ms = mavlink_msg_gimbal_device_information_get_time_boot_ms(msg);
  613. gimbal_device_information->firmware_version = mavlink_msg_gimbal_device_information_get_firmware_version(msg);
  614. gimbal_device_information->hardware_version = mavlink_msg_gimbal_device_information_get_hardware_version(msg);
  615. gimbal_device_information->roll_min = mavlink_msg_gimbal_device_information_get_roll_min(msg);
  616. gimbal_device_information->roll_max = mavlink_msg_gimbal_device_information_get_roll_max(msg);
  617. gimbal_device_information->pitch_min = mavlink_msg_gimbal_device_information_get_pitch_min(msg);
  618. gimbal_device_information->pitch_max = mavlink_msg_gimbal_device_information_get_pitch_max(msg);
  619. gimbal_device_information->yaw_min = mavlink_msg_gimbal_device_information_get_yaw_min(msg);
  620. gimbal_device_information->yaw_max = mavlink_msg_gimbal_device_information_get_yaw_max(msg);
  621. gimbal_device_information->cap_flags = mavlink_msg_gimbal_device_information_get_cap_flags(msg);
  622. gimbal_device_information->custom_cap_flags = mavlink_msg_gimbal_device_information_get_custom_cap_flags(msg);
  623. mavlink_msg_gimbal_device_information_get_vendor_name(msg, gimbal_device_information->vendor_name);
  624. mavlink_msg_gimbal_device_information_get_model_name(msg, gimbal_device_information->model_name);
  625. mavlink_msg_gimbal_device_information_get_custom_name(msg, gimbal_device_information->custom_name);
  626. gimbal_device_information->gimbal_device_id = mavlink_msg_gimbal_device_information_get_gimbal_device_id(msg);
  627. #else
  628. uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN;
  629. memset(gimbal_device_information, 0, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
  630. memcpy(gimbal_device_information, _MAV_PAYLOAD(msg), len);
  631. #endif
  632. }