You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

438 lines
18 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE SLUGS_NAVIGATION PACKING
  3. #define MAVLINK_MSG_ID_SLUGS_NAVIGATION 176
  4. MAVPACKED(
  5. typedef struct __mavlink_slugs_navigation_t {
  6. float u_m; /*< [m/s] Measured Airspeed prior to the nav filter*/
  7. float phi_c; /*< Commanded Roll*/
  8. float theta_c; /*< Commanded Pitch*/
  9. float psiDot_c; /*< Commanded Turn rate*/
  10. float ay_body; /*< Y component of the body acceleration*/
  11. float totalDist; /*< Total Distance to Run on this leg of Navigation*/
  12. float dist2Go; /*< Remaining distance to Run on this leg of Navigation*/
  13. uint16_t h_c; /*< [dm] Commanded altitude (MSL)*/
  14. uint8_t fromWP; /*< Origin WP*/
  15. uint8_t toWP; /*< Destination WP*/
  16. }) mavlink_slugs_navigation_t;
  17. #define MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN 32
  18. #define MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN 32
  19. #define MAVLINK_MSG_ID_176_LEN 32
  20. #define MAVLINK_MSG_ID_176_MIN_LEN 32
  21. #define MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC 228
  22. #define MAVLINK_MSG_ID_176_CRC 228
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_SLUGS_NAVIGATION { \
  25. 176, \
  26. "SLUGS_NAVIGATION", \
  27. 10, \
  28. { { "u_m", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_navigation_t, u_m) }, \
  29. { "phi_c", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_navigation_t, phi_c) }, \
  30. { "theta_c", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_slugs_navigation_t, theta_c) }, \
  31. { "psiDot_c", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_slugs_navigation_t, psiDot_c) }, \
  32. { "ay_body", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_slugs_navigation_t, ay_body) }, \
  33. { "totalDist", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_slugs_navigation_t, totalDist) }, \
  34. { "dist2Go", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_slugs_navigation_t, dist2Go) }, \
  35. { "fromWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_slugs_navigation_t, fromWP) }, \
  36. { "toWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_slugs_navigation_t, toWP) }, \
  37. { "h_c", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_slugs_navigation_t, h_c) }, \
  38. } \
  39. }
  40. #else
  41. #define MAVLINK_MESSAGE_INFO_SLUGS_NAVIGATION { \
  42. "SLUGS_NAVIGATION", \
  43. 10, \
  44. { { "u_m", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_navigation_t, u_m) }, \
  45. { "phi_c", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_navigation_t, phi_c) }, \
  46. { "theta_c", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_slugs_navigation_t, theta_c) }, \
  47. { "psiDot_c", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_slugs_navigation_t, psiDot_c) }, \
  48. { "ay_body", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_slugs_navigation_t, ay_body) }, \
  49. { "totalDist", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_slugs_navigation_t, totalDist) }, \
  50. { "dist2Go", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_slugs_navigation_t, dist2Go) }, \
  51. { "fromWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_slugs_navigation_t, fromWP) }, \
  52. { "toWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_slugs_navigation_t, toWP) }, \
  53. { "h_c", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_slugs_navigation_t, h_c) }, \
  54. } \
  55. }
  56. #endif
  57. /**
  58. * @brief Pack a slugs_navigation message
  59. * @param system_id ID of this system
  60. * @param component_id ID of this component (e.g. 200 for IMU)
  61. * @param msg The MAVLink message to compress the data into
  62. *
  63. * @param u_m [m/s] Measured Airspeed prior to the nav filter
  64. * @param phi_c Commanded Roll
  65. * @param theta_c Commanded Pitch
  66. * @param psiDot_c Commanded Turn rate
  67. * @param ay_body Y component of the body acceleration
  68. * @param totalDist Total Distance to Run on this leg of Navigation
  69. * @param dist2Go Remaining distance to Run on this leg of Navigation
  70. * @param fromWP Origin WP
  71. * @param toWP Destination WP
  72. * @param h_c [dm] Commanded altitude (MSL)
  73. * @return length of the message in bytes (excluding serial stream start sign)
  74. */
  75. static inline uint16_t mavlink_msg_slugs_navigation_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  76. float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP, uint16_t h_c)
  77. {
  78. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  79. char buf[MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN];
  80. _mav_put_float(buf, 0, u_m);
  81. _mav_put_float(buf, 4, phi_c);
  82. _mav_put_float(buf, 8, theta_c);
  83. _mav_put_float(buf, 12, psiDot_c);
  84. _mav_put_float(buf, 16, ay_body);
  85. _mav_put_float(buf, 20, totalDist);
  86. _mav_put_float(buf, 24, dist2Go);
  87. _mav_put_uint16_t(buf, 28, h_c);
  88. _mav_put_uint8_t(buf, 30, fromWP);
  89. _mav_put_uint8_t(buf, 31, toWP);
  90. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
  91. #else
  92. mavlink_slugs_navigation_t packet;
  93. packet.u_m = u_m;
  94. packet.phi_c = phi_c;
  95. packet.theta_c = theta_c;
  96. packet.psiDot_c = psiDot_c;
  97. packet.ay_body = ay_body;
  98. packet.totalDist = totalDist;
  99. packet.dist2Go = dist2Go;
  100. packet.h_c = h_c;
  101. packet.fromWP = fromWP;
  102. packet.toWP = toWP;
  103. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
  104. #endif
  105. msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
  106. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  107. }
  108. /**
  109. * @brief Pack a slugs_navigation message on a channel
  110. * @param system_id ID of this system
  111. * @param component_id ID of this component (e.g. 200 for IMU)
  112. * @param chan The MAVLink channel this message will be sent over
  113. * @param msg The MAVLink message to compress the data into
  114. * @param u_m [m/s] Measured Airspeed prior to the nav filter
  115. * @param phi_c Commanded Roll
  116. * @param theta_c Commanded Pitch
  117. * @param psiDot_c Commanded Turn rate
  118. * @param ay_body Y component of the body acceleration
  119. * @param totalDist Total Distance to Run on this leg of Navigation
  120. * @param dist2Go Remaining distance to Run on this leg of Navigation
  121. * @param fromWP Origin WP
  122. * @param toWP Destination WP
  123. * @param h_c [dm] Commanded altitude (MSL)
  124. * @return length of the message in bytes (excluding serial stream start sign)
  125. */
  126. static inline uint16_t mavlink_msg_slugs_navigation_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  127. mavlink_message_t* msg,
  128. float u_m,float phi_c,float theta_c,float psiDot_c,float ay_body,float totalDist,float dist2Go,uint8_t fromWP,uint8_t toWP,uint16_t h_c)
  129. {
  130. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  131. char buf[MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN];
  132. _mav_put_float(buf, 0, u_m);
  133. _mav_put_float(buf, 4, phi_c);
  134. _mav_put_float(buf, 8, theta_c);
  135. _mav_put_float(buf, 12, psiDot_c);
  136. _mav_put_float(buf, 16, ay_body);
  137. _mav_put_float(buf, 20, totalDist);
  138. _mav_put_float(buf, 24, dist2Go);
  139. _mav_put_uint16_t(buf, 28, h_c);
  140. _mav_put_uint8_t(buf, 30, fromWP);
  141. _mav_put_uint8_t(buf, 31, toWP);
  142. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
  143. #else
  144. mavlink_slugs_navigation_t packet;
  145. packet.u_m = u_m;
  146. packet.phi_c = phi_c;
  147. packet.theta_c = theta_c;
  148. packet.psiDot_c = psiDot_c;
  149. packet.ay_body = ay_body;
  150. packet.totalDist = totalDist;
  151. packet.dist2Go = dist2Go;
  152. packet.h_c = h_c;
  153. packet.fromWP = fromWP;
  154. packet.toWP = toWP;
  155. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
  156. #endif
  157. msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
  158. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  159. }
  160. /**
  161. * @brief Encode a slugs_navigation struct
  162. *
  163. * @param system_id ID of this system
  164. * @param component_id ID of this component (e.g. 200 for IMU)
  165. * @param msg The MAVLink message to compress the data into
  166. * @param slugs_navigation C-struct to read the message contents from
  167. */
  168. static inline uint16_t mavlink_msg_slugs_navigation_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_navigation_t* slugs_navigation)
  169. {
  170. return mavlink_msg_slugs_navigation_pack(system_id, component_id, msg, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP, slugs_navigation->h_c);
  171. }
  172. /**
  173. * @brief Encode a slugs_navigation struct on a channel
  174. *
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param chan The MAVLink channel this message will be sent over
  178. * @param msg The MAVLink message to compress the data into
  179. * @param slugs_navigation C-struct to read the message contents from
  180. */
  181. static inline uint16_t mavlink_msg_slugs_navigation_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_slugs_navigation_t* slugs_navigation)
  182. {
  183. return mavlink_msg_slugs_navigation_pack_chan(system_id, component_id, chan, msg, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP, slugs_navigation->h_c);
  184. }
  185. /**
  186. * @brief Send a slugs_navigation message
  187. * @param chan MAVLink channel to send the message
  188. *
  189. * @param u_m [m/s] Measured Airspeed prior to the nav filter
  190. * @param phi_c Commanded Roll
  191. * @param theta_c Commanded Pitch
  192. * @param psiDot_c Commanded Turn rate
  193. * @param ay_body Y component of the body acceleration
  194. * @param totalDist Total Distance to Run on this leg of Navigation
  195. * @param dist2Go Remaining distance to Run on this leg of Navigation
  196. * @param fromWP Origin WP
  197. * @param toWP Destination WP
  198. * @param h_c [dm] Commanded altitude (MSL)
  199. */
  200. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  201. static inline void mavlink_msg_slugs_navigation_send(mavlink_channel_t chan, float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP, uint16_t h_c)
  202. {
  203. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  204. char buf[MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN];
  205. _mav_put_float(buf, 0, u_m);
  206. _mav_put_float(buf, 4, phi_c);
  207. _mav_put_float(buf, 8, theta_c);
  208. _mav_put_float(buf, 12, psiDot_c);
  209. _mav_put_float(buf, 16, ay_body);
  210. _mav_put_float(buf, 20, totalDist);
  211. _mav_put_float(buf, 24, dist2Go);
  212. _mav_put_uint16_t(buf, 28, h_c);
  213. _mav_put_uint8_t(buf, 30, fromWP);
  214. _mav_put_uint8_t(buf, 31, toWP);
  215. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  216. #else
  217. mavlink_slugs_navigation_t packet;
  218. packet.u_m = u_m;
  219. packet.phi_c = phi_c;
  220. packet.theta_c = theta_c;
  221. packet.psiDot_c = psiDot_c;
  222. packet.ay_body = ay_body;
  223. packet.totalDist = totalDist;
  224. packet.dist2Go = dist2Go;
  225. packet.h_c = h_c;
  226. packet.fromWP = fromWP;
  227. packet.toWP = toWP;
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)&packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  229. #endif
  230. }
  231. /**
  232. * @brief Send a slugs_navigation message
  233. * @param chan MAVLink channel to send the message
  234. * @param struct The MAVLink struct to serialize
  235. */
  236. static inline void mavlink_msg_slugs_navigation_send_struct(mavlink_channel_t chan, const mavlink_slugs_navigation_t* slugs_navigation)
  237. {
  238. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  239. mavlink_msg_slugs_navigation_send(chan, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP, slugs_navigation->h_c);
  240. #else
  241. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)slugs_navigation, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  242. #endif
  243. }
  244. #if MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  245. /*
  246. This varient of _send() can be used to save stack space by re-using
  247. memory from the receive buffer. The caller provides a
  248. mavlink_message_t which is the size of a full mavlink message. This
  249. is usually the receive buffer for the channel, and allows a reply to an
  250. incoming message with minimum stack space usage.
  251. */
  252. static inline void mavlink_msg_slugs_navigation_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP, uint16_t h_c)
  253. {
  254. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  255. char *buf = (char *)msgbuf;
  256. _mav_put_float(buf, 0, u_m);
  257. _mav_put_float(buf, 4, phi_c);
  258. _mav_put_float(buf, 8, theta_c);
  259. _mav_put_float(buf, 12, psiDot_c);
  260. _mav_put_float(buf, 16, ay_body);
  261. _mav_put_float(buf, 20, totalDist);
  262. _mav_put_float(buf, 24, dist2Go);
  263. _mav_put_uint16_t(buf, 28, h_c);
  264. _mav_put_uint8_t(buf, 30, fromWP);
  265. _mav_put_uint8_t(buf, 31, toWP);
  266. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  267. #else
  268. mavlink_slugs_navigation_t *packet = (mavlink_slugs_navigation_t *)msgbuf;
  269. packet->u_m = u_m;
  270. packet->phi_c = phi_c;
  271. packet->theta_c = theta_c;
  272. packet->psiDot_c = psiDot_c;
  273. packet->ay_body = ay_body;
  274. packet->totalDist = totalDist;
  275. packet->dist2Go = dist2Go;
  276. packet->h_c = h_c;
  277. packet->fromWP = fromWP;
  278. packet->toWP = toWP;
  279. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
  280. #endif
  281. }
  282. #endif
  283. #endif
  284. // MESSAGE SLUGS_NAVIGATION UNPACKING
  285. /**
  286. * @brief Get field u_m from slugs_navigation message
  287. *
  288. * @return [m/s] Measured Airspeed prior to the nav filter
  289. */
  290. static inline float mavlink_msg_slugs_navigation_get_u_m(const mavlink_message_t* msg)
  291. {
  292. return _MAV_RETURN_float(msg, 0);
  293. }
  294. /**
  295. * @brief Get field phi_c from slugs_navigation message
  296. *
  297. * @return Commanded Roll
  298. */
  299. static inline float mavlink_msg_slugs_navigation_get_phi_c(const mavlink_message_t* msg)
  300. {
  301. return _MAV_RETURN_float(msg, 4);
  302. }
  303. /**
  304. * @brief Get field theta_c from slugs_navigation message
  305. *
  306. * @return Commanded Pitch
  307. */
  308. static inline float mavlink_msg_slugs_navigation_get_theta_c(const mavlink_message_t* msg)
  309. {
  310. return _MAV_RETURN_float(msg, 8);
  311. }
  312. /**
  313. * @brief Get field psiDot_c from slugs_navigation message
  314. *
  315. * @return Commanded Turn rate
  316. */
  317. static inline float mavlink_msg_slugs_navigation_get_psiDot_c(const mavlink_message_t* msg)
  318. {
  319. return _MAV_RETURN_float(msg, 12);
  320. }
  321. /**
  322. * @brief Get field ay_body from slugs_navigation message
  323. *
  324. * @return Y component of the body acceleration
  325. */
  326. static inline float mavlink_msg_slugs_navigation_get_ay_body(const mavlink_message_t* msg)
  327. {
  328. return _MAV_RETURN_float(msg, 16);
  329. }
  330. /**
  331. * @brief Get field totalDist from slugs_navigation message
  332. *
  333. * @return Total Distance to Run on this leg of Navigation
  334. */
  335. static inline float mavlink_msg_slugs_navigation_get_totalDist(const mavlink_message_t* msg)
  336. {
  337. return _MAV_RETURN_float(msg, 20);
  338. }
  339. /**
  340. * @brief Get field dist2Go from slugs_navigation message
  341. *
  342. * @return Remaining distance to Run on this leg of Navigation
  343. */
  344. static inline float mavlink_msg_slugs_navigation_get_dist2Go(const mavlink_message_t* msg)
  345. {
  346. return _MAV_RETURN_float(msg, 24);
  347. }
  348. /**
  349. * @brief Get field fromWP from slugs_navigation message
  350. *
  351. * @return Origin WP
  352. */
  353. static inline uint8_t mavlink_msg_slugs_navigation_get_fromWP(const mavlink_message_t* msg)
  354. {
  355. return _MAV_RETURN_uint8_t(msg, 30);
  356. }
  357. /**
  358. * @brief Get field toWP from slugs_navigation message
  359. *
  360. * @return Destination WP
  361. */
  362. static inline uint8_t mavlink_msg_slugs_navigation_get_toWP(const mavlink_message_t* msg)
  363. {
  364. return _MAV_RETURN_uint8_t(msg, 31);
  365. }
  366. /**
  367. * @brief Get field h_c from slugs_navigation message
  368. *
  369. * @return [dm] Commanded altitude (MSL)
  370. */
  371. static inline uint16_t mavlink_msg_slugs_navigation_get_h_c(const mavlink_message_t* msg)
  372. {
  373. return _MAV_RETURN_uint16_t(msg, 28);
  374. }
  375. /**
  376. * @brief Decode a slugs_navigation message into a struct
  377. *
  378. * @param msg The message to decode
  379. * @param slugs_navigation C-struct to decode the message contents into
  380. */
  381. static inline void mavlink_msg_slugs_navigation_decode(const mavlink_message_t* msg, mavlink_slugs_navigation_t* slugs_navigation)
  382. {
  383. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  384. slugs_navigation->u_m = mavlink_msg_slugs_navigation_get_u_m(msg);
  385. slugs_navigation->phi_c = mavlink_msg_slugs_navigation_get_phi_c(msg);
  386. slugs_navigation->theta_c = mavlink_msg_slugs_navigation_get_theta_c(msg);
  387. slugs_navigation->psiDot_c = mavlink_msg_slugs_navigation_get_psiDot_c(msg);
  388. slugs_navigation->ay_body = mavlink_msg_slugs_navigation_get_ay_body(msg);
  389. slugs_navigation->totalDist = mavlink_msg_slugs_navigation_get_totalDist(msg);
  390. slugs_navigation->dist2Go = mavlink_msg_slugs_navigation_get_dist2Go(msg);
  391. slugs_navigation->h_c = mavlink_msg_slugs_navigation_get_h_c(msg);
  392. slugs_navigation->fromWP = mavlink_msg_slugs_navigation_get_fromWP(msg);
  393. slugs_navigation->toWP = mavlink_msg_slugs_navigation_get_toWP(msg);
  394. #else
  395. uint8_t len = msg->len < MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN? msg->len : MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN;
  396. memset(slugs_navigation, 0, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
  397. memcpy(slugs_navigation, _MAV_PAYLOAD(msg), len);
  398. #endif
  399. }