mavlink_msg_attitude_correction.h
Go to the documentation of this file.
1 // MESSAGE ATTITUDE_CORRECTION PACKING
2 
3 #define MAVLINK_MSG_ID_ATTITUDE_CORRECTION 195
4 
6 {
7  float qw; /*< Quaternion scalar value*/
8  float qx; /*< Quaternion x value*/
9  float qy; /*< Quaternion y value*/
10  float qz; /*< Quaternion z value*/
12 
13 #define MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN 16
14 #define MAVLINK_MSG_ID_195_LEN 16
15 
16 #define MAVLINK_MSG_ID_ATTITUDE_CORRECTION_CRC 253
17 #define MAVLINK_MSG_ID_195_CRC 253
18 
19 
20 
21 #define MAVLINK_MESSAGE_INFO_ATTITUDE_CORRECTION { \
22  "ATTITUDE_CORRECTION", \
23  4, \
24  { { "qw", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_attitude_correction_t, qw) }, \
25  { "qx", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_correction_t, qx) }, \
26  { "qy", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_correction_t, qy) }, \
27  { "qz", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_correction_t, qz) }, \
28  } \
29 }
30 
31 
44 static inline uint16_t mavlink_msg_attitude_correction_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
45  float qw, float qx, float qy, float qz)
46 {
47 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
49  _mav_put_float(buf, 0, qw);
50  _mav_put_float(buf, 4, qx);
51  _mav_put_float(buf, 8, qy);
52  _mav_put_float(buf, 12, qz);
53 
55 #else
57  packet.qw = qw;
58  packet.qx = qx;
59  packet.qy = qy;
60  packet.qz = qz;
61 
63 #endif
64 
66 #if MAVLINK_CRC_EXTRA
68 #else
69  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
70 #endif
71 }
72 
85 static inline uint16_t mavlink_msg_attitude_correction_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
86  mavlink_message_t* msg,
87  float qw,float qx,float qy,float qz)
88 {
89 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91  _mav_put_float(buf, 0, qw);
92  _mav_put_float(buf, 4, qx);
93  _mav_put_float(buf, 8, qy);
94  _mav_put_float(buf, 12, qz);
95 
97 #else
99  packet.qw = qw;
100  packet.qx = qx;
101  packet.qy = qy;
102  packet.qz = qz;
103 
105 #endif
106 
108 #if MAVLINK_CRC_EXTRA
110 #else
111  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
112 #endif
113 }
114 
123 static inline uint16_t mavlink_msg_attitude_correction_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_correction_t* attitude_correction)
124 {
125  return mavlink_msg_attitude_correction_pack(system_id, component_id, msg, attitude_correction->qw, attitude_correction->qx, attitude_correction->qy, attitude_correction->qz);
126 }
127 
137 static inline uint16_t mavlink_msg_attitude_correction_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_correction_t* attitude_correction)
138 {
139  return mavlink_msg_attitude_correction_pack_chan(system_id, component_id, chan, msg, attitude_correction->qw, attitude_correction->qx, attitude_correction->qy, attitude_correction->qz);
140 }
141 
151 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
152 
153 static inline void mavlink_msg_attitude_correction_send(mavlink_channel_t chan, float qw, float qx, float qy, float qz)
154 {
155 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157  _mav_put_float(buf, 0, qw);
158  _mav_put_float(buf, 4, qx);
159  _mav_put_float(buf, 8, qy);
160  _mav_put_float(buf, 12, qz);
161 
162 #if MAVLINK_CRC_EXTRA
164 #else
165  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CORRECTION, buf, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
166 #endif
167 #else
169  packet.qw = qw;
170  packet.qx = qx;
171  packet.qy = qy;
172  packet.qz = qz;
173 
174 #if MAVLINK_CRC_EXTRA
175  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CORRECTION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_CRC);
176 #else
177  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CORRECTION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
178 #endif
179 #endif
180 }
181 
182 #if MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
183 /*
184  This varient of _send() can be used to save stack space by re-using
185  memory from the receive buffer. The caller provides a
186  mavlink_message_t which is the size of a full mavlink message. This
187  is usually the receive buffer for the channel, and allows a reply to an
188  incoming message with minimum stack space usage.
189  */
190 static inline void mavlink_msg_attitude_correction_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float qw, float qx, float qy, float qz)
191 {
192 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193  char *buf = (char *)msgbuf;
194  _mav_put_float(buf, 0, qw);
195  _mav_put_float(buf, 4, qx);
196  _mav_put_float(buf, 8, qy);
197  _mav_put_float(buf, 12, qz);
198 
199 #if MAVLINK_CRC_EXTRA
201 #else
202  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CORRECTION, buf, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
203 #endif
204 #else
206  packet->qw = qw;
207  packet->qx = qx;
208  packet->qy = qy;
209  packet->qz = qz;
210 
211 #if MAVLINK_CRC_EXTRA
213 #else
214  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CORRECTION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
215 #endif
216 #endif
217 }
218 #endif
219 
220 #endif
221 
222 // MESSAGE ATTITUDE_CORRECTION UNPACKING
223 
224 
230 static inline float mavlink_msg_attitude_correction_get_qw(const mavlink_message_t* msg)
231 {
232  return _MAV_RETURN_float(msg, 0);
233 }
234 
240 static inline float mavlink_msg_attitude_correction_get_qx(const mavlink_message_t* msg)
241 {
242  return _MAV_RETURN_float(msg, 4);
243 }
244 
250 static inline float mavlink_msg_attitude_correction_get_qy(const mavlink_message_t* msg)
251 {
252  return _MAV_RETURN_float(msg, 8);
253 }
254 
260 static inline float mavlink_msg_attitude_correction_get_qz(const mavlink_message_t* msg)
261 {
262  return _MAV_RETURN_float(msg, 12);
263 }
264 
271 static inline void mavlink_msg_attitude_correction_decode(const mavlink_message_t* msg, mavlink_attitude_correction_t* attitude_correction)
272 {
273 #if MAVLINK_NEED_BYTE_SWAP
274  attitude_correction->qw = mavlink_msg_attitude_correction_get_qw(msg);
275  attitude_correction->qx = mavlink_msg_attitude_correction_get_qx(msg);
276  attitude_correction->qy = mavlink_msg_attitude_correction_get_qy(msg);
277  attitude_correction->qz = mavlink_msg_attitude_correction_get_qz(msg);
278 #else
279  memcpy(attitude_correction, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_CORRECTION_LEN);
280 #endif
281 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:151


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:18