mavlink_msg_camera_stamped_small_imu.h
Go to the documentation of this file.
1 // MESSAGE CAMERA_STAMPED_SMALL_IMU PACKING
2 
3 #define MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU 185
4 
6 {
7  uint64_t time_boot_us; /*< Measurement timestamp as microseconds since boot*/
8  float xacc; /*< Acceleration along X axis*/
9  float yacc; /*< Acceleration along Y axis*/
10  float zacc; /*< Acceleration along Z axis*/
11  float xgyro; /*< Angular speed around X axis*/
12  float ygyro; /*< Angular speed around Y axis*/
13  float zgyro; /*< Angular speed around Z axis*/
14  float temperature; /*< Internal temperature measurement*/
15  uint8_t image; /*< True if there is an image associated with this measurement*/
17 
18 #define MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_LEN 37
19 #define MAVLINK_MSG_ID_185_LEN 37
20 
21 #define MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_CRC 209
22 #define MAVLINK_MSG_ID_185_CRC 209
23 
24 
25 
26 #define MAVLINK_MESSAGE_INFO_CAMERA_STAMPED_SMALL_IMU { \
27  "CAMERA_STAMPED_SMALL_IMU", \
28  9, \
29  { { "time_boot_us", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_stamped_small_imu_t, time_boot_us) }, \
30  { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_stamped_small_imu_t, xacc) }, \
31  { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_stamped_small_imu_t, yacc) }, \
32  { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_stamped_small_imu_t, zacc) }, \
33  { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_stamped_small_imu_t, xgyro) }, \
34  { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_camera_stamped_small_imu_t, ygyro) }, \
35  { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_camera_stamped_small_imu_t, zgyro) }, \
36  { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_camera_stamped_small_imu_t, temperature) }, \
37  { "image", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_camera_stamped_small_imu_t, image) }, \
38  } \
39 }
40 
41 
59 static inline uint16_t mavlink_msg_camera_stamped_small_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
60  uint64_t time_boot_us, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float temperature, uint8_t image)
61 {
62 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
64  _mav_put_uint64_t(buf, 0, time_boot_us);
65  _mav_put_float(buf, 8, xacc);
66  _mav_put_float(buf, 12, yacc);
67  _mav_put_float(buf, 16, zacc);
68  _mav_put_float(buf, 20, xgyro);
69  _mav_put_float(buf, 24, ygyro);
70  _mav_put_float(buf, 28, zgyro);
71  _mav_put_float(buf, 32, temperature);
72  _mav_put_uint8_t(buf, 36, image);
73 
75 #else
77  packet.time_boot_us = time_boot_us;
78  packet.xacc = xacc;
79  packet.yacc = yacc;
80  packet.zacc = zacc;
81  packet.xgyro = xgyro;
82  packet.ygyro = ygyro;
83  packet.zgyro = zgyro;
84  packet.temperature = temperature;
85  packet.image = image;
86 
88 #endif
89 
91 #if MAVLINK_CRC_EXTRA
93 #else
94  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_LEN);
95 #endif
96 }
97 
115 static inline uint16_t mavlink_msg_camera_stamped_small_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
116  mavlink_message_t* msg,
117  uint64_t time_boot_us,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float temperature,uint8_t image)
118 {
119 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
121  _mav_put_uint64_t(buf, 0, time_boot_us);
122  _mav_put_float(buf, 8, xacc);
123  _mav_put_float(buf, 12, yacc);
124  _mav_put_float(buf, 16, zacc);
125  _mav_put_float(buf, 20, xgyro);
126  _mav_put_float(buf, 24, ygyro);
127  _mav_put_float(buf, 28, zgyro);
128  _mav_put_float(buf, 32, temperature);
129  _mav_put_uint8_t(buf, 36, image);
130 
132 #else
134  packet.time_boot_us = time_boot_us;
135  packet.xacc = xacc;
136  packet.yacc = yacc;
137  packet.zacc = zacc;
138  packet.xgyro = xgyro;
139  packet.ygyro = ygyro;
140  packet.zgyro = zgyro;
141  packet.temperature = temperature;
142  packet.image = image;
143 
145 #endif
146 
148 #if MAVLINK_CRC_EXTRA
150 #else
151  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_LEN);
152 #endif
153 }
154 
163 static inline uint16_t mavlink_msg_camera_stamped_small_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_stamped_small_imu_t* camera_stamped_small_imu)
164 {
165  return mavlink_msg_camera_stamped_small_imu_pack(system_id, component_id, msg, camera_stamped_small_imu->time_boot_us, camera_stamped_small_imu->xacc, camera_stamped_small_imu->yacc, camera_stamped_small_imu->zacc, camera_stamped_small_imu->xgyro, camera_stamped_small_imu->ygyro, camera_stamped_small_imu->zgyro, camera_stamped_small_imu->temperature, camera_stamped_small_imu->image);
166 }
167 
177 static inline uint16_t mavlink_msg_camera_stamped_small_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_stamped_small_imu_t* camera_stamped_small_imu)
178 {
179  return mavlink_msg_camera_stamped_small_imu_pack_chan(system_id, component_id, chan, msg, camera_stamped_small_imu->time_boot_us, camera_stamped_small_imu->xacc, camera_stamped_small_imu->yacc, camera_stamped_small_imu->zacc, camera_stamped_small_imu->xgyro, camera_stamped_small_imu->ygyro, camera_stamped_small_imu->zgyro, camera_stamped_small_imu->temperature, camera_stamped_small_imu->image);
180 }
181 
196 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
197 
198 static inline void mavlink_msg_camera_stamped_small_imu_send(mavlink_channel_t chan, uint64_t time_boot_us, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float temperature, uint8_t image)
199 {
200 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
203  _mav_put_float(buf, 8, xacc);
204  _mav_put_float(buf, 12, yacc);
205  _mav_put_float(buf, 16, zacc);
206  _mav_put_float(buf, 20, xgyro);
207  _mav_put_float(buf, 24, ygyro);
208  _mav_put_float(buf, 28, zgyro);
209  _mav_put_float(buf, 32, temperature);
210  _mav_put_uint8_t(buf, 36, image);
211 
212 #if MAVLINK_CRC_EXTRA
214 #else
216 #endif
217 #else
219  packet.time_boot_us = time_boot_us;
220  packet.xacc = xacc;
221  packet.yacc = yacc;
222  packet.zacc = zacc;
223  packet.xgyro = xgyro;
224  packet.ygyro = ygyro;
225  packet.zgyro = zgyro;
226  packet.temperature = temperature;
227  packet.image = image;
228 
229 #if MAVLINK_CRC_EXTRA
231 #else
232  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_LEN);
233 #endif
234 #endif
235 }
236 
237 #if MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_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_camera_stamped_small_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_boot_us, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float temperature, uint8_t image)
246 {
247 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
248  char *buf = (char *)msgbuf;
250  _mav_put_float(buf, 8, xacc);
251  _mav_put_float(buf, 12, yacc);
252  _mav_put_float(buf, 16, zacc);
253  _mav_put_float(buf, 20, xgyro);
254  _mav_put_float(buf, 24, ygyro);
255  _mav_put_float(buf, 28, zgyro);
256  _mav_put_float(buf, 32, temperature);
257  _mav_put_uint8_t(buf, 36, image);
258 
259 #if MAVLINK_CRC_EXTRA
261 #else
263 #endif
264 #else
266  packet->time_boot_us = time_boot_us;
267  packet->xacc = xacc;
268  packet->yacc = yacc;
269  packet->zacc = zacc;
270  packet->xgyro = xgyro;
271  packet->ygyro = ygyro;
272  packet->zgyro = zgyro;
273  packet->temperature = temperature;
274  packet->image = image;
275 
276 #if MAVLINK_CRC_EXTRA
278 #else
279  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU, (const char *)packet, MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_LEN);
280 #endif
281 #endif
282 }
283 #endif
284 
285 #endif
286 
287 // MESSAGE CAMERA_STAMPED_SMALL_IMU UNPACKING
288 
289 
295 static inline uint64_t mavlink_msg_camera_stamped_small_imu_get_time_boot_us(const mavlink_message_t* msg)
296 {
297  return _MAV_RETURN_uint64_t(msg, 0);
298 }
299 
305 static inline float mavlink_msg_camera_stamped_small_imu_get_xacc(const mavlink_message_t* msg)
306 {
307  return _MAV_RETURN_float(msg, 8);
308 }
309 
315 static inline float mavlink_msg_camera_stamped_small_imu_get_yacc(const mavlink_message_t* msg)
316 {
317  return _MAV_RETURN_float(msg, 12);
318 }
319 
325 static inline float mavlink_msg_camera_stamped_small_imu_get_zacc(const mavlink_message_t* msg)
326 {
327  return _MAV_RETURN_float(msg, 16);
328 }
329 
335 static inline float mavlink_msg_camera_stamped_small_imu_get_xgyro(const mavlink_message_t* msg)
336 {
337  return _MAV_RETURN_float(msg, 20);
338 }
339 
345 static inline float mavlink_msg_camera_stamped_small_imu_get_ygyro(const mavlink_message_t* msg)
346 {
347  return _MAV_RETURN_float(msg, 24);
348 }
349 
355 static inline float mavlink_msg_camera_stamped_small_imu_get_zgyro(const mavlink_message_t* msg)
356 {
357  return _MAV_RETURN_float(msg, 28);
358 }
359 
365 static inline float mavlink_msg_camera_stamped_small_imu_get_temperature(const mavlink_message_t* msg)
366 {
367  return _MAV_RETURN_float(msg, 32);
368 }
369 
375 static inline uint8_t mavlink_msg_camera_stamped_small_imu_get_image(const mavlink_message_t* msg)
376 {
377  return _MAV_RETURN_uint8_t(msg, 36);
378 }
379 
386 static inline void mavlink_msg_camera_stamped_small_imu_decode(const mavlink_message_t* msg, mavlink_camera_stamped_small_imu_t* camera_stamped_small_imu)
387 {
388 #if MAVLINK_NEED_BYTE_SWAP
390  camera_stamped_small_imu->xacc = mavlink_msg_camera_stamped_small_imu_get_xacc(msg);
391  camera_stamped_small_imu->yacc = mavlink_msg_camera_stamped_small_imu_get_yacc(msg);
392  camera_stamped_small_imu->zacc = mavlink_msg_camera_stamped_small_imu_get_zacc(msg);
393  camera_stamped_small_imu->xgyro = mavlink_msg_camera_stamped_small_imu_get_xgyro(msg);
394  camera_stamped_small_imu->ygyro = mavlink_msg_camera_stamped_small_imu_get_ygyro(msg);
395  camera_stamped_small_imu->zgyro = mavlink_msg_camera_stamped_small_imu_get_zgyro(msg);
396  camera_stamped_small_imu->temperature = mavlink_msg_camera_stamped_small_imu_get_temperature(msg);
397  camera_stamped_small_imu->image = mavlink_msg_camera_stamped_small_imu_get_image(msg);
398 #else
399  memcpy(camera_stamped_small_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CAMERA_STAMPED_SMALL_IMU_LEN);
400 #endif
401 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:151
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:244
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:140
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:149


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:46