mavlink_msg_wind_cov.h
Go to the documentation of this file.
1 // MESSAGE WIND_COV PACKING
2 
3 #define MAVLINK_MSG_ID_WIND_COV 231
4 
5 typedef struct __mavlink_wind_cov_t
6 {
7  uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
8  float wind_x; /*< Wind in X (NED) direction in m/s*/
9  float wind_y; /*< Wind in Y (NED) direction in m/s*/
10  float wind_z; /*< Wind in Z (NED) direction in m/s*/
11  float var_horiz; /*< Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.*/
12  float var_vert; /*< Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.*/
13  float wind_alt; /*< AMSL altitude (m) this measurement was taken at*/
14  float horiz_accuracy; /*< Horizontal speed 1-STD accuracy*/
15  float vert_accuracy; /*< Vertical speed 1-STD accuracy*/
17 
18 #define MAVLINK_MSG_ID_WIND_COV_LEN 40
19 #define MAVLINK_MSG_ID_231_LEN 40
20 
21 #define MAVLINK_MSG_ID_WIND_COV_CRC 105
22 #define MAVLINK_MSG_ID_231_CRC 105
23 
24 
25 
26 #define MAVLINK_MESSAGE_INFO_WIND_COV { \
27  "WIND_COV", \
28  9, \
29  { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \
30  { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \
31  { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \
32  { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \
33  { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \
34  { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \
35  { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \
36  { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \
37  { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \
38  } \
39 }
40 
41 
59 static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
60  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)
61 {
62 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
64  _mav_put_uint64_t(buf, 0, time_usec);
65  _mav_put_float(buf, 8, wind_x);
66  _mav_put_float(buf, 12, wind_y);
67  _mav_put_float(buf, 16, wind_z);
68  _mav_put_float(buf, 20, var_horiz);
69  _mav_put_float(buf, 24, var_vert);
70  _mav_put_float(buf, 28, wind_alt);
71  _mav_put_float(buf, 32, horiz_accuracy);
72  _mav_put_float(buf, 36, vert_accuracy);
73 
75 #else
76  mavlink_wind_cov_t packet;
77  packet.time_usec = time_usec;
78  packet.wind_x = wind_x;
79  packet.wind_y = wind_y;
80  packet.wind_z = wind_z;
81  packet.var_horiz = var_horiz;
82  packet.var_vert = var_vert;
83  packet.wind_alt = wind_alt;
86 
88 #endif
89 
90  msg->msgid = MAVLINK_MSG_ID_WIND_COV;
91 #if MAVLINK_CRC_EXTRA
93 #else
94  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_LEN);
95 #endif
96 }
97 
115 static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
116  mavlink_message_t* msg,
117  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)
118 {
119 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
120  char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
121  _mav_put_uint64_t(buf, 0, time_usec);
122  _mav_put_float(buf, 8, wind_x);
123  _mav_put_float(buf, 12, wind_y);
124  _mav_put_float(buf, 16, wind_z);
125  _mav_put_float(buf, 20, var_horiz);
126  _mav_put_float(buf, 24, var_vert);
127  _mav_put_float(buf, 28, wind_alt);
128  _mav_put_float(buf, 32, horiz_accuracy);
129  _mav_put_float(buf, 36, vert_accuracy);
130 
132 #else
133  mavlink_wind_cov_t packet;
134  packet.time_usec = time_usec;
135  packet.wind_x = wind_x;
136  packet.wind_y = wind_y;
137  packet.wind_z = wind_z;
138  packet.var_horiz = var_horiz;
139  packet.var_vert = var_vert;
140  packet.wind_alt = wind_alt;
142  packet.vert_accuracy = vert_accuracy;
143 
145 #endif
146 
147  msg->msgid = MAVLINK_MSG_ID_WIND_COV;
148 #if MAVLINK_CRC_EXTRA
150 #else
151  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_LEN);
152 #endif
153 }
154 
163 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)
164 {
165  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);
166 }
167 
177 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)
178 {
179  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);
180 }
181 
196 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
197 
198 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)
199 {
200 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
201  char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
202  _mav_put_uint64_t(buf, 0, time_usec);
203  _mav_put_float(buf, 8, wind_x);
204  _mav_put_float(buf, 12, wind_y);
205  _mav_put_float(buf, 16, wind_z);
206  _mav_put_float(buf, 20, var_horiz);
207  _mav_put_float(buf, 24, var_vert);
208  _mav_put_float(buf, 28, wind_alt);
209  _mav_put_float(buf, 32, horiz_accuracy);
210  _mav_put_float(buf, 36, vert_accuracy);
211 
212 #if MAVLINK_CRC_EXTRA
213  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
214 #else
215  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN);
216 #endif
217 #else
218  mavlink_wind_cov_t packet;
219  packet.time_usec = time_usec;
220  packet.wind_x = wind_x;
221  packet.wind_y = wind_y;
222  packet.wind_z = wind_z;
223  packet.var_horiz = var_horiz;
224  packet.var_vert = var_vert;
225  packet.wind_alt = wind_alt;
227  packet.vert_accuracy = vert_accuracy;
228 
229 #if MAVLINK_CRC_EXTRA
230  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
231 #else
232  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_LEN);
233 #endif
234 #endif
235 }
236 
237 #if MAVLINK_MSG_ID_WIND_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
238 /*
239  This varient of _send() can be used to save stack space by re-using
240  memory from the receive buffer. The caller provides a
241  mavlink_message_t which is the size of a full mavlink message. This
242  is usually the receive buffer for the channel, and allows a reply to an
243  incoming message with minimum stack space usage.
244  */
245 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)
246 {
247 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
248  char *buf = (char *)msgbuf;
249  _mav_put_uint64_t(buf, 0, time_usec);
250  _mav_put_float(buf, 8, wind_x);
251  _mav_put_float(buf, 12, wind_y);
252  _mav_put_float(buf, 16, wind_z);
253  _mav_put_float(buf, 20, var_horiz);
254  _mav_put_float(buf, 24, var_vert);
255  _mav_put_float(buf, 28, wind_alt);
256  _mav_put_float(buf, 32, horiz_accuracy);
257  _mav_put_float(buf, 36, vert_accuracy);
258 
259 #if MAVLINK_CRC_EXTRA
260  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
261 #else
262  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN);
263 #endif
264 #else
265  mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf;
266  packet->time_usec = time_usec;
267  packet->wind_x = wind_x;
268  packet->wind_y = wind_y;
269  packet->wind_z = wind_z;
270  packet->var_horiz = var_horiz;
271  packet->var_vert = var_vert;
272  packet->wind_alt = wind_alt;
273  packet->horiz_accuracy = horiz_accuracy;
274  packet->vert_accuracy = vert_accuracy;
275 
276 #if MAVLINK_CRC_EXTRA
277  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
278 #else
279  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_LEN);
280 #endif
281 #endif
282 }
283 #endif
284 
285 #endif
286 
287 // MESSAGE WIND_COV UNPACKING
288 
289 
295 static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg)
296 {
297  return _MAV_RETURN_uint64_t(msg, 0);
298 }
299 
305 static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg)
306 {
307  return _MAV_RETURN_float(msg, 8);
308 }
309 
315 static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg)
316 {
317  return _MAV_RETURN_float(msg, 12);
318 }
319 
325 static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg)
326 {
327  return _MAV_RETURN_float(msg, 16);
328 }
329 
335 static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg)
336 {
337  return _MAV_RETURN_float(msg, 20);
338 }
339 
345 static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg)
346 {
347  return _MAV_RETURN_float(msg, 24);
348 }
349 
355 static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg)
356 {
357  return _MAV_RETURN_float(msg, 28);
358 }
359 
365 static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg)
366 {
367  return _MAV_RETURN_float(msg, 32);
368 }
369 
375 static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg)
376 {
377  return _MAV_RETURN_float(msg, 36);
378 }
379 
386 static inline void mavlink_msg_wind_cov_decode(const mavlink_message_t* msg, mavlink_wind_cov_t* wind_cov)
387 {
388 #if MAVLINK_NEED_BYTE_SWAP
390  wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg);
391  wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg);
392  wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg);
398 #else
399  memcpy(wind_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WIND_COV_LEN);
400 #endif
401 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:151
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:149


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:25