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
19 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE DEEPSTALL PACKING
  3. #define MAVLINK_MSG_ID_DEEPSTALL 195
  4. MAVPACKED(
  5. typedef struct __mavlink_deepstall_t {
  6. int32_t landing_lat; /*< [degE7] Landing latitude.*/
  7. int32_t landing_lon; /*< [degE7] Landing longitude.*/
  8. int32_t path_lat; /*< [degE7] Final heading start point, latitude.*/
  9. int32_t path_lon; /*< [degE7] Final heading start point, longitude.*/
  10. int32_t arc_entry_lat; /*< [degE7] Arc entry point, latitude.*/
  11. int32_t arc_entry_lon; /*< [degE7] Arc entry point, longitude.*/
  12. float altitude; /*< [m] Altitude.*/
  13. float expected_travel_distance; /*< [m] Distance the aircraft expects to travel during the deepstall.*/
  14. float cross_track_error; /*< [m] Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND).*/
  15. uint8_t stage; /*< Deepstall stage.*/
  16. }) mavlink_deepstall_t;
  17. #define MAVLINK_MSG_ID_DEEPSTALL_LEN 37
  18. #define MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN 37
  19. #define MAVLINK_MSG_ID_195_LEN 37
  20. #define MAVLINK_MSG_ID_195_MIN_LEN 37
  21. #define MAVLINK_MSG_ID_DEEPSTALL_CRC 120
  22. #define MAVLINK_MSG_ID_195_CRC 120
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_DEEPSTALL { \
  25. 195, \
  26. "DEEPSTALL", \
  27. 10, \
  28. { { "landing_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_deepstall_t, landing_lat) }, \
  29. { "landing_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_deepstall_t, landing_lon) }, \
  30. { "path_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_deepstall_t, path_lat) }, \
  31. { "path_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_deepstall_t, path_lon) }, \
  32. { "arc_entry_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_deepstall_t, arc_entry_lat) }, \
  33. { "arc_entry_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_deepstall_t, arc_entry_lon) }, \
  34. { "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_deepstall_t, altitude) }, \
  35. { "expected_travel_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_deepstall_t, expected_travel_distance) }, \
  36. { "cross_track_error", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_deepstall_t, cross_track_error) }, \
  37. { "stage", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_deepstall_t, stage) }, \
  38. } \
  39. }
  40. #else
  41. #define MAVLINK_MESSAGE_INFO_DEEPSTALL { \
  42. "DEEPSTALL", \
  43. 10, \
  44. { { "landing_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_deepstall_t, landing_lat) }, \
  45. { "landing_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_deepstall_t, landing_lon) }, \
  46. { "path_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_deepstall_t, path_lat) }, \
  47. { "path_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_deepstall_t, path_lon) }, \
  48. { "arc_entry_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_deepstall_t, arc_entry_lat) }, \
  49. { "arc_entry_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_deepstall_t, arc_entry_lon) }, \
  50. { "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_deepstall_t, altitude) }, \
  51. { "expected_travel_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_deepstall_t, expected_travel_distance) }, \
  52. { "cross_track_error", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_deepstall_t, cross_track_error) }, \
  53. { "stage", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_deepstall_t, stage) }, \
  54. } \
  55. }
  56. #endif
  57. /**
  58. * @brief Pack a deepstall 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 landing_lat [degE7] Landing latitude.
  64. * @param landing_lon [degE7] Landing longitude.
  65. * @param path_lat [degE7] Final heading start point, latitude.
  66. * @param path_lon [degE7] Final heading start point, longitude.
  67. * @param arc_entry_lat [degE7] Arc entry point, latitude.
  68. * @param arc_entry_lon [degE7] Arc entry point, longitude.
  69. * @param altitude [m] Altitude.
  70. * @param expected_travel_distance [m] Distance the aircraft expects to travel during the deepstall.
  71. * @param cross_track_error [m] Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND).
  72. * @param stage Deepstall stage.
  73. * @return length of the message in bytes (excluding serial stream start sign)
  74. */
  75. static inline uint16_t mavlink_msg_deepstall_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  76. int32_t landing_lat, int32_t landing_lon, int32_t path_lat, int32_t path_lon, int32_t arc_entry_lat, int32_t arc_entry_lon, float altitude, float expected_travel_distance, float cross_track_error, uint8_t stage)
  77. {
  78. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  79. char buf[MAVLINK_MSG_ID_DEEPSTALL_LEN];
  80. _mav_put_int32_t(buf, 0, landing_lat);
  81. _mav_put_int32_t(buf, 4, landing_lon);
  82. _mav_put_int32_t(buf, 8, path_lat);
  83. _mav_put_int32_t(buf, 12, path_lon);
  84. _mav_put_int32_t(buf, 16, arc_entry_lat);
  85. _mav_put_int32_t(buf, 20, arc_entry_lon);
  86. _mav_put_float(buf, 24, altitude);
  87. _mav_put_float(buf, 28, expected_travel_distance);
  88. _mav_put_float(buf, 32, cross_track_error);
  89. _mav_put_uint8_t(buf, 36, stage);
  90. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEEPSTALL_LEN);
  91. #else
  92. mavlink_deepstall_t packet;
  93. packet.landing_lat = landing_lat;
  94. packet.landing_lon = landing_lon;
  95. packet.path_lat = path_lat;
  96. packet.path_lon = path_lon;
  97. packet.arc_entry_lat = arc_entry_lat;
  98. packet.arc_entry_lon = arc_entry_lon;
  99. packet.altitude = altitude;
  100. packet.expected_travel_distance = expected_travel_distance;
  101. packet.cross_track_error = cross_track_error;
  102. packet.stage = stage;
  103. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEEPSTALL_LEN);
  104. #endif
  105. msg->msgid = MAVLINK_MSG_ID_DEEPSTALL;
  106. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  107. }
  108. /**
  109. * @brief Pack a deepstall 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 landing_lat [degE7] Landing latitude.
  115. * @param landing_lon [degE7] Landing longitude.
  116. * @param path_lat [degE7] Final heading start point, latitude.
  117. * @param path_lon [degE7] Final heading start point, longitude.
  118. * @param arc_entry_lat [degE7] Arc entry point, latitude.
  119. * @param arc_entry_lon [degE7] Arc entry point, longitude.
  120. * @param altitude [m] Altitude.
  121. * @param expected_travel_distance [m] Distance the aircraft expects to travel during the deepstall.
  122. * @param cross_track_error [m] Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND).
  123. * @param stage Deepstall stage.
  124. * @return length of the message in bytes (excluding serial stream start sign)
  125. */
  126. static inline uint16_t mavlink_msg_deepstall_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  127. mavlink_message_t* msg,
  128. int32_t landing_lat,int32_t landing_lon,int32_t path_lat,int32_t path_lon,int32_t arc_entry_lat,int32_t arc_entry_lon,float altitude,float expected_travel_distance,float cross_track_error,uint8_t stage)
  129. {
  130. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  131. char buf[MAVLINK_MSG_ID_DEEPSTALL_LEN];
  132. _mav_put_int32_t(buf, 0, landing_lat);
  133. _mav_put_int32_t(buf, 4, landing_lon);
  134. _mav_put_int32_t(buf, 8, path_lat);
  135. _mav_put_int32_t(buf, 12, path_lon);
  136. _mav_put_int32_t(buf, 16, arc_entry_lat);
  137. _mav_put_int32_t(buf, 20, arc_entry_lon);
  138. _mav_put_float(buf, 24, altitude);
  139. _mav_put_float(buf, 28, expected_travel_distance);
  140. _mav_put_float(buf, 32, cross_track_error);
  141. _mav_put_uint8_t(buf, 36, stage);
  142. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEEPSTALL_LEN);
  143. #else
  144. mavlink_deepstall_t packet;
  145. packet.landing_lat = landing_lat;
  146. packet.landing_lon = landing_lon;
  147. packet.path_lat = path_lat;
  148. packet.path_lon = path_lon;
  149. packet.arc_entry_lat = arc_entry_lat;
  150. packet.arc_entry_lon = arc_entry_lon;
  151. packet.altitude = altitude;
  152. packet.expected_travel_distance = expected_travel_distance;
  153. packet.cross_track_error = cross_track_error;
  154. packet.stage = stage;
  155. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEEPSTALL_LEN);
  156. #endif
  157. msg->msgid = MAVLINK_MSG_ID_DEEPSTALL;
  158. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  159. }
  160. /**
  161. * @brief Encode a deepstall 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 deepstall C-struct to read the message contents from
  167. */
  168. static inline uint16_t mavlink_msg_deepstall_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_deepstall_t* deepstall)
  169. {
  170. return mavlink_msg_deepstall_pack(system_id, component_id, msg, deepstall->landing_lat, deepstall->landing_lon, deepstall->path_lat, deepstall->path_lon, deepstall->arc_entry_lat, deepstall->arc_entry_lon, deepstall->altitude, deepstall->expected_travel_distance, deepstall->cross_track_error, deepstall->stage);
  171. }
  172. /**
  173. * @brief Encode a deepstall 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 deepstall C-struct to read the message contents from
  180. */
  181. static inline uint16_t mavlink_msg_deepstall_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_deepstall_t* deepstall)
  182. {
  183. return mavlink_msg_deepstall_pack_chan(system_id, component_id, chan, msg, deepstall->landing_lat, deepstall->landing_lon, deepstall->path_lat, deepstall->path_lon, deepstall->arc_entry_lat, deepstall->arc_entry_lon, deepstall->altitude, deepstall->expected_travel_distance, deepstall->cross_track_error, deepstall->stage);
  184. }
  185. /**
  186. * @brief Send a deepstall message
  187. * @param chan MAVLink channel to send the message
  188. *
  189. * @param landing_lat [degE7] Landing latitude.
  190. * @param landing_lon [degE7] Landing longitude.
  191. * @param path_lat [degE7] Final heading start point, latitude.
  192. * @param path_lon [degE7] Final heading start point, longitude.
  193. * @param arc_entry_lat [degE7] Arc entry point, latitude.
  194. * @param arc_entry_lon [degE7] Arc entry point, longitude.
  195. * @param altitude [m] Altitude.
  196. * @param expected_travel_distance [m] Distance the aircraft expects to travel during the deepstall.
  197. * @param cross_track_error [m] Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND).
  198. * @param stage Deepstall stage.
  199. */
  200. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  201. static inline void mavlink_msg_deepstall_send(mavlink_channel_t chan, int32_t landing_lat, int32_t landing_lon, int32_t path_lat, int32_t path_lon, int32_t arc_entry_lat, int32_t arc_entry_lon, float altitude, float expected_travel_distance, float cross_track_error, uint8_t stage)
  202. {
  203. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  204. char buf[MAVLINK_MSG_ID_DEEPSTALL_LEN];
  205. _mav_put_int32_t(buf, 0, landing_lat);
  206. _mav_put_int32_t(buf, 4, landing_lon);
  207. _mav_put_int32_t(buf, 8, path_lat);
  208. _mav_put_int32_t(buf, 12, path_lon);
  209. _mav_put_int32_t(buf, 16, arc_entry_lat);
  210. _mav_put_int32_t(buf, 20, arc_entry_lon);
  211. _mav_put_float(buf, 24, altitude);
  212. _mav_put_float(buf, 28, expected_travel_distance);
  213. _mav_put_float(buf, 32, cross_track_error);
  214. _mav_put_uint8_t(buf, 36, stage);
  215. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEEPSTALL, buf, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  216. #else
  217. mavlink_deepstall_t packet;
  218. packet.landing_lat = landing_lat;
  219. packet.landing_lon = landing_lon;
  220. packet.path_lat = path_lat;
  221. packet.path_lon = path_lon;
  222. packet.arc_entry_lat = arc_entry_lat;
  223. packet.arc_entry_lon = arc_entry_lon;
  224. packet.altitude = altitude;
  225. packet.expected_travel_distance = expected_travel_distance;
  226. packet.cross_track_error = cross_track_error;
  227. packet.stage = stage;
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEEPSTALL, (const char *)&packet, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  229. #endif
  230. }
  231. /**
  232. * @brief Send a deepstall 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_deepstall_send_struct(mavlink_channel_t chan, const mavlink_deepstall_t* deepstall)
  237. {
  238. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  239. mavlink_msg_deepstall_send(chan, deepstall->landing_lat, deepstall->landing_lon, deepstall->path_lat, deepstall->path_lon, deepstall->arc_entry_lat, deepstall->arc_entry_lon, deepstall->altitude, deepstall->expected_travel_distance, deepstall->cross_track_error, deepstall->stage);
  240. #else
  241. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEEPSTALL, (const char *)deepstall, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  242. #endif
  243. }
  244. #if MAVLINK_MSG_ID_DEEPSTALL_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_deepstall_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t landing_lat, int32_t landing_lon, int32_t path_lat, int32_t path_lon, int32_t arc_entry_lat, int32_t arc_entry_lon, float altitude, float expected_travel_distance, float cross_track_error, uint8_t stage)
  253. {
  254. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  255. char *buf = (char *)msgbuf;
  256. _mav_put_int32_t(buf, 0, landing_lat);
  257. _mav_put_int32_t(buf, 4, landing_lon);
  258. _mav_put_int32_t(buf, 8, path_lat);
  259. _mav_put_int32_t(buf, 12, path_lon);
  260. _mav_put_int32_t(buf, 16, arc_entry_lat);
  261. _mav_put_int32_t(buf, 20, arc_entry_lon);
  262. _mav_put_float(buf, 24, altitude);
  263. _mav_put_float(buf, 28, expected_travel_distance);
  264. _mav_put_float(buf, 32, cross_track_error);
  265. _mav_put_uint8_t(buf, 36, stage);
  266. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEEPSTALL, buf, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  267. #else
  268. mavlink_deepstall_t *packet = (mavlink_deepstall_t *)msgbuf;
  269. packet->landing_lat = landing_lat;
  270. packet->landing_lon = landing_lon;
  271. packet->path_lat = path_lat;
  272. packet->path_lon = path_lon;
  273. packet->arc_entry_lat = arc_entry_lat;
  274. packet->arc_entry_lon = arc_entry_lon;
  275. packet->altitude = altitude;
  276. packet->expected_travel_distance = expected_travel_distance;
  277. packet->cross_track_error = cross_track_error;
  278. packet->stage = stage;
  279. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEEPSTALL, (const char *)packet, MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN, MAVLINK_MSG_ID_DEEPSTALL_LEN, MAVLINK_MSG_ID_DEEPSTALL_CRC);
  280. #endif
  281. }
  282. #endif
  283. #endif
  284. // MESSAGE DEEPSTALL UNPACKING
  285. /**
  286. * @brief Get field landing_lat from deepstall message
  287. *
  288. * @return [degE7] Landing latitude.
  289. */
  290. static inline int32_t mavlink_msg_deepstall_get_landing_lat(const mavlink_message_t* msg)
  291. {
  292. return _MAV_RETURN_int32_t(msg, 0);
  293. }
  294. /**
  295. * @brief Get field landing_lon from deepstall message
  296. *
  297. * @return [degE7] Landing longitude.
  298. */
  299. static inline int32_t mavlink_msg_deepstall_get_landing_lon(const mavlink_message_t* msg)
  300. {
  301. return _MAV_RETURN_int32_t(msg, 4);
  302. }
  303. /**
  304. * @brief Get field path_lat from deepstall message
  305. *
  306. * @return [degE7] Final heading start point, latitude.
  307. */
  308. static inline int32_t mavlink_msg_deepstall_get_path_lat(const mavlink_message_t* msg)
  309. {
  310. return _MAV_RETURN_int32_t(msg, 8);
  311. }
  312. /**
  313. * @brief Get field path_lon from deepstall message
  314. *
  315. * @return [degE7] Final heading start point, longitude.
  316. */
  317. static inline int32_t mavlink_msg_deepstall_get_path_lon(const mavlink_message_t* msg)
  318. {
  319. return _MAV_RETURN_int32_t(msg, 12);
  320. }
  321. /**
  322. * @brief Get field arc_entry_lat from deepstall message
  323. *
  324. * @return [degE7] Arc entry point, latitude.
  325. */
  326. static inline int32_t mavlink_msg_deepstall_get_arc_entry_lat(const mavlink_message_t* msg)
  327. {
  328. return _MAV_RETURN_int32_t(msg, 16);
  329. }
  330. /**
  331. * @brief Get field arc_entry_lon from deepstall message
  332. *
  333. * @return [degE7] Arc entry point, longitude.
  334. */
  335. static inline int32_t mavlink_msg_deepstall_get_arc_entry_lon(const mavlink_message_t* msg)
  336. {
  337. return _MAV_RETURN_int32_t(msg, 20);
  338. }
  339. /**
  340. * @brief Get field altitude from deepstall message
  341. *
  342. * @return [m] Altitude.
  343. */
  344. static inline float mavlink_msg_deepstall_get_altitude(const mavlink_message_t* msg)
  345. {
  346. return _MAV_RETURN_float(msg, 24);
  347. }
  348. /**
  349. * @brief Get field expected_travel_distance from deepstall message
  350. *
  351. * @return [m] Distance the aircraft expects to travel during the deepstall.
  352. */
  353. static inline float mavlink_msg_deepstall_get_expected_travel_distance(const mavlink_message_t* msg)
  354. {
  355. return _MAV_RETURN_float(msg, 28);
  356. }
  357. /**
  358. * @brief Get field cross_track_error from deepstall message
  359. *
  360. * @return [m] Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND).
  361. */
  362. static inline float mavlink_msg_deepstall_get_cross_track_error(const mavlink_message_t* msg)
  363. {
  364. return _MAV_RETURN_float(msg, 32);
  365. }
  366. /**
  367. * @brief Get field stage from deepstall message
  368. *
  369. * @return Deepstall stage.
  370. */
  371. static inline uint8_t mavlink_msg_deepstall_get_stage(const mavlink_message_t* msg)
  372. {
  373. return _MAV_RETURN_uint8_t(msg, 36);
  374. }
  375. /**
  376. * @brief Decode a deepstall message into a struct
  377. *
  378. * @param msg The message to decode
  379. * @param deepstall C-struct to decode the message contents into
  380. */
  381. static inline void mavlink_msg_deepstall_decode(const mavlink_message_t* msg, mavlink_deepstall_t* deepstall)
  382. {
  383. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  384. deepstall->landing_lat = mavlink_msg_deepstall_get_landing_lat(msg);
  385. deepstall->landing_lon = mavlink_msg_deepstall_get_landing_lon(msg);
  386. deepstall->path_lat = mavlink_msg_deepstall_get_path_lat(msg);
  387. deepstall->path_lon = mavlink_msg_deepstall_get_path_lon(msg);
  388. deepstall->arc_entry_lat = mavlink_msg_deepstall_get_arc_entry_lat(msg);
  389. deepstall->arc_entry_lon = mavlink_msg_deepstall_get_arc_entry_lon(msg);
  390. deepstall->altitude = mavlink_msg_deepstall_get_altitude(msg);
  391. deepstall->expected_travel_distance = mavlink_msg_deepstall_get_expected_travel_distance(msg);
  392. deepstall->cross_track_error = mavlink_msg_deepstall_get_cross_track_error(msg);
  393. deepstall->stage = mavlink_msg_deepstall_get_stage(msg);
  394. #else
  395. uint8_t len = msg->len < MAVLINK_MSG_ID_DEEPSTALL_LEN? msg->len : MAVLINK_MSG_ID_DEEPSTALL_LEN;
  396. memset(deepstall, 0, MAVLINK_MSG_ID_DEEPSTALL_LEN);
  397. memcpy(deepstall, _MAV_PAYLOAD(msg), len);
  398. #endif
  399. }