mavlink_msg_fmub_status.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. #pragma once
  2. // MESSAGE FMUB_STATUS PACKING
  3. #define MAVLINK_MSG_ID_FMUB_STATUS 53200
  4. typedef struct __mavlink_fmub_status_t {
  5. uint32_t timestamp; /*< [ms] timestamp from systemboot in ms.*/
  6. float roll; /*< [rad] euler roll angle.*/
  7. float pitch; /*< [rad] euler pitch angle.*/
  8. float yaw; /*< [rad] euler yaw angle.*/
  9. float vn; /*< [m/s] velocity in northward axis.*/
  10. float ve; /*< [m/s] velocity in eastward axis.*/
  11. float vd; /*< [m/s] velocity in downward axis.*/
  12. float ax; /*< [m/s/s] acceleration in x axis.*/
  13. float ay; /*< [m/s/s] acceleration in y axis.*/
  14. float az; /*< [m/s/s] acceleration in z axis.*/
  15. float gx; /*< [rad/s] angular velocity in x axis.*/
  16. float gy; /*< [rad/s] angular velocity in y axis.*/
  17. float gz; /*< [rad/s] angular velocity in z axis.*/
  18. int32_t lat; /*< [degE7] latitude.*/
  19. int32_t lon; /*< [degE7] longitude.*/
  20. float amsl; /*< [m] altitude above mean sea level.*/
  21. int32_t ins_status; /*< */
  22. int32_t ins_flag; /*< */
  23. uint16_t throttle; /*< throttle output.*/
  24. uint8_t flight_mode; /*< flight mode.*/
  25. uint8_t btake_status; /*< backup takeover status.*/
  26. } mavlink_fmub_status_t;
  27. #define MAVLINK_MSG_ID_FMUB_STATUS_LEN 76
  28. #define MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN 76
  29. #define MAVLINK_MSG_ID_53200_LEN 76
  30. #define MAVLINK_MSG_ID_53200_MIN_LEN 76
  31. #define MAVLINK_MSG_ID_FMUB_STATUS_CRC 45
  32. #define MAVLINK_MSG_ID_53200_CRC 45
  33. #if MAVLINK_COMMAND_24BIT
  34. #define MAVLINK_MESSAGE_INFO_FMUB_STATUS { \
  35. 53200, \
  36. "FMUB_STATUS", \
  37. 21, \
  38. { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fmub_status_t, timestamp) }, \
  39. { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fmub_status_t, roll) }, \
  40. { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_fmub_status_t, pitch) }, \
  41. { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_fmub_status_t, yaw) }, \
  42. { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_fmub_status_t, vn) }, \
  43. { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_fmub_status_t, ve) }, \
  44. { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_fmub_status_t, vd) }, \
  45. { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_fmub_status_t, ax) }, \
  46. { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_fmub_status_t, ay) }, \
  47. { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_fmub_status_t, az) }, \
  48. { "gx", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_fmub_status_t, gx) }, \
  49. { "gy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_fmub_status_t, gy) }, \
  50. { "gz", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_fmub_status_t, gz) }, \
  51. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 52, offsetof(mavlink_fmub_status_t, lat) }, \
  52. { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 56, offsetof(mavlink_fmub_status_t, lon) }, \
  53. { "amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_fmub_status_t, amsl) }, \
  54. { "ins_status", NULL, MAVLINK_TYPE_INT32_T, 0, 64, offsetof(mavlink_fmub_status_t, ins_status) }, \
  55. { "ins_flag", NULL, MAVLINK_TYPE_INT32_T, 0, 68, offsetof(mavlink_fmub_status_t, ins_flag) }, \
  56. { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 72, offsetof(mavlink_fmub_status_t, throttle) }, \
  57. { "flight_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 74, offsetof(mavlink_fmub_status_t, flight_mode) }, \
  58. { "btake_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 75, offsetof(mavlink_fmub_status_t, btake_status) }, \
  59. } \
  60. }
  61. #else
  62. #define MAVLINK_MESSAGE_INFO_FMUB_STATUS { \
  63. "FMUB_STATUS", \
  64. 21, \
  65. { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fmub_status_t, timestamp) }, \
  66. { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fmub_status_t, roll) }, \
  67. { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_fmub_status_t, pitch) }, \
  68. { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_fmub_status_t, yaw) }, \
  69. { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_fmub_status_t, vn) }, \
  70. { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_fmub_status_t, ve) }, \
  71. { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_fmub_status_t, vd) }, \
  72. { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_fmub_status_t, ax) }, \
  73. { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_fmub_status_t, ay) }, \
  74. { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_fmub_status_t, az) }, \
  75. { "gx", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_fmub_status_t, gx) }, \
  76. { "gy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_fmub_status_t, gy) }, \
  77. { "gz", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_fmub_status_t, gz) }, \
  78. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 52, offsetof(mavlink_fmub_status_t, lat) }, \
  79. { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 56, offsetof(mavlink_fmub_status_t, lon) }, \
  80. { "amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_fmub_status_t, amsl) }, \
  81. { "ins_status", NULL, MAVLINK_TYPE_INT32_T, 0, 64, offsetof(mavlink_fmub_status_t, ins_status) }, \
  82. { "ins_flag", NULL, MAVLINK_TYPE_INT32_T, 0, 68, offsetof(mavlink_fmub_status_t, ins_flag) }, \
  83. { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 72, offsetof(mavlink_fmub_status_t, throttle) }, \
  84. { "flight_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 74, offsetof(mavlink_fmub_status_t, flight_mode) }, \
  85. { "btake_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 75, offsetof(mavlink_fmub_status_t, btake_status) }, \
  86. } \
  87. }
  88. #endif
  89. /**
  90. * @brief Pack a fmub_status message
  91. * @param system_id ID of this system
  92. * @param component_id ID of this component (e.g. 200 for IMU)
  93. * @param msg The MAVLink message to compress the data into
  94. *
  95. * @param timestamp [ms] timestamp from systemboot in ms.
  96. * @param roll [rad] euler roll angle.
  97. * @param pitch [rad] euler pitch angle.
  98. * @param yaw [rad] euler yaw angle.
  99. * @param vn [m/s] velocity in northward axis.
  100. * @param ve [m/s] velocity in eastward axis.
  101. * @param vd [m/s] velocity in downward axis.
  102. * @param ax [m/s/s] acceleration in x axis.
  103. * @param ay [m/s/s] acceleration in y axis.
  104. * @param az [m/s/s] acceleration in z axis.
  105. * @param gx [rad/s] angular velocity in x axis.
  106. * @param gy [rad/s] angular velocity in y axis.
  107. * @param gz [rad/s] angular velocity in z axis.
  108. * @param lat [degE7] latitude.
  109. * @param lon [degE7] longitude.
  110. * @param amsl [m] altitude above mean sea level.
  111. * @param ins_status
  112. * @param ins_flag
  113. * @param throttle throttle output.
  114. * @param flight_mode flight mode.
  115. * @param btake_status backup takeover status.
  116. * @return length of the message in bytes (excluding serial stream start sign)
  117. */
  118. static inline uint16_t mavlink_msg_fmub_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  119. uint32_t timestamp, float roll, float pitch, float yaw, float vn, float ve, float vd, float ax, float ay, float az, float gx, float gy, float gz, int32_t lat, int32_t lon, float amsl, int32_t ins_status, int32_t ins_flag, uint16_t throttle, uint8_t flight_mode, uint8_t btake_status)
  120. {
  121. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  122. char buf[MAVLINK_MSG_ID_FMUB_STATUS_LEN];
  123. _mav_put_uint32_t(buf, 0, timestamp);
  124. _mav_put_float(buf, 4, roll);
  125. _mav_put_float(buf, 8, pitch);
  126. _mav_put_float(buf, 12, yaw);
  127. _mav_put_float(buf, 16, vn);
  128. _mav_put_float(buf, 20, ve);
  129. _mav_put_float(buf, 24, vd);
  130. _mav_put_float(buf, 28, ax);
  131. _mav_put_float(buf, 32, ay);
  132. _mav_put_float(buf, 36, az);
  133. _mav_put_float(buf, 40, gx);
  134. _mav_put_float(buf, 44, gy);
  135. _mav_put_float(buf, 48, gz);
  136. _mav_put_int32_t(buf, 52, lat);
  137. _mav_put_int32_t(buf, 56, lon);
  138. _mav_put_float(buf, 60, amsl);
  139. _mav_put_int32_t(buf, 64, ins_status);
  140. _mav_put_int32_t(buf, 68, ins_flag);
  141. _mav_put_uint16_t(buf, 72, throttle);
  142. _mav_put_uint8_t(buf, 74, flight_mode);
  143. _mav_put_uint8_t(buf, 75, btake_status);
  144. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  145. #else
  146. mavlink_fmub_status_t packet;
  147. packet.timestamp = timestamp;
  148. packet.roll = roll;
  149. packet.pitch = pitch;
  150. packet.yaw = yaw;
  151. packet.vn = vn;
  152. packet.ve = ve;
  153. packet.vd = vd;
  154. packet.ax = ax;
  155. packet.ay = ay;
  156. packet.az = az;
  157. packet.gx = gx;
  158. packet.gy = gy;
  159. packet.gz = gz;
  160. packet.lat = lat;
  161. packet.lon = lon;
  162. packet.amsl = amsl;
  163. packet.ins_status = ins_status;
  164. packet.ins_flag = ins_flag;
  165. packet.throttle = throttle;
  166. packet.flight_mode = flight_mode;
  167. packet.btake_status = btake_status;
  168. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  169. #endif
  170. msg->msgid = MAVLINK_MSG_ID_FMUB_STATUS;
  171. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  172. }
  173. /**
  174. * @brief Pack a fmub_status message
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param status MAVLink status structure
  178. * @param msg The MAVLink message to compress the data into
  179. *
  180. * @param timestamp [ms] timestamp from systemboot in ms.
  181. * @param roll [rad] euler roll angle.
  182. * @param pitch [rad] euler pitch angle.
  183. * @param yaw [rad] euler yaw angle.
  184. * @param vn [m/s] velocity in northward axis.
  185. * @param ve [m/s] velocity in eastward axis.
  186. * @param vd [m/s] velocity in downward axis.
  187. * @param ax [m/s/s] acceleration in x axis.
  188. * @param ay [m/s/s] acceleration in y axis.
  189. * @param az [m/s/s] acceleration in z axis.
  190. * @param gx [rad/s] angular velocity in x axis.
  191. * @param gy [rad/s] angular velocity in y axis.
  192. * @param gz [rad/s] angular velocity in z axis.
  193. * @param lat [degE7] latitude.
  194. * @param lon [degE7] longitude.
  195. * @param amsl [m] altitude above mean sea level.
  196. * @param ins_status
  197. * @param ins_flag
  198. * @param throttle throttle output.
  199. * @param flight_mode flight mode.
  200. * @param btake_status backup takeover status.
  201. * @return length of the message in bytes (excluding serial stream start sign)
  202. */
  203. static inline uint16_t mavlink_msg_fmub_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  204. uint32_t timestamp, float roll, float pitch, float yaw, float vn, float ve, float vd, float ax, float ay, float az, float gx, float gy, float gz, int32_t lat, int32_t lon, float amsl, int32_t ins_status, int32_t ins_flag, uint16_t throttle, uint8_t flight_mode, uint8_t btake_status)
  205. {
  206. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  207. char buf[MAVLINK_MSG_ID_FMUB_STATUS_LEN];
  208. _mav_put_uint32_t(buf, 0, timestamp);
  209. _mav_put_float(buf, 4, roll);
  210. _mav_put_float(buf, 8, pitch);
  211. _mav_put_float(buf, 12, yaw);
  212. _mav_put_float(buf, 16, vn);
  213. _mav_put_float(buf, 20, ve);
  214. _mav_put_float(buf, 24, vd);
  215. _mav_put_float(buf, 28, ax);
  216. _mav_put_float(buf, 32, ay);
  217. _mav_put_float(buf, 36, az);
  218. _mav_put_float(buf, 40, gx);
  219. _mav_put_float(buf, 44, gy);
  220. _mav_put_float(buf, 48, gz);
  221. _mav_put_int32_t(buf, 52, lat);
  222. _mav_put_int32_t(buf, 56, lon);
  223. _mav_put_float(buf, 60, amsl);
  224. _mav_put_int32_t(buf, 64, ins_status);
  225. _mav_put_int32_t(buf, 68, ins_flag);
  226. _mav_put_uint16_t(buf, 72, throttle);
  227. _mav_put_uint8_t(buf, 74, flight_mode);
  228. _mav_put_uint8_t(buf, 75, btake_status);
  229. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  230. #else
  231. mavlink_fmub_status_t packet;
  232. packet.timestamp = timestamp;
  233. packet.roll = roll;
  234. packet.pitch = pitch;
  235. packet.yaw = yaw;
  236. packet.vn = vn;
  237. packet.ve = ve;
  238. packet.vd = vd;
  239. packet.ax = ax;
  240. packet.ay = ay;
  241. packet.az = az;
  242. packet.gx = gx;
  243. packet.gy = gy;
  244. packet.gz = gz;
  245. packet.lat = lat;
  246. packet.lon = lon;
  247. packet.amsl = amsl;
  248. packet.ins_status = ins_status;
  249. packet.ins_flag = ins_flag;
  250. packet.throttle = throttle;
  251. packet.flight_mode = flight_mode;
  252. packet.btake_status = btake_status;
  253. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  254. #endif
  255. msg->msgid = MAVLINK_MSG_ID_FMUB_STATUS;
  256. #if MAVLINK_CRC_EXTRA
  257. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  258. #else
  259. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  260. #endif
  261. }
  262. /**
  263. * @brief Pack a fmub_status message on a channel
  264. * @param system_id ID of this system
  265. * @param component_id ID of this component (e.g. 200 for IMU)
  266. * @param chan The MAVLink channel this message will be sent over
  267. * @param msg The MAVLink message to compress the data into
  268. * @param timestamp [ms] timestamp from systemboot in ms.
  269. * @param roll [rad] euler roll angle.
  270. * @param pitch [rad] euler pitch angle.
  271. * @param yaw [rad] euler yaw angle.
  272. * @param vn [m/s] velocity in northward axis.
  273. * @param ve [m/s] velocity in eastward axis.
  274. * @param vd [m/s] velocity in downward axis.
  275. * @param ax [m/s/s] acceleration in x axis.
  276. * @param ay [m/s/s] acceleration in y axis.
  277. * @param az [m/s/s] acceleration in z axis.
  278. * @param gx [rad/s] angular velocity in x axis.
  279. * @param gy [rad/s] angular velocity in y axis.
  280. * @param gz [rad/s] angular velocity in z axis.
  281. * @param lat [degE7] latitude.
  282. * @param lon [degE7] longitude.
  283. * @param amsl [m] altitude above mean sea level.
  284. * @param ins_status
  285. * @param ins_flag
  286. * @param throttle throttle output.
  287. * @param flight_mode flight mode.
  288. * @param btake_status backup takeover status.
  289. * @return length of the message in bytes (excluding serial stream start sign)
  290. */
  291. static inline uint16_t mavlink_msg_fmub_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  292. mavlink_message_t* msg,
  293. uint32_t timestamp,float roll,float pitch,float yaw,float vn,float ve,float vd,float ax,float ay,float az,float gx,float gy,float gz,int32_t lat,int32_t lon,float amsl,int32_t ins_status,int32_t ins_flag,uint16_t throttle,uint8_t flight_mode,uint8_t btake_status)
  294. {
  295. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  296. char buf[MAVLINK_MSG_ID_FMUB_STATUS_LEN];
  297. _mav_put_uint32_t(buf, 0, timestamp);
  298. _mav_put_float(buf, 4, roll);
  299. _mav_put_float(buf, 8, pitch);
  300. _mav_put_float(buf, 12, yaw);
  301. _mav_put_float(buf, 16, vn);
  302. _mav_put_float(buf, 20, ve);
  303. _mav_put_float(buf, 24, vd);
  304. _mav_put_float(buf, 28, ax);
  305. _mav_put_float(buf, 32, ay);
  306. _mav_put_float(buf, 36, az);
  307. _mav_put_float(buf, 40, gx);
  308. _mav_put_float(buf, 44, gy);
  309. _mav_put_float(buf, 48, gz);
  310. _mav_put_int32_t(buf, 52, lat);
  311. _mav_put_int32_t(buf, 56, lon);
  312. _mav_put_float(buf, 60, amsl);
  313. _mav_put_int32_t(buf, 64, ins_status);
  314. _mav_put_int32_t(buf, 68, ins_flag);
  315. _mav_put_uint16_t(buf, 72, throttle);
  316. _mav_put_uint8_t(buf, 74, flight_mode);
  317. _mav_put_uint8_t(buf, 75, btake_status);
  318. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  319. #else
  320. mavlink_fmub_status_t packet;
  321. packet.timestamp = timestamp;
  322. packet.roll = roll;
  323. packet.pitch = pitch;
  324. packet.yaw = yaw;
  325. packet.vn = vn;
  326. packet.ve = ve;
  327. packet.vd = vd;
  328. packet.ax = ax;
  329. packet.ay = ay;
  330. packet.az = az;
  331. packet.gx = gx;
  332. packet.gy = gy;
  333. packet.gz = gz;
  334. packet.lat = lat;
  335. packet.lon = lon;
  336. packet.amsl = amsl;
  337. packet.ins_status = ins_status;
  338. packet.ins_flag = ins_flag;
  339. packet.throttle = throttle;
  340. packet.flight_mode = flight_mode;
  341. packet.btake_status = btake_status;
  342. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  343. #endif
  344. msg->msgid = MAVLINK_MSG_ID_FMUB_STATUS;
  345. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  346. }
  347. /**
  348. * @brief Encode a fmub_status struct
  349. *
  350. * @param system_id ID of this system
  351. * @param component_id ID of this component (e.g. 200 for IMU)
  352. * @param msg The MAVLink message to compress the data into
  353. * @param fmub_status C-struct to read the message contents from
  354. */
  355. static inline uint16_t mavlink_msg_fmub_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fmub_status_t* fmub_status)
  356. {
  357. return mavlink_msg_fmub_status_pack(system_id, component_id, msg, fmub_status->timestamp, fmub_status->roll, fmub_status->pitch, fmub_status->yaw, fmub_status->vn, fmub_status->ve, fmub_status->vd, fmub_status->ax, fmub_status->ay, fmub_status->az, fmub_status->gx, fmub_status->gy, fmub_status->gz, fmub_status->lat, fmub_status->lon, fmub_status->amsl, fmub_status->ins_status, fmub_status->ins_flag, fmub_status->throttle, fmub_status->flight_mode, fmub_status->btake_status);
  358. }
  359. /**
  360. * @brief Encode a fmub_status struct on a channel
  361. *
  362. * @param system_id ID of this system
  363. * @param component_id ID of this component (e.g. 200 for IMU)
  364. * @param chan The MAVLink channel this message will be sent over
  365. * @param msg The MAVLink message to compress the data into
  366. * @param fmub_status C-struct to read the message contents from
  367. */
  368. static inline uint16_t mavlink_msg_fmub_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fmub_status_t* fmub_status)
  369. {
  370. return mavlink_msg_fmub_status_pack_chan(system_id, component_id, chan, msg, fmub_status->timestamp, fmub_status->roll, fmub_status->pitch, fmub_status->yaw, fmub_status->vn, fmub_status->ve, fmub_status->vd, fmub_status->ax, fmub_status->ay, fmub_status->az, fmub_status->gx, fmub_status->gy, fmub_status->gz, fmub_status->lat, fmub_status->lon, fmub_status->amsl, fmub_status->ins_status, fmub_status->ins_flag, fmub_status->throttle, fmub_status->flight_mode, fmub_status->btake_status);
  371. }
  372. /**
  373. * @brief Encode a fmub_status struct with provided status structure
  374. *
  375. * @param system_id ID of this system
  376. * @param component_id ID of this component (e.g. 200 for IMU)
  377. * @param status MAVLink status structure
  378. * @param msg The MAVLink message to compress the data into
  379. * @param fmub_status C-struct to read the message contents from
  380. */
  381. static inline uint16_t mavlink_msg_fmub_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_fmub_status_t* fmub_status)
  382. {
  383. return mavlink_msg_fmub_status_pack_status(system_id, component_id, _status, msg, fmub_status->timestamp, fmub_status->roll, fmub_status->pitch, fmub_status->yaw, fmub_status->vn, fmub_status->ve, fmub_status->vd, fmub_status->ax, fmub_status->ay, fmub_status->az, fmub_status->gx, fmub_status->gy, fmub_status->gz, fmub_status->lat, fmub_status->lon, fmub_status->amsl, fmub_status->ins_status, fmub_status->ins_flag, fmub_status->throttle, fmub_status->flight_mode, fmub_status->btake_status);
  384. }
  385. /**
  386. * @brief Send a fmub_status message
  387. * @param chan MAVLink channel to send the message
  388. *
  389. * @param timestamp [ms] timestamp from systemboot in ms.
  390. * @param roll [rad] euler roll angle.
  391. * @param pitch [rad] euler pitch angle.
  392. * @param yaw [rad] euler yaw angle.
  393. * @param vn [m/s] velocity in northward axis.
  394. * @param ve [m/s] velocity in eastward axis.
  395. * @param vd [m/s] velocity in downward axis.
  396. * @param ax [m/s/s] acceleration in x axis.
  397. * @param ay [m/s/s] acceleration in y axis.
  398. * @param az [m/s/s] acceleration in z axis.
  399. * @param gx [rad/s] angular velocity in x axis.
  400. * @param gy [rad/s] angular velocity in y axis.
  401. * @param gz [rad/s] angular velocity in z axis.
  402. * @param lat [degE7] latitude.
  403. * @param lon [degE7] longitude.
  404. * @param amsl [m] altitude above mean sea level.
  405. * @param ins_status
  406. * @param ins_flag
  407. * @param throttle throttle output.
  408. * @param flight_mode flight mode.
  409. * @param btake_status backup takeover status.
  410. */
  411. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  412. static inline void mavlink_msg_fmub_status_send(mavlink_channel_t chan, uint32_t timestamp, float roll, float pitch, float yaw, float vn, float ve, float vd, float ax, float ay, float az, float gx, float gy, float gz, int32_t lat, int32_t lon, float amsl, int32_t ins_status, int32_t ins_flag, uint16_t throttle, uint8_t flight_mode, uint8_t btake_status)
  413. {
  414. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  415. char buf[MAVLINK_MSG_ID_FMUB_STATUS_LEN];
  416. _mav_put_uint32_t(buf, 0, timestamp);
  417. _mav_put_float(buf, 4, roll);
  418. _mav_put_float(buf, 8, pitch);
  419. _mav_put_float(buf, 12, yaw);
  420. _mav_put_float(buf, 16, vn);
  421. _mav_put_float(buf, 20, ve);
  422. _mav_put_float(buf, 24, vd);
  423. _mav_put_float(buf, 28, ax);
  424. _mav_put_float(buf, 32, ay);
  425. _mav_put_float(buf, 36, az);
  426. _mav_put_float(buf, 40, gx);
  427. _mav_put_float(buf, 44, gy);
  428. _mav_put_float(buf, 48, gz);
  429. _mav_put_int32_t(buf, 52, lat);
  430. _mav_put_int32_t(buf, 56, lon);
  431. _mav_put_float(buf, 60, amsl);
  432. _mav_put_int32_t(buf, 64, ins_status);
  433. _mav_put_int32_t(buf, 68, ins_flag);
  434. _mav_put_uint16_t(buf, 72, throttle);
  435. _mav_put_uint8_t(buf, 74, flight_mode);
  436. _mav_put_uint8_t(buf, 75, btake_status);
  437. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FMUB_STATUS, buf, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  438. #else
  439. mavlink_fmub_status_t packet;
  440. packet.timestamp = timestamp;
  441. packet.roll = roll;
  442. packet.pitch = pitch;
  443. packet.yaw = yaw;
  444. packet.vn = vn;
  445. packet.ve = ve;
  446. packet.vd = vd;
  447. packet.ax = ax;
  448. packet.ay = ay;
  449. packet.az = az;
  450. packet.gx = gx;
  451. packet.gy = gy;
  452. packet.gz = gz;
  453. packet.lat = lat;
  454. packet.lon = lon;
  455. packet.amsl = amsl;
  456. packet.ins_status = ins_status;
  457. packet.ins_flag = ins_flag;
  458. packet.throttle = throttle;
  459. packet.flight_mode = flight_mode;
  460. packet.btake_status = btake_status;
  461. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FMUB_STATUS, (const char *)&packet, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  462. #endif
  463. }
  464. /**
  465. * @brief Send a fmub_status message
  466. * @param chan MAVLink channel to send the message
  467. * @param struct The MAVLink struct to serialize
  468. */
  469. static inline void mavlink_msg_fmub_status_send_struct(mavlink_channel_t chan, const mavlink_fmub_status_t* fmub_status)
  470. {
  471. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  472. mavlink_msg_fmub_status_send(chan, fmub_status->timestamp, fmub_status->roll, fmub_status->pitch, fmub_status->yaw, fmub_status->vn, fmub_status->ve, fmub_status->vd, fmub_status->ax, fmub_status->ay, fmub_status->az, fmub_status->gx, fmub_status->gy, fmub_status->gz, fmub_status->lat, fmub_status->lon, fmub_status->amsl, fmub_status->ins_status, fmub_status->ins_flag, fmub_status->throttle, fmub_status->flight_mode, fmub_status->btake_status);
  473. #else
  474. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FMUB_STATUS, (const char *)fmub_status, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  475. #endif
  476. }
  477. #if MAVLINK_MSG_ID_FMUB_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  478. /*
  479. This variant of _send() can be used to save stack space by reusing
  480. memory from the receive buffer. The caller provides a
  481. mavlink_message_t which is the size of a full mavlink message. This
  482. is usually the receive buffer for the channel, and allows a reply to an
  483. incoming message with minimum stack space usage.
  484. */
  485. static inline void mavlink_msg_fmub_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t timestamp, float roll, float pitch, float yaw, float vn, float ve, float vd, float ax, float ay, float az, float gx, float gy, float gz, int32_t lat, int32_t lon, float amsl, int32_t ins_status, int32_t ins_flag, uint16_t throttle, uint8_t flight_mode, uint8_t btake_status)
  486. {
  487. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  488. char *buf = (char *)msgbuf;
  489. _mav_put_uint32_t(buf, 0, timestamp);
  490. _mav_put_float(buf, 4, roll);
  491. _mav_put_float(buf, 8, pitch);
  492. _mav_put_float(buf, 12, yaw);
  493. _mav_put_float(buf, 16, vn);
  494. _mav_put_float(buf, 20, ve);
  495. _mav_put_float(buf, 24, vd);
  496. _mav_put_float(buf, 28, ax);
  497. _mav_put_float(buf, 32, ay);
  498. _mav_put_float(buf, 36, az);
  499. _mav_put_float(buf, 40, gx);
  500. _mav_put_float(buf, 44, gy);
  501. _mav_put_float(buf, 48, gz);
  502. _mav_put_int32_t(buf, 52, lat);
  503. _mav_put_int32_t(buf, 56, lon);
  504. _mav_put_float(buf, 60, amsl);
  505. _mav_put_int32_t(buf, 64, ins_status);
  506. _mav_put_int32_t(buf, 68, ins_flag);
  507. _mav_put_uint16_t(buf, 72, throttle);
  508. _mav_put_uint8_t(buf, 74, flight_mode);
  509. _mav_put_uint8_t(buf, 75, btake_status);
  510. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FMUB_STATUS, buf, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  511. #else
  512. mavlink_fmub_status_t *packet = (mavlink_fmub_status_t *)msgbuf;
  513. packet->timestamp = timestamp;
  514. packet->roll = roll;
  515. packet->pitch = pitch;
  516. packet->yaw = yaw;
  517. packet->vn = vn;
  518. packet->ve = ve;
  519. packet->vd = vd;
  520. packet->ax = ax;
  521. packet->ay = ay;
  522. packet->az = az;
  523. packet->gx = gx;
  524. packet->gy = gy;
  525. packet->gz = gz;
  526. packet->lat = lat;
  527. packet->lon = lon;
  528. packet->amsl = amsl;
  529. packet->ins_status = ins_status;
  530. packet->ins_flag = ins_flag;
  531. packet->throttle = throttle;
  532. packet->flight_mode = flight_mode;
  533. packet->btake_status = btake_status;
  534. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FMUB_STATUS, (const char *)packet, MAVLINK_MSG_ID_FMUB_STATUS_MIN_LEN, MAVLINK_MSG_ID_FMUB_STATUS_LEN, MAVLINK_MSG_ID_FMUB_STATUS_CRC);
  535. #endif
  536. }
  537. #endif
  538. #endif
  539. // MESSAGE FMUB_STATUS UNPACKING
  540. /**
  541. * @brief Get field timestamp from fmub_status message
  542. *
  543. * @return [ms] timestamp from systemboot in ms.
  544. */
  545. static inline uint32_t mavlink_msg_fmub_status_get_timestamp(const mavlink_message_t* msg)
  546. {
  547. return _MAV_RETURN_uint32_t(msg, 0);
  548. }
  549. /**
  550. * @brief Get field roll from fmub_status message
  551. *
  552. * @return [rad] euler roll angle.
  553. */
  554. static inline float mavlink_msg_fmub_status_get_roll(const mavlink_message_t* msg)
  555. {
  556. return _MAV_RETURN_float(msg, 4);
  557. }
  558. /**
  559. * @brief Get field pitch from fmub_status message
  560. *
  561. * @return [rad] euler pitch angle.
  562. */
  563. static inline float mavlink_msg_fmub_status_get_pitch(const mavlink_message_t* msg)
  564. {
  565. return _MAV_RETURN_float(msg, 8);
  566. }
  567. /**
  568. * @brief Get field yaw from fmub_status message
  569. *
  570. * @return [rad] euler yaw angle.
  571. */
  572. static inline float mavlink_msg_fmub_status_get_yaw(const mavlink_message_t* msg)
  573. {
  574. return _MAV_RETURN_float(msg, 12);
  575. }
  576. /**
  577. * @brief Get field vn from fmub_status message
  578. *
  579. * @return [m/s] velocity in northward axis.
  580. */
  581. static inline float mavlink_msg_fmub_status_get_vn(const mavlink_message_t* msg)
  582. {
  583. return _MAV_RETURN_float(msg, 16);
  584. }
  585. /**
  586. * @brief Get field ve from fmub_status message
  587. *
  588. * @return [m/s] velocity in eastward axis.
  589. */
  590. static inline float mavlink_msg_fmub_status_get_ve(const mavlink_message_t* msg)
  591. {
  592. return _MAV_RETURN_float(msg, 20);
  593. }
  594. /**
  595. * @brief Get field vd from fmub_status message
  596. *
  597. * @return [m/s] velocity in downward axis.
  598. */
  599. static inline float mavlink_msg_fmub_status_get_vd(const mavlink_message_t* msg)
  600. {
  601. return _MAV_RETURN_float(msg, 24);
  602. }
  603. /**
  604. * @brief Get field ax from fmub_status message
  605. *
  606. * @return [m/s/s] acceleration in x axis.
  607. */
  608. static inline float mavlink_msg_fmub_status_get_ax(const mavlink_message_t* msg)
  609. {
  610. return _MAV_RETURN_float(msg, 28);
  611. }
  612. /**
  613. * @brief Get field ay from fmub_status message
  614. *
  615. * @return [m/s/s] acceleration in y axis.
  616. */
  617. static inline float mavlink_msg_fmub_status_get_ay(const mavlink_message_t* msg)
  618. {
  619. return _MAV_RETURN_float(msg, 32);
  620. }
  621. /**
  622. * @brief Get field az from fmub_status message
  623. *
  624. * @return [m/s/s] acceleration in z axis.
  625. */
  626. static inline float mavlink_msg_fmub_status_get_az(const mavlink_message_t* msg)
  627. {
  628. return _MAV_RETURN_float(msg, 36);
  629. }
  630. /**
  631. * @brief Get field gx from fmub_status message
  632. *
  633. * @return [rad/s] angular velocity in x axis.
  634. */
  635. static inline float mavlink_msg_fmub_status_get_gx(const mavlink_message_t* msg)
  636. {
  637. return _MAV_RETURN_float(msg, 40);
  638. }
  639. /**
  640. * @brief Get field gy from fmub_status message
  641. *
  642. * @return [rad/s] angular velocity in y axis.
  643. */
  644. static inline float mavlink_msg_fmub_status_get_gy(const mavlink_message_t* msg)
  645. {
  646. return _MAV_RETURN_float(msg, 44);
  647. }
  648. /**
  649. * @brief Get field gz from fmub_status message
  650. *
  651. * @return [rad/s] angular velocity in z axis.
  652. */
  653. static inline float mavlink_msg_fmub_status_get_gz(const mavlink_message_t* msg)
  654. {
  655. return _MAV_RETURN_float(msg, 48);
  656. }
  657. /**
  658. * @brief Get field lat from fmub_status message
  659. *
  660. * @return [degE7] latitude.
  661. */
  662. static inline int32_t mavlink_msg_fmub_status_get_lat(const mavlink_message_t* msg)
  663. {
  664. return _MAV_RETURN_int32_t(msg, 52);
  665. }
  666. /**
  667. * @brief Get field lon from fmub_status message
  668. *
  669. * @return [degE7] longitude.
  670. */
  671. static inline int32_t mavlink_msg_fmub_status_get_lon(const mavlink_message_t* msg)
  672. {
  673. return _MAV_RETURN_int32_t(msg, 56);
  674. }
  675. /**
  676. * @brief Get field amsl from fmub_status message
  677. *
  678. * @return [m] altitude above mean sea level.
  679. */
  680. static inline float mavlink_msg_fmub_status_get_amsl(const mavlink_message_t* msg)
  681. {
  682. return _MAV_RETURN_float(msg, 60);
  683. }
  684. /**
  685. * @brief Get field ins_status from fmub_status message
  686. *
  687. * @return
  688. */
  689. static inline int32_t mavlink_msg_fmub_status_get_ins_status(const mavlink_message_t* msg)
  690. {
  691. return _MAV_RETURN_int32_t(msg, 64);
  692. }
  693. /**
  694. * @brief Get field ins_flag from fmub_status message
  695. *
  696. * @return
  697. */
  698. static inline int32_t mavlink_msg_fmub_status_get_ins_flag(const mavlink_message_t* msg)
  699. {
  700. return _MAV_RETURN_int32_t(msg, 68);
  701. }
  702. /**
  703. * @brief Get field throttle from fmub_status message
  704. *
  705. * @return throttle output.
  706. */
  707. static inline uint16_t mavlink_msg_fmub_status_get_throttle(const mavlink_message_t* msg)
  708. {
  709. return _MAV_RETURN_uint16_t(msg, 72);
  710. }
  711. /**
  712. * @brief Get field flight_mode from fmub_status message
  713. *
  714. * @return flight mode.
  715. */
  716. static inline uint8_t mavlink_msg_fmub_status_get_flight_mode(const mavlink_message_t* msg)
  717. {
  718. return _MAV_RETURN_uint8_t(msg, 74);
  719. }
  720. /**
  721. * @brief Get field btake_status from fmub_status message
  722. *
  723. * @return backup takeover status.
  724. */
  725. static inline uint8_t mavlink_msg_fmub_status_get_btake_status(const mavlink_message_t* msg)
  726. {
  727. return _MAV_RETURN_uint8_t(msg, 75);
  728. }
  729. /**
  730. * @brief Decode a fmub_status message into a struct
  731. *
  732. * @param msg The message to decode
  733. * @param fmub_status C-struct to decode the message contents into
  734. */
  735. static inline void mavlink_msg_fmub_status_decode(const mavlink_message_t* msg, mavlink_fmub_status_t* fmub_status)
  736. {
  737. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  738. fmub_status->timestamp = mavlink_msg_fmub_status_get_timestamp(msg);
  739. fmub_status->roll = mavlink_msg_fmub_status_get_roll(msg);
  740. fmub_status->pitch = mavlink_msg_fmub_status_get_pitch(msg);
  741. fmub_status->yaw = mavlink_msg_fmub_status_get_yaw(msg);
  742. fmub_status->vn = mavlink_msg_fmub_status_get_vn(msg);
  743. fmub_status->ve = mavlink_msg_fmub_status_get_ve(msg);
  744. fmub_status->vd = mavlink_msg_fmub_status_get_vd(msg);
  745. fmub_status->ax = mavlink_msg_fmub_status_get_ax(msg);
  746. fmub_status->ay = mavlink_msg_fmub_status_get_ay(msg);
  747. fmub_status->az = mavlink_msg_fmub_status_get_az(msg);
  748. fmub_status->gx = mavlink_msg_fmub_status_get_gx(msg);
  749. fmub_status->gy = mavlink_msg_fmub_status_get_gy(msg);
  750. fmub_status->gz = mavlink_msg_fmub_status_get_gz(msg);
  751. fmub_status->lat = mavlink_msg_fmub_status_get_lat(msg);
  752. fmub_status->lon = mavlink_msg_fmub_status_get_lon(msg);
  753. fmub_status->amsl = mavlink_msg_fmub_status_get_amsl(msg);
  754. fmub_status->ins_status = mavlink_msg_fmub_status_get_ins_status(msg);
  755. fmub_status->ins_flag = mavlink_msg_fmub_status_get_ins_flag(msg);
  756. fmub_status->throttle = mavlink_msg_fmub_status_get_throttle(msg);
  757. fmub_status->flight_mode = mavlink_msg_fmub_status_get_flight_mode(msg);
  758. fmub_status->btake_status = mavlink_msg_fmub_status_get_btake_status(msg);
  759. #else
  760. uint8_t len = msg->len < MAVLINK_MSG_ID_FMUB_STATUS_LEN? msg->len : MAVLINK_MSG_ID_FMUB_STATUS_LEN;
  761. memset(fmub_status, 0, MAVLINK_MSG_ID_FMUB_STATUS_LEN);
  762. memcpy(fmub_status, _MAV_PAYLOAD(msg), len);
  763. #endif
  764. }