mavlink_msg_wind_cov.h 19 KB

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