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.

413 lines
18 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE WIND_COV PACKING
  3. #define MAVLINK_MSG_ID_WIND_COV 231
  4. MAVPACKED(
  5. typedef struct __mavlink_wind_cov_t {
  6. uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
  7. float wind_x; /*< [m/s] Wind in X (NED) direction*/
  8. float wind_y; /*< [m/s] Wind in Y (NED) direction*/
  9. float wind_z; /*< [m/s] Wind in Z (NED) direction*/
  10. float var_horiz; /*< [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.*/
  11. float var_vert; /*< [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.*/
  12. float wind_alt; /*< [m] Altitude (MSL) that this measurement was taken at*/
  13. float horiz_accuracy; /*< [m] Horizontal speed 1-STD accuracy*/
  14. float vert_accuracy; /*< [m] Vertical speed 1-STD accuracy*/
  15. }) mavlink_wind_cov_t;
  16. #define MAVLINK_MSG_ID_WIND_COV_LEN 40
  17. #define MAVLINK_MSG_ID_WIND_COV_MIN_LEN 40
  18. #define MAVLINK_MSG_ID_231_LEN 40
  19. #define MAVLINK_MSG_ID_231_MIN_LEN 40
  20. #define MAVLINK_MSG_ID_WIND_COV_CRC 105
  21. #define MAVLINK_MSG_ID_231_CRC 105
  22. #if MAVLINK_COMMAND_24BIT
  23. #define MAVLINK_MESSAGE_INFO_WIND_COV { \
  24. 231, \
  25. "WIND_COV", \
  26. 9, \
  27. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \
  28. { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \
  29. { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \
  30. { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \
  31. { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \
  32. { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \
  33. { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \
  34. { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \
  35. { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \
  36. } \
  37. }
  38. #else
  39. #define MAVLINK_MESSAGE_INFO_WIND_COV { \
  40. "WIND_COV", \
  41. 9, \
  42. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \
  43. { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \
  44. { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \
  45. { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \
  46. { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \
  47. { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \
  48. { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \
  49. { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \
  50. { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \
  51. } \
  52. }
  53. #endif
  54. /**
  55. * @brief Pack a wind_cov message
  56. * @param system_id ID of this system
  57. * @param component_id ID of this component (e.g. 200 for IMU)
  58. * @param msg The MAVLink message to compress the data into
  59. *
  60. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
  61. * @param wind_x [m/s] Wind in X (NED) direction
  62. * @param wind_y [m/s] Wind in Y (NED) direction
  63. * @param wind_z [m/s] Wind in Z (NED) direction
  64. * @param var_horiz [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
  65. * @param var_vert [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
  66. * @param wind_alt [m] Altitude (MSL) that this measurement was taken at
  67. * @param horiz_accuracy [m] Horizontal speed 1-STD accuracy
  68. * @param vert_accuracy [m] Vertical speed 1-STD accuracy
  69. * @return length of the message in bytes (excluding serial stream start sign)
  70. */
  71. static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  72. uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
  73. {
  74. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  75. char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
  76. _mav_put_uint64_t(buf, 0, time_usec);
  77. _mav_put_float(buf, 8, wind_x);
  78. _mav_put_float(buf, 12, wind_y);
  79. _mav_put_float(buf, 16, wind_z);
  80. _mav_put_float(buf, 20, var_horiz);
  81. _mav_put_float(buf, 24, var_vert);
  82. _mav_put_float(buf, 28, wind_alt);
  83. _mav_put_float(buf, 32, horiz_accuracy);
  84. _mav_put_float(buf, 36, vert_accuracy);
  85. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
  86. #else
  87. mavlink_wind_cov_t packet;
  88. packet.time_usec = time_usec;
  89. packet.wind_x = wind_x;
  90. packet.wind_y = wind_y;
  91. packet.wind_z = wind_z;
  92. packet.var_horiz = var_horiz;
  93. packet.var_vert = var_vert;
  94. packet.wind_alt = wind_alt;
  95. packet.horiz_accuracy = horiz_accuracy;
  96. packet.vert_accuracy = vert_accuracy;
  97. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
  98. #endif
  99. msg->msgid = MAVLINK_MSG_ID_WIND_COV;
  100. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  101. }
  102. /**
  103. * @brief Pack a wind_cov message on a channel
  104. * @param system_id ID of this system
  105. * @param component_id ID of this component (e.g. 200 for IMU)
  106. * @param chan The MAVLink channel this message will be sent over
  107. * @param msg The MAVLink message to compress the data into
  108. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
  109. * @param wind_x [m/s] Wind in X (NED) direction
  110. * @param wind_y [m/s] Wind in Y (NED) direction
  111. * @param wind_z [m/s] Wind in Z (NED) direction
  112. * @param var_horiz [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
  113. * @param var_vert [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
  114. * @param wind_alt [m] Altitude (MSL) that this measurement was taken at
  115. * @param horiz_accuracy [m] Horizontal speed 1-STD accuracy
  116. * @param vert_accuracy [m] Vertical speed 1-STD accuracy
  117. * @return length of the message in bytes (excluding serial stream start sign)
  118. */
  119. static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  120. mavlink_message_t* msg,
  121. uint64_t time_usec,float wind_x,float wind_y,float wind_z,float var_horiz,float var_vert,float wind_alt,float horiz_accuracy,float vert_accuracy)
  122. {
  123. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  124. char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
  125. _mav_put_uint64_t(buf, 0, time_usec);
  126. _mav_put_float(buf, 8, wind_x);
  127. _mav_put_float(buf, 12, wind_y);
  128. _mav_put_float(buf, 16, wind_z);
  129. _mav_put_float(buf, 20, var_horiz);
  130. _mav_put_float(buf, 24, var_vert);
  131. _mav_put_float(buf, 28, wind_alt);
  132. _mav_put_float(buf, 32, horiz_accuracy);
  133. _mav_put_float(buf, 36, vert_accuracy);
  134. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
  135. #else
  136. mavlink_wind_cov_t packet;
  137. packet.time_usec = time_usec;
  138. packet.wind_x = wind_x;
  139. packet.wind_y = wind_y;
  140. packet.wind_z = wind_z;
  141. packet.var_horiz = var_horiz;
  142. packet.var_vert = var_vert;
  143. packet.wind_alt = wind_alt;
  144. packet.horiz_accuracy = horiz_accuracy;
  145. packet.vert_accuracy = vert_accuracy;
  146. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
  147. #endif
  148. msg->msgid = MAVLINK_MSG_ID_WIND_COV;
  149. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  150. }
  151. /**
  152. * @brief Encode a wind_cov struct
  153. *
  154. * @param system_id ID of this system
  155. * @param component_id ID of this component (e.g. 200 for IMU)
  156. * @param msg The MAVLink message to compress the data into
  157. * @param wind_cov C-struct to read the message contents from
  158. */
  159. static inline uint16_t mavlink_msg_wind_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
  160. {
  161. return mavlink_msg_wind_cov_pack(system_id, component_id, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
  162. }
  163. /**
  164. * @brief Encode a wind_cov struct on a channel
  165. *
  166. * @param system_id ID of this system
  167. * @param component_id ID of this component (e.g. 200 for IMU)
  168. * @param chan The MAVLink channel this message will be sent over
  169. * @param msg The MAVLink message to compress the data into
  170. * @param wind_cov C-struct to read the message contents from
  171. */
  172. static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
  173. {
  174. return mavlink_msg_wind_cov_pack_chan(system_id, component_id, chan, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
  175. }
  176. /**
  177. * @brief Send a wind_cov message
  178. * @param chan MAVLink channel to send the message
  179. *
  180. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
  181. * @param wind_x [m/s] Wind in X (NED) direction
  182. * @param wind_y [m/s] Wind in Y (NED) direction
  183. * @param wind_z [m/s] Wind in Z (NED) direction
  184. * @param var_horiz [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
  185. * @param var_vert [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
  186. * @param wind_alt [m] Altitude (MSL) that this measurement was taken at
  187. * @param horiz_accuracy [m] Horizontal speed 1-STD accuracy
  188. * @param vert_accuracy [m] Vertical speed 1-STD accuracy
  189. */
  190. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  191. static inline void mavlink_msg_wind_cov_send(mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
  192. {
  193. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  194. char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
  195. _mav_put_uint64_t(buf, 0, time_usec);
  196. _mav_put_float(buf, 8, wind_x);
  197. _mav_put_float(buf, 12, wind_y);
  198. _mav_put_float(buf, 16, wind_z);
  199. _mav_put_float(buf, 20, var_horiz);
  200. _mav_put_float(buf, 24, var_vert);
  201. _mav_put_float(buf, 28, wind_alt);
  202. _mav_put_float(buf, 32, horiz_accuracy);
  203. _mav_put_float(buf, 36, vert_accuracy);
  204. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  205. #else
  206. mavlink_wind_cov_t packet;
  207. packet.time_usec = time_usec;
  208. packet.wind_x = wind_x;
  209. packet.wind_y = wind_y;
  210. packet.wind_z = wind_z;
  211. packet.var_horiz = var_horiz;
  212. packet.var_vert = var_vert;
  213. packet.wind_alt = wind_alt;
  214. packet.horiz_accuracy = horiz_accuracy;
  215. packet.vert_accuracy = vert_accuracy;
  216. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  217. #endif
  218. }
  219. /**
  220. * @brief Send a wind_cov message
  221. * @param chan MAVLink channel to send the message
  222. * @param struct The MAVLink struct to serialize
  223. */
  224. static inline void mavlink_msg_wind_cov_send_struct(mavlink_channel_t chan, const mavlink_wind_cov_t* wind_cov)
  225. {
  226. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  227. mavlink_msg_wind_cov_send(chan, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
  228. #else
  229. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)wind_cov, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  230. #endif
  231. }
  232. #if MAVLINK_MSG_ID_WIND_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  233. /*
  234. This varient of _send() can be used to save stack space by re-using
  235. memory from the receive buffer. The caller provides a
  236. mavlink_message_t which is the size of a full mavlink message. This
  237. is usually the receive buffer for the channel, and allows a reply to an
  238. incoming message with minimum stack space usage.
  239. */
  240. static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
  241. {
  242. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  243. char *buf = (char *)msgbuf;
  244. _mav_put_uint64_t(buf, 0, time_usec);
  245. _mav_put_float(buf, 8, wind_x);
  246. _mav_put_float(buf, 12, wind_y);
  247. _mav_put_float(buf, 16, wind_z);
  248. _mav_put_float(buf, 20, var_horiz);
  249. _mav_put_float(buf, 24, var_vert);
  250. _mav_put_float(buf, 28, wind_alt);
  251. _mav_put_float(buf, 32, horiz_accuracy);
  252. _mav_put_float(buf, 36, vert_accuracy);
  253. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  254. #else
  255. mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf;
  256. packet->time_usec = time_usec;
  257. packet->wind_x = wind_x;
  258. packet->wind_y = wind_y;
  259. packet->wind_z = wind_z;
  260. packet->var_horiz = var_horiz;
  261. packet->var_vert = var_vert;
  262. packet->wind_alt = wind_alt;
  263. packet->horiz_accuracy = horiz_accuracy;
  264. packet->vert_accuracy = vert_accuracy;
  265. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
  266. #endif
  267. }
  268. #endif
  269. #endif
  270. // MESSAGE WIND_COV UNPACKING
  271. /**
  272. * @brief Get field time_usec from wind_cov message
  273. *
  274. * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
  275. */
  276. static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg)
  277. {
  278. return _MAV_RETURN_uint64_t(msg, 0);
  279. }
  280. /**
  281. * @brief Get field wind_x from wind_cov message
  282. *
  283. * @return [m/s] Wind in X (NED) direction
  284. */
  285. static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg)
  286. {
  287. return _MAV_RETURN_float(msg, 8);
  288. }
  289. /**
  290. * @brief Get field wind_y from wind_cov message
  291. *
  292. * @return [m/s] Wind in Y (NED) direction
  293. */
  294. static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg)
  295. {
  296. return _MAV_RETURN_float(msg, 12);
  297. }
  298. /**
  299. * @brief Get field wind_z from wind_cov message
  300. *
  301. * @return [m/s] Wind in Z (NED) direction
  302. */
  303. static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg)
  304. {
  305. return _MAV_RETURN_float(msg, 16);
  306. }
  307. /**
  308. * @brief Get field var_horiz from wind_cov message
  309. *
  310. * @return [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
  311. */
  312. static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg)
  313. {
  314. return _MAV_RETURN_float(msg, 20);
  315. }
  316. /**
  317. * @brief Get field var_vert from wind_cov message
  318. *
  319. * @return [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
  320. */
  321. static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg)
  322. {
  323. return _MAV_RETURN_float(msg, 24);
  324. }
  325. /**
  326. * @brief Get field wind_alt from wind_cov message
  327. *
  328. * @return [m] Altitude (MSL) that this measurement was taken at
  329. */
  330. static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg)
  331. {
  332. return _MAV_RETURN_float(msg, 28);
  333. }
  334. /**
  335. * @brief Get field horiz_accuracy from wind_cov message
  336. *
  337. * @return [m] Horizontal speed 1-STD accuracy
  338. */
  339. static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg)
  340. {
  341. return _MAV_RETURN_float(msg, 32);
  342. }
  343. /**
  344. * @brief Get field vert_accuracy from wind_cov message
  345. *
  346. * @return [m] Vertical speed 1-STD accuracy
  347. */
  348. static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg)
  349. {
  350. return _MAV_RETURN_float(msg, 36);
  351. }
  352. /**
  353. * @brief Decode a wind_cov message into a struct
  354. *
  355. * @param msg The message to decode
  356. * @param wind_cov C-struct to decode the message contents into
  357. */
  358. static inline void mavlink_msg_wind_cov_decode(const mavlink_message_t* msg, mavlink_wind_cov_t* wind_cov)
  359. {
  360. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  361. wind_cov->time_usec = mavlink_msg_wind_cov_get_time_usec(msg);
  362. wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg);
  363. wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg);
  364. wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg);
  365. wind_cov->var_horiz = mavlink_msg_wind_cov_get_var_horiz(msg);
  366. wind_cov->var_vert = mavlink_msg_wind_cov_get_var_vert(msg);
  367. wind_cov->wind_alt = mavlink_msg_wind_cov_get_wind_alt(msg);
  368. wind_cov->horiz_accuracy = mavlink_msg_wind_cov_get_horiz_accuracy(msg);
  369. wind_cov->vert_accuracy = mavlink_msg_wind_cov_get_vert_accuracy(msg);
  370. #else
  371. uint8_t len = msg->len < MAVLINK_MSG_ID_WIND_COV_LEN? msg->len : MAVLINK_MSG_ID_WIND_COV_LEN;
  372. memset(wind_cov, 0, MAVLINK_MSG_ID_WIND_COV_LEN);
  373. memcpy(wind_cov, _MAV_PAYLOAD(msg), len);
  374. #endif
  375. }