mavlink_msg_fmub_status.h 32 KB

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