RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_airspeed_autocal.h
1#pragma once
2// MESSAGE AIRSPEED_AUTOCAL PACKING
3
4#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL 174
5
6MAVPACKED(
7typedef struct __mavlink_airspeed_autocal_t {
8 float vx; /*< GPS velocity north m/s*/
9 float vy; /*< GPS velocity east m/s*/
10 float vz; /*< GPS velocity down m/s*/
11 float diff_pressure; /*< Differential pressure pascals*/
12 float EAS2TAS; /*< Estimated to true airspeed ratio*/
13 float ratio; /*< Airspeed ratio*/
14 float state_x; /*< EKF state x*/
15 float state_y; /*< EKF state y*/
16 float state_z; /*< EKF state z*/
17 float Pax; /*< EKF Pax*/
18 float Pby; /*< EKF Pby*/
19 float Pcz; /*< EKF Pcz*/
20}) mavlink_airspeed_autocal_t;
21
22#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN 48
23#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN 48
24#define MAVLINK_MSG_ID_174_LEN 48
25#define MAVLINK_MSG_ID_174_MIN_LEN 48
26
27#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC 167
28#define MAVLINK_MSG_ID_174_CRC 167
29
30
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_AIRSPEED_AUTOCAL { \
34 174, \
35 "AIRSPEED_AUTOCAL", \
36 12, \
37 { { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_airspeed_autocal_t, vx) }, \
38 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_airspeed_autocal_t, vy) }, \
39 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_airspeed_autocal_t, vz) }, \
40 { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_airspeed_autocal_t, diff_pressure) }, \
41 { "EAS2TAS", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_airspeed_autocal_t, EAS2TAS) }, \
42 { "ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_airspeed_autocal_t, ratio) }, \
43 { "state_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_airspeed_autocal_t, state_x) }, \
44 { "state_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_airspeed_autocal_t, state_y) }, \
45 { "state_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_airspeed_autocal_t, state_z) }, \
46 { "Pax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_airspeed_autocal_t, Pax) }, \
47 { "Pby", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_airspeed_autocal_t, Pby) }, \
48 { "Pcz", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_airspeed_autocal_t, Pcz) }, \
49 } \
50}
51#else
52#define MAVLINK_MESSAGE_INFO_AIRSPEED_AUTOCAL { \
53 "AIRSPEED_AUTOCAL", \
54 12, \
55 { { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_airspeed_autocal_t, vx) }, \
56 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_airspeed_autocal_t, vy) }, \
57 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_airspeed_autocal_t, vz) }, \
58 { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_airspeed_autocal_t, diff_pressure) }, \
59 { "EAS2TAS", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_airspeed_autocal_t, EAS2TAS) }, \
60 { "ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_airspeed_autocal_t, ratio) }, \
61 { "state_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_airspeed_autocal_t, state_x) }, \
62 { "state_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_airspeed_autocal_t, state_y) }, \
63 { "state_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_airspeed_autocal_t, state_z) }, \
64 { "Pax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_airspeed_autocal_t, Pax) }, \
65 { "Pby", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_airspeed_autocal_t, Pby) }, \
66 { "Pcz", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_airspeed_autocal_t, Pcz) }, \
67 } \
68}
69#endif
70
91static inline uint16_t mavlink_msg_airspeed_autocal_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 float vx, float vy, float vz, float diff_pressure, float EAS2TAS, float ratio, float state_x, float state_y, float state_z, float Pax, float Pby, float Pcz)
93{
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN];
96 _mav_put_float(buf, 0, vx);
97 _mav_put_float(buf, 4, vy);
98 _mav_put_float(buf, 8, vz);
99 _mav_put_float(buf, 12, diff_pressure);
100 _mav_put_float(buf, 16, EAS2TAS);
101 _mav_put_float(buf, 20, ratio);
102 _mav_put_float(buf, 24, state_x);
103 _mav_put_float(buf, 28, state_y);
104 _mav_put_float(buf, 32, state_z);
105 _mav_put_float(buf, 36, Pax);
106 _mav_put_float(buf, 40, Pby);
107 _mav_put_float(buf, 44, Pcz);
108
109 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
110#else
111 mavlink_airspeed_autocal_t packet;
112 packet.vx = vx;
113 packet.vy = vy;
114 packet.vz = vz;
115 packet.diff_pressure = diff_pressure;
116 packet.EAS2TAS = EAS2TAS;
117 packet.ratio = ratio;
118 packet.state_x = state_x;
119 packet.state_y = state_y;
120 packet.state_z = state_z;
121 packet.Pax = Pax;
122 packet.Pby = Pby;
123 packet.Pcz = Pcz;
124
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
126#endif
127
128 msg->msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL;
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
130}
131
152static inline uint16_t mavlink_msg_airspeed_autocal_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
153 mavlink_message_t* msg,
154 float vx,float vy,float vz,float diff_pressure,float EAS2TAS,float ratio,float state_x,float state_y,float state_z,float Pax,float Pby,float Pcz)
155{
156#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157 char buf[MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN];
158 _mav_put_float(buf, 0, vx);
159 _mav_put_float(buf, 4, vy);
160 _mav_put_float(buf, 8, vz);
161 _mav_put_float(buf, 12, diff_pressure);
162 _mav_put_float(buf, 16, EAS2TAS);
163 _mav_put_float(buf, 20, ratio);
164 _mav_put_float(buf, 24, state_x);
165 _mav_put_float(buf, 28, state_y);
166 _mav_put_float(buf, 32, state_z);
167 _mav_put_float(buf, 36, Pax);
168 _mav_put_float(buf, 40, Pby);
169 _mav_put_float(buf, 44, Pcz);
170
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
172#else
173 mavlink_airspeed_autocal_t packet;
174 packet.vx = vx;
175 packet.vy = vy;
176 packet.vz = vz;
177 packet.diff_pressure = diff_pressure;
178 packet.EAS2TAS = EAS2TAS;
179 packet.ratio = ratio;
180 packet.state_x = state_x;
181 packet.state_y = state_y;
182 packet.state_z = state_z;
183 packet.Pax = Pax;
184 packet.Pby = Pby;
185 packet.Pcz = Pcz;
186
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
188#endif
189
190 msg->msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL;
191 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
192}
193
202static inline uint16_t mavlink_msg_airspeed_autocal_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_airspeed_autocal_t* airspeed_autocal)
203{
204 return mavlink_msg_airspeed_autocal_pack(system_id, component_id, msg, airspeed_autocal->vx, airspeed_autocal->vy, airspeed_autocal->vz, airspeed_autocal->diff_pressure, airspeed_autocal->EAS2TAS, airspeed_autocal->ratio, airspeed_autocal->state_x, airspeed_autocal->state_y, airspeed_autocal->state_z, airspeed_autocal->Pax, airspeed_autocal->Pby, airspeed_autocal->Pcz);
205}
206
216static inline uint16_t mavlink_msg_airspeed_autocal_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_airspeed_autocal_t* airspeed_autocal)
217{
218 return mavlink_msg_airspeed_autocal_pack_chan(system_id, component_id, chan, msg, airspeed_autocal->vx, airspeed_autocal->vy, airspeed_autocal->vz, airspeed_autocal->diff_pressure, airspeed_autocal->EAS2TAS, airspeed_autocal->ratio, airspeed_autocal->state_x, airspeed_autocal->state_y, airspeed_autocal->state_z, airspeed_autocal->Pax, airspeed_autocal->Pby, airspeed_autocal->Pcz);
219}
220
238#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
239
240static inline void mavlink_msg_airspeed_autocal_send(mavlink_channel_t chan, float vx, float vy, float vz, float diff_pressure, float EAS2TAS, float ratio, float state_x, float state_y, float state_z, float Pax, float Pby, float Pcz)
241{
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 char buf[MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN];
244 _mav_put_float(buf, 0, vx);
245 _mav_put_float(buf, 4, vy);
246 _mav_put_float(buf, 8, vz);
247 _mav_put_float(buf, 12, diff_pressure);
248 _mav_put_float(buf, 16, EAS2TAS);
249 _mav_put_float(buf, 20, ratio);
250 _mav_put_float(buf, 24, state_x);
251 _mav_put_float(buf, 28, state_y);
252 _mav_put_float(buf, 32, state_z);
253 _mav_put_float(buf, 36, Pax);
254 _mav_put_float(buf, 40, Pby);
255 _mav_put_float(buf, 44, Pcz);
256
257 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
258#else
259 mavlink_airspeed_autocal_t packet;
260 packet.vx = vx;
261 packet.vy = vy;
262 packet.vz = vz;
263 packet.diff_pressure = diff_pressure;
264 packet.EAS2TAS = EAS2TAS;
265 packet.ratio = ratio;
266 packet.state_x = state_x;
267 packet.state_y = state_y;
268 packet.state_z = state_z;
269 packet.Pax = Pax;
270 packet.Pby = Pby;
271 packet.Pcz = Pcz;
272
273 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, (const char *)&packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
274#endif
275}
276
282static inline void mavlink_msg_airspeed_autocal_send_struct(mavlink_channel_t chan, const mavlink_airspeed_autocal_t* airspeed_autocal)
283{
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 mavlink_msg_airspeed_autocal_send(chan, airspeed_autocal->vx, airspeed_autocal->vy, airspeed_autocal->vz, airspeed_autocal->diff_pressure, airspeed_autocal->EAS2TAS, airspeed_autocal->ratio, airspeed_autocal->state_x, airspeed_autocal->state_y, airspeed_autocal->state_z, airspeed_autocal->Pax, airspeed_autocal->Pby, airspeed_autocal->Pcz);
286#else
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, (const char *)airspeed_autocal, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
288#endif
289}
290
291#if MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
292/*
293 This varient of _send() can be used to save stack space by re-using
294 memory from the receive buffer. The caller provides a
295 mavlink_message_t which is the size of a full mavlink message. This
296 is usually the receive buffer for the channel, and allows a reply to an
297 incoming message with minimum stack space usage.
298 */
299static inline void mavlink_msg_airspeed_autocal_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float vx, float vy, float vz, float diff_pressure, float EAS2TAS, float ratio, float state_x, float state_y, float state_z, float Pax, float Pby, float Pcz)
300{
301#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
302 char *buf = (char *)msgbuf;
303 _mav_put_float(buf, 0, vx);
304 _mav_put_float(buf, 4, vy);
305 _mav_put_float(buf, 8, vz);
306 _mav_put_float(buf, 12, diff_pressure);
307 _mav_put_float(buf, 16, EAS2TAS);
308 _mav_put_float(buf, 20, ratio);
309 _mav_put_float(buf, 24, state_x);
310 _mav_put_float(buf, 28, state_y);
311 _mav_put_float(buf, 32, state_z);
312 _mav_put_float(buf, 36, Pax);
313 _mav_put_float(buf, 40, Pby);
314 _mav_put_float(buf, 44, Pcz);
315
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
317#else
318 mavlink_airspeed_autocal_t *packet = (mavlink_airspeed_autocal_t *)msgbuf;
319 packet->vx = vx;
320 packet->vy = vy;
321 packet->vz = vz;
322 packet->diff_pressure = diff_pressure;
323 packet->EAS2TAS = EAS2TAS;
324 packet->ratio = ratio;
325 packet->state_x = state_x;
326 packet->state_y = state_y;
327 packet->state_z = state_z;
328 packet->Pax = Pax;
329 packet->Pby = Pby;
330 packet->Pcz = Pcz;
331
332 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, (const char *)packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
333#endif
334}
335#endif
336
337#endif
338
339// MESSAGE AIRSPEED_AUTOCAL UNPACKING
340
341
347static inline float mavlink_msg_airspeed_autocal_get_vx(const mavlink_message_t* msg)
348{
349 return _MAV_RETURN_float(msg, 0);
350}
351
357static inline float mavlink_msg_airspeed_autocal_get_vy(const mavlink_message_t* msg)
358{
359 return _MAV_RETURN_float(msg, 4);
360}
361
367static inline float mavlink_msg_airspeed_autocal_get_vz(const mavlink_message_t* msg)
368{
369 return _MAV_RETURN_float(msg, 8);
370}
371
377static inline float mavlink_msg_airspeed_autocal_get_diff_pressure(const mavlink_message_t* msg)
378{
379 return _MAV_RETURN_float(msg, 12);
380}
381
387static inline float mavlink_msg_airspeed_autocal_get_EAS2TAS(const mavlink_message_t* msg)
388{
389 return _MAV_RETURN_float(msg, 16);
390}
391
397static inline float mavlink_msg_airspeed_autocal_get_ratio(const mavlink_message_t* msg)
398{
399 return _MAV_RETURN_float(msg, 20);
400}
401
407static inline float mavlink_msg_airspeed_autocal_get_state_x(const mavlink_message_t* msg)
408{
409 return _MAV_RETURN_float(msg, 24);
410}
411
417static inline float mavlink_msg_airspeed_autocal_get_state_y(const mavlink_message_t* msg)
418{
419 return _MAV_RETURN_float(msg, 28);
420}
421
427static inline float mavlink_msg_airspeed_autocal_get_state_z(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_float(msg, 32);
430}
431
437static inline float mavlink_msg_airspeed_autocal_get_Pax(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_float(msg, 36);
440}
441
447static inline float mavlink_msg_airspeed_autocal_get_Pby(const mavlink_message_t* msg)
448{
449 return _MAV_RETURN_float(msg, 40);
450}
451
457static inline float mavlink_msg_airspeed_autocal_get_Pcz(const mavlink_message_t* msg)
458{
459 return _MAV_RETURN_float(msg, 44);
460}
461
468static inline void mavlink_msg_airspeed_autocal_decode(const mavlink_message_t* msg, mavlink_airspeed_autocal_t* airspeed_autocal)
469{
470#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
471 airspeed_autocal->vx = mavlink_msg_airspeed_autocal_get_vx(msg);
472 airspeed_autocal->vy = mavlink_msg_airspeed_autocal_get_vy(msg);
473 airspeed_autocal->vz = mavlink_msg_airspeed_autocal_get_vz(msg);
474 airspeed_autocal->diff_pressure = mavlink_msg_airspeed_autocal_get_diff_pressure(msg);
475 airspeed_autocal->EAS2TAS = mavlink_msg_airspeed_autocal_get_EAS2TAS(msg);
476 airspeed_autocal->ratio = mavlink_msg_airspeed_autocal_get_ratio(msg);
477 airspeed_autocal->state_x = mavlink_msg_airspeed_autocal_get_state_x(msg);
478 airspeed_autocal->state_y = mavlink_msg_airspeed_autocal_get_state_y(msg);
479 airspeed_autocal->state_z = mavlink_msg_airspeed_autocal_get_state_z(msg);
480 airspeed_autocal->Pax = mavlink_msg_airspeed_autocal_get_Pax(msg);
481 airspeed_autocal->Pby = mavlink_msg_airspeed_autocal_get_Pby(msg);
482 airspeed_autocal->Pcz = mavlink_msg_airspeed_autocal_get_Pcz(msg);
483#else
484 uint8_t len = msg->len < MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN? msg->len : MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN;
485 memset(airspeed_autocal, 0, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
486 memcpy(airspeed_autocal, _MAV_PAYLOAD(msg), len);
487#endif
488}