mavlink_msg_image_available.h 21.8 KB
Newer Older
James Goppert's avatar
James Goppert committed
1 2
// MESSAGE IMAGE_AVAILABLE PACKING

lm's avatar
lm committed
3
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE 154
James Goppert's avatar
James Goppert committed
4

lm's avatar
lm committed
5
typedef struct __mavlink_image_available_t
James Goppert's avatar
James Goppert committed
6
{
lm's avatar
lm committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 uint64_t cam_id; ///< Camera id
 uint64_t timestamp; ///< Timestamp
 uint64_t valid_until; ///< Until which timestamp this buffer will stay valid
 uint32_t img_seq; ///< The image sequence number
 uint32_t img_buf_index; ///< Position of the image in the buffer, starts with 0
 uint32_t key; ///< Shared memory area key
 uint32_t exposure; ///< Exposure time, in microseconds
 float gain; ///< Camera gain
 float roll; ///< Roll angle in rad
 float pitch; ///< Pitch angle in rad
 float yaw; ///< Yaw angle in rad
 float local_z; ///< Local frame Z coordinate (height over ground)
 float lat; ///< GPS X coordinate
 float lon; ///< GPS Y coordinate
 float alt; ///< Global frame altitude
 float ground_x; ///< Ground truth X
 float ground_y; ///< Ground truth Y
 float ground_z; ///< Ground truth Z
 uint16_t width; ///< Image width
 uint16_t height; ///< Image height
 uint16_t depth; ///< Image depth
 uint8_t cam_no; ///< Camera # (starts with 0)
 uint8_t channels; ///< Image channels
James Goppert's avatar
James Goppert committed
30 31
} mavlink_image_available_t;

lm's avatar
lm committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN 92
#define MAVLINK_MSG_ID_154_LEN 92



#define MAVLINK_MESSAGE_INFO_IMAGE_AVAILABLE { \
	"IMAGE_AVAILABLE", \
	23, \
	{  { "cam_id", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_image_available_t, cam_id) }, \
         { "timestamp", MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_image_available_t, timestamp) }, \
         { "valid_until", MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_image_available_t, valid_until) }, \
         { "img_seq", MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_image_available_t, img_seq) }, \
         { "img_buf_index", MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_image_available_t, img_buf_index) }, \
         { "key", MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_image_available_t, key) }, \
         { "exposure", MAVLINK_TYPE_UINT32_T, 0, 36, offsetof(mavlink_image_available_t, exposure) }, \
         { "gain", MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_image_available_t, gain) }, \
         { "roll", MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_image_available_t, roll) }, \
         { "pitch", MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_image_available_t, pitch) }, \
         { "yaw", MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_image_available_t, yaw) }, \
         { "local_z", MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_image_available_t, local_z) }, \
         { "lat", MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_image_available_t, lat) }, \
         { "lon", MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_image_available_t, lon) }, \
         { "alt", MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_image_available_t, alt) }, \
         { "ground_x", MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_image_available_t, ground_x) }, \
         { "ground_y", MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_image_available_t, ground_y) }, \
         { "ground_z", MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_image_available_t, ground_z) }, \
         { "width", MAVLINK_TYPE_UINT16_T, 0, 84, offsetof(mavlink_image_available_t, width) }, \
         { "height", MAVLINK_TYPE_UINT16_T, 0, 86, offsetof(mavlink_image_available_t, height) }, \
         { "depth", MAVLINK_TYPE_UINT16_T, 0, 88, offsetof(mavlink_image_available_t, depth) }, \
         { "cam_no", MAVLINK_TYPE_UINT8_T, 0, 90, offsetof(mavlink_image_available_t, cam_no) }, \
         { "channels", MAVLINK_TYPE_UINT8_T, 0, 91, offsetof(mavlink_image_available_t, channels) }, \
         } \
}


James Goppert's avatar
James Goppert committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
/**
 * @brief Pack a image_available message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param cam_id Camera id
 * @param cam_no Camera # (starts with 0)
 * @param timestamp Timestamp
 * @param valid_until Until which timestamp this buffer will stay valid
 * @param img_seq The image sequence number
 * @param img_buf_index Position of the image in the buffer, starts with 0
 * @param width Image width
 * @param height Image height
 * @param depth Image depth
 * @param channels Image channels
 * @param key Shared memory area key
 * @param exposure Exposure time, in microseconds
 * @param gain Camera gain
 * @param roll Roll angle in rad
 * @param pitch Pitch angle in rad
 * @param yaw Yaw angle in rad
 * @param local_z Local frame Z coordinate (height over ground)
 * @param lat GPS X coordinate
 * @param lon GPS Y coordinate
 * @param alt Global frame altitude
LM's avatar
LM committed
93 94 95
 * @param ground_x Ground truth X
 * @param ground_y Ground truth Y
 * @param ground_z Ground truth Z
James Goppert's avatar
James Goppert committed
96 97
 * @return length of the message in bytes (excluding serial stream start sign)
 */
lm's avatar
lm committed
98 99
static inline uint16_t mavlink_msg_image_available_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
						       uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
James Goppert's avatar
James Goppert committed
100
{
LM's avatar
LM committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[92];
	_mav_put_uint64_t(buf, 0, cam_id);
	_mav_put_uint64_t(buf, 8, timestamp);
	_mav_put_uint64_t(buf, 16, valid_until);
	_mav_put_uint32_t(buf, 24, img_seq);
	_mav_put_uint32_t(buf, 28, img_buf_index);
	_mav_put_uint32_t(buf, 32, key);
	_mav_put_uint32_t(buf, 36, exposure);
	_mav_put_float(buf, 40, gain);
	_mav_put_float(buf, 44, roll);
	_mav_put_float(buf, 48, pitch);
	_mav_put_float(buf, 52, yaw);
	_mav_put_float(buf, 56, local_z);
	_mav_put_float(buf, 60, lat);
	_mav_put_float(buf, 64, lon);
	_mav_put_float(buf, 68, alt);
	_mav_put_float(buf, 72, ground_x);
	_mav_put_float(buf, 76, ground_y);
	_mav_put_float(buf, 80, ground_z);
	_mav_put_uint16_t(buf, 84, width);
	_mav_put_uint16_t(buf, 86, height);
	_mav_put_uint16_t(buf, 88, depth);
	_mav_put_uint8_t(buf, 90, cam_no);
	_mav_put_uint8_t(buf, 91, channels);

        memcpy(_MAV_PAYLOAD(msg), buf, 92);
#else
	mavlink_image_available_t packet;
	packet.cam_id = cam_id;
	packet.timestamp = timestamp;
	packet.valid_until = valid_until;
	packet.img_seq = img_seq;
	packet.img_buf_index = img_buf_index;
	packet.key = key;
	packet.exposure = exposure;
	packet.gain = gain;
	packet.roll = roll;
	packet.pitch = pitch;
	packet.yaw = yaw;
	packet.local_z = local_z;
	packet.lat = lat;
	packet.lon = lon;
	packet.alt = alt;
	packet.ground_x = ground_x;
	packet.ground_y = ground_y;
	packet.ground_z = ground_z;
	packet.width = width;
	packet.height = height;
	packet.depth = depth;
	packet.cam_no = cam_no;
	packet.channels = channels;

        memcpy(_MAV_PAYLOAD(msg), &packet, 92);
#endif
lm's avatar
lm committed
156

LM's avatar
LM committed
157
	msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
lm's avatar
lm committed
158
	return mavlink_finalize_message(msg, system_id, component_id, 92, 224);
James Goppert's avatar
James Goppert committed
159 160 161
}

/**
lm's avatar
lm committed
162
 * @brief Pack a image_available message on a channel
James Goppert's avatar
James Goppert committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message was sent over
 * @param msg The MAVLink message to compress the data into
 * @param cam_id Camera id
 * @param cam_no Camera # (starts with 0)
 * @param timestamp Timestamp
 * @param valid_until Until which timestamp this buffer will stay valid
 * @param img_seq The image sequence number
 * @param img_buf_index Position of the image in the buffer, starts with 0
 * @param width Image width
 * @param height Image height
 * @param depth Image depth
 * @param channels Image channels
 * @param key Shared memory area key
 * @param exposure Exposure time, in microseconds
 * @param gain Camera gain
 * @param roll Roll angle in rad
 * @param pitch Pitch angle in rad
 * @param yaw Yaw angle in rad
 * @param local_z Local frame Z coordinate (height over ground)
 * @param lat GPS X coordinate
 * @param lon GPS Y coordinate
 * @param alt Global frame altitude
LM's avatar
LM committed
187 188 189
 * @param ground_x Ground truth X
 * @param ground_y Ground truth Y
 * @param ground_z Ground truth Z
James Goppert's avatar
James Goppert committed
190 191
 * @return length of the message in bytes (excluding serial stream start sign)
 */
lm's avatar
lm committed
192 193 194
static inline uint16_t mavlink_msg_image_available_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
							   mavlink_message_t* msg,
						           uint64_t cam_id,uint8_t cam_no,uint64_t timestamp,uint64_t valid_until,uint32_t img_seq,uint32_t img_buf_index,uint16_t width,uint16_t height,uint16_t depth,uint8_t channels,uint32_t key,uint32_t exposure,float gain,float roll,float pitch,float yaw,float local_z,float lat,float lon,float alt,float ground_x,float ground_y,float ground_z)
James Goppert's avatar
James Goppert committed
195
{
LM's avatar
LM committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[92];
	_mav_put_uint64_t(buf, 0, cam_id);
	_mav_put_uint64_t(buf, 8, timestamp);
	_mav_put_uint64_t(buf, 16, valid_until);
	_mav_put_uint32_t(buf, 24, img_seq);
	_mav_put_uint32_t(buf, 28, img_buf_index);
	_mav_put_uint32_t(buf, 32, key);
	_mav_put_uint32_t(buf, 36, exposure);
	_mav_put_float(buf, 40, gain);
	_mav_put_float(buf, 44, roll);
	_mav_put_float(buf, 48, pitch);
	_mav_put_float(buf, 52, yaw);
	_mav_put_float(buf, 56, local_z);
	_mav_put_float(buf, 60, lat);
	_mav_put_float(buf, 64, lon);
	_mav_put_float(buf, 68, alt);
	_mav_put_float(buf, 72, ground_x);
	_mav_put_float(buf, 76, ground_y);
	_mav_put_float(buf, 80, ground_z);
	_mav_put_uint16_t(buf, 84, width);
	_mav_put_uint16_t(buf, 86, height);
	_mav_put_uint16_t(buf, 88, depth);
	_mav_put_uint8_t(buf, 90, cam_no);
	_mav_put_uint8_t(buf, 91, channels);

        memcpy(_MAV_PAYLOAD(msg), buf, 92);
#else
	mavlink_image_available_t packet;
	packet.cam_id = cam_id;
	packet.timestamp = timestamp;
	packet.valid_until = valid_until;
	packet.img_seq = img_seq;
	packet.img_buf_index = img_buf_index;
	packet.key = key;
	packet.exposure = exposure;
	packet.gain = gain;
	packet.roll = roll;
	packet.pitch = pitch;
	packet.yaw = yaw;
	packet.local_z = local_z;
	packet.lat = lat;
	packet.lon = lon;
	packet.alt = alt;
	packet.ground_x = ground_x;
	packet.ground_y = ground_y;
	packet.ground_z = ground_z;
	packet.width = width;
	packet.height = height;
	packet.depth = depth;
	packet.cam_no = cam_no;
	packet.channels = channels;

        memcpy(_MAV_PAYLOAD(msg), &packet, 92);
#endif
lm's avatar
lm committed
251

LM's avatar
LM committed
252
	msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
lm's avatar
lm committed
253
	return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 92, 224);
James Goppert's avatar
James Goppert committed
254 255
}

lm's avatar
lm committed
256
/**
LM's avatar
LM committed
257 258 259 260
 * @brief Encode a image_available struct into a message
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
lm's avatar
lm committed
261
 * @param msg The MAVLink message to compress the data into
LM's avatar
LM committed
262 263 264 265 266 267 268 269 270 271 272
 * @param image_available C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_image_available_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_available_t* image_available)
{
	return mavlink_msg_image_available_pack(system_id, component_id, msg, image_available->cam_id, image_available->cam_no, image_available->timestamp, image_available->valid_until, image_available->img_seq, image_available->img_buf_index, image_available->width, image_available->height, image_available->depth, image_available->channels, image_available->key, image_available->exposure, image_available->gain, image_available->roll, image_available->pitch, image_available->yaw, image_available->local_z, image_available->lat, image_available->lon, image_available->alt, image_available->ground_x, image_available->ground_y, image_available->ground_z);
}

/**
 * @brief Send a image_available message
 * @param chan MAVLink channel to send the message
 *
lm's avatar
lm committed
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
 * @param cam_id Camera id
 * @param cam_no Camera # (starts with 0)
 * @param timestamp Timestamp
 * @param valid_until Until which timestamp this buffer will stay valid
 * @param img_seq The image sequence number
 * @param img_buf_index Position of the image in the buffer, starts with 0
 * @param width Image width
 * @param height Image height
 * @param depth Image depth
 * @param channels Image channels
 * @param key Shared memory area key
 * @param exposure Exposure time, in microseconds
 * @param gain Camera gain
 * @param roll Roll angle in rad
 * @param pitch Pitch angle in rad
 * @param yaw Yaw angle in rad
 * @param local_z Local frame Z coordinate (height over ground)
 * @param lat GPS X coordinate
 * @param lon GPS Y coordinate
 * @param alt Global frame altitude
 * @param ground_x Ground truth X
 * @param ground_y Ground truth Y
 * @param ground_z Ground truth Z
 */
LM's avatar
LM committed
297 298 299
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_image_available_send(mavlink_channel_t chan, uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
lm's avatar
lm committed
300
{
LM's avatar
LM committed
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[92];
	_mav_put_uint64_t(buf, 0, cam_id);
	_mav_put_uint64_t(buf, 8, timestamp);
	_mav_put_uint64_t(buf, 16, valid_until);
	_mav_put_uint32_t(buf, 24, img_seq);
	_mav_put_uint32_t(buf, 28, img_buf_index);
	_mav_put_uint32_t(buf, 32, key);
	_mav_put_uint32_t(buf, 36, exposure);
	_mav_put_float(buf, 40, gain);
	_mav_put_float(buf, 44, roll);
	_mav_put_float(buf, 48, pitch);
	_mav_put_float(buf, 52, yaw);
	_mav_put_float(buf, 56, local_z);
	_mav_put_float(buf, 60, lat);
	_mav_put_float(buf, 64, lon);
	_mav_put_float(buf, 68, alt);
	_mav_put_float(buf, 72, ground_x);
	_mav_put_float(buf, 76, ground_y);
	_mav_put_float(buf, 80, ground_z);
	_mav_put_uint16_t(buf, 84, width);
	_mav_put_uint16_t(buf, 86, height);
	_mav_put_uint16_t(buf, 88, depth);
	_mav_put_uint8_t(buf, 90, cam_no);
	_mav_put_uint8_t(buf, 91, channels);

	_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, buf, 92, 224);
#else
	mavlink_image_available_t packet;
	packet.cam_id = cam_id;
	packet.timestamp = timestamp;
	packet.valid_until = valid_until;
	packet.img_seq = img_seq;
	packet.img_buf_index = img_buf_index;
	packet.key = key;
	packet.exposure = exposure;
	packet.gain = gain;
	packet.roll = roll;
	packet.pitch = pitch;
	packet.yaw = yaw;
	packet.local_z = local_z;
	packet.lat = lat;
	packet.lon = lon;
	packet.alt = alt;
	packet.ground_x = ground_x;
	packet.ground_y = ground_y;
	packet.ground_z = ground_z;
	packet.width = width;
	packet.height = height;
	packet.depth = depth;
	packet.cam_no = cam_no;
	packet.channels = channels;

	_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, (const char *)&packet, 92, 224);
#endif
lm's avatar
lm committed
356
}
James Goppert's avatar
James Goppert committed
357 358

#endif
lm's avatar
lm committed
359

James Goppert's avatar
James Goppert committed
360 361
// MESSAGE IMAGE_AVAILABLE UNPACKING

lm's avatar
lm committed
362

James Goppert's avatar
James Goppert committed
363 364 365 366 367 368 369
/**
 * @brief Get field cam_id from image_available message
 *
 * @return Camera id
 */
static inline uint64_t mavlink_msg_image_available_get_cam_id(const mavlink_message_t* msg)
{
LM's avatar
LM committed
370
	return _MAV_RETURN_uint64_t(msg,  0);
James Goppert's avatar
James Goppert committed
371 372 373 374 375 376 377 378 379
}

/**
 * @brief Get field cam_no from image_available message
 *
 * @return Camera # (starts with 0)
 */
static inline uint8_t mavlink_msg_image_available_get_cam_no(const mavlink_message_t* msg)
{
LM's avatar
LM committed
380
	return _MAV_RETURN_uint8_t(msg,  90);
James Goppert's avatar
James Goppert committed
381 382 383 384 385 386 387 388 389
}

/**
 * @brief Get field timestamp from image_available message
 *
 * @return Timestamp
 */
static inline uint64_t mavlink_msg_image_available_get_timestamp(const mavlink_message_t* msg)
{
LM's avatar
LM committed
390
	return _MAV_RETURN_uint64_t(msg,  8);
James Goppert's avatar
James Goppert committed
391 392 393 394 395 396 397 398 399
}

/**
 * @brief Get field valid_until from image_available message
 *
 * @return Until which timestamp this buffer will stay valid
 */
static inline uint64_t mavlink_msg_image_available_get_valid_until(const mavlink_message_t* msg)
{
LM's avatar
LM committed
400
	return _MAV_RETURN_uint64_t(msg,  16);
James Goppert's avatar
James Goppert committed
401 402 403 404 405 406 407 408 409
}

/**
 * @brief Get field img_seq from image_available message
 *
 * @return The image sequence number
 */
static inline uint32_t mavlink_msg_image_available_get_img_seq(const mavlink_message_t* msg)
{
LM's avatar
LM committed
410
	return _MAV_RETURN_uint32_t(msg,  24);
James Goppert's avatar
James Goppert committed
411 412 413 414 415 416 417 418 419
}

/**
 * @brief Get field img_buf_index from image_available message
 *
 * @return Position of the image in the buffer, starts with 0
 */
static inline uint32_t mavlink_msg_image_available_get_img_buf_index(const mavlink_message_t* msg)
{
LM's avatar
LM committed
420
	return _MAV_RETURN_uint32_t(msg,  28);
James Goppert's avatar
James Goppert committed
421 422 423 424 425 426 427 428 429
}

/**
 * @brief Get field width from image_available message
 *
 * @return Image width
 */
static inline uint16_t mavlink_msg_image_available_get_width(const mavlink_message_t* msg)
{
LM's avatar
LM committed
430
	return _MAV_RETURN_uint16_t(msg,  84);
James Goppert's avatar
James Goppert committed
431 432 433 434 435 436 437 438 439
}

/**
 * @brief Get field height from image_available message
 *
 * @return Image height
 */
static inline uint16_t mavlink_msg_image_available_get_height(const mavlink_message_t* msg)
{
LM's avatar
LM committed
440
	return _MAV_RETURN_uint16_t(msg,  86);
James Goppert's avatar
James Goppert committed
441 442 443 444 445 446 447 448 449
}

/**
 * @brief Get field depth from image_available message
 *
 * @return Image depth
 */
static inline uint16_t mavlink_msg_image_available_get_depth(const mavlink_message_t* msg)
{
LM's avatar
LM committed
450
	return _MAV_RETURN_uint16_t(msg,  88);
James Goppert's avatar
James Goppert committed
451 452 453 454 455 456 457 458 459
}

/**
 * @brief Get field channels from image_available message
 *
 * @return Image channels
 */
static inline uint8_t mavlink_msg_image_available_get_channels(const mavlink_message_t* msg)
{
LM's avatar
LM committed
460
	return _MAV_RETURN_uint8_t(msg,  91);
James Goppert's avatar
James Goppert committed
461 462 463 464 465 466 467 468 469
}

/**
 * @brief Get field key from image_available message
 *
 * @return Shared memory area key
 */
static inline uint32_t mavlink_msg_image_available_get_key(const mavlink_message_t* msg)
{
LM's avatar
LM committed
470
	return _MAV_RETURN_uint32_t(msg,  32);
James Goppert's avatar
James Goppert committed
471 472 473 474 475 476 477 478 479
}

/**
 * @brief Get field exposure from image_available message
 *
 * @return Exposure time, in microseconds
 */
static inline uint32_t mavlink_msg_image_available_get_exposure(const mavlink_message_t* msg)
{
LM's avatar
LM committed
480
	return _MAV_RETURN_uint32_t(msg,  36);
James Goppert's avatar
James Goppert committed
481 482 483 484 485 486 487 488 489
}

/**
 * @brief Get field gain from image_available message
 *
 * @return Camera gain
 */
static inline float mavlink_msg_image_available_get_gain(const mavlink_message_t* msg)
{
LM's avatar
LM committed
490
	return _MAV_RETURN_float(msg,  40);
James Goppert's avatar
James Goppert committed
491 492 493 494 495 496 497 498 499
}

/**
 * @brief Get field roll from image_available message
 *
 * @return Roll angle in rad
 */
static inline float mavlink_msg_image_available_get_roll(const mavlink_message_t* msg)
{
LM's avatar
LM committed
500
	return _MAV_RETURN_float(msg,  44);
James Goppert's avatar
James Goppert committed
501 502 503 504 505 506 507 508 509
}

/**
 * @brief Get field pitch from image_available message
 *
 * @return Pitch angle in rad
 */
static inline float mavlink_msg_image_available_get_pitch(const mavlink_message_t* msg)
{
LM's avatar
LM committed
510
	return _MAV_RETURN_float(msg,  48);
James Goppert's avatar
James Goppert committed
511 512 513 514 515 516 517 518 519
}

/**
 * @brief Get field yaw from image_available message
 *
 * @return Yaw angle in rad
 */
static inline float mavlink_msg_image_available_get_yaw(const mavlink_message_t* msg)
{
LM's avatar
LM committed
520
	return _MAV_RETURN_float(msg,  52);
James Goppert's avatar
James Goppert committed
521 522 523 524 525 526 527 528 529
}

/**
 * @brief Get field local_z from image_available message
 *
 * @return Local frame Z coordinate (height over ground)
 */
static inline float mavlink_msg_image_available_get_local_z(const mavlink_message_t* msg)
{
LM's avatar
LM committed
530
	return _MAV_RETURN_float(msg,  56);
James Goppert's avatar
James Goppert committed
531 532 533 534 535 536 537 538 539
}

/**
 * @brief Get field lat from image_available message
 *
 * @return GPS X coordinate
 */
static inline float mavlink_msg_image_available_get_lat(const mavlink_message_t* msg)
{
LM's avatar
LM committed
540
	return _MAV_RETURN_float(msg,  60);
James Goppert's avatar
James Goppert committed
541 542 543 544 545 546 547 548 549
}

/**
 * @brief Get field lon from image_available message
 *
 * @return GPS Y coordinate
 */
static inline float mavlink_msg_image_available_get_lon(const mavlink_message_t* msg)
{
LM's avatar
LM committed
550
	return _MAV_RETURN_float(msg,  64);
James Goppert's avatar
James Goppert committed
551 552 553 554 555 556 557 558 559
}

/**
 * @brief Get field alt from image_available message
 *
 * @return Global frame altitude
 */
static inline float mavlink_msg_image_available_get_alt(const mavlink_message_t* msg)
{
LM's avatar
LM committed
560
	return _MAV_RETURN_float(msg,  68);
James Goppert's avatar
James Goppert committed
561 562
}

LM's avatar
LM committed
563 564 565 566 567 568 569
/**
 * @brief Get field ground_x from image_available message
 *
 * @return Ground truth X
 */
static inline float mavlink_msg_image_available_get_ground_x(const mavlink_message_t* msg)
{
LM's avatar
LM committed
570
	return _MAV_RETURN_float(msg,  72);
LM's avatar
LM committed
571 572 573 574 575 576 577 578 579
}

/**
 * @brief Get field ground_y from image_available message
 *
 * @return Ground truth Y
 */
static inline float mavlink_msg_image_available_get_ground_y(const mavlink_message_t* msg)
{
LM's avatar
LM committed
580
	return _MAV_RETURN_float(msg,  76);
LM's avatar
LM committed
581 582 583 584 585 586 587 588 589
}

/**
 * @brief Get field ground_z from image_available message
 *
 * @return Ground truth Z
 */
static inline float mavlink_msg_image_available_get_ground_z(const mavlink_message_t* msg)
{
LM's avatar
LM committed
590
	return _MAV_RETURN_float(msg,  80);
LM's avatar
LM committed
591 592
}

James Goppert's avatar
James Goppert committed
593 594 595 596 597 598 599 600
/**
 * @brief Decode a image_available message into a struct
 *
 * @param msg The message to decode
 * @param image_available C-struct to decode the message contents into
 */
static inline void mavlink_msg_image_available_decode(const mavlink_message_t* msg, mavlink_image_available_t* image_available)
{
lm's avatar
lm committed
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
#if MAVLINK_NEED_BYTE_SWAP
	image_available->cam_id = mavlink_msg_image_available_get_cam_id(msg);
	image_available->timestamp = mavlink_msg_image_available_get_timestamp(msg);
	image_available->valid_until = mavlink_msg_image_available_get_valid_until(msg);
	image_available->img_seq = mavlink_msg_image_available_get_img_seq(msg);
	image_available->img_buf_index = mavlink_msg_image_available_get_img_buf_index(msg);
	image_available->key = mavlink_msg_image_available_get_key(msg);
	image_available->exposure = mavlink_msg_image_available_get_exposure(msg);
	image_available->gain = mavlink_msg_image_available_get_gain(msg);
	image_available->roll = mavlink_msg_image_available_get_roll(msg);
	image_available->pitch = mavlink_msg_image_available_get_pitch(msg);
	image_available->yaw = mavlink_msg_image_available_get_yaw(msg);
	image_available->local_z = mavlink_msg_image_available_get_local_z(msg);
	image_available->lat = mavlink_msg_image_available_get_lat(msg);
	image_available->lon = mavlink_msg_image_available_get_lon(msg);
	image_available->alt = mavlink_msg_image_available_get_alt(msg);
	image_available->ground_x = mavlink_msg_image_available_get_ground_x(msg);
	image_available->ground_y = mavlink_msg_image_available_get_ground_y(msg);
	image_available->ground_z = mavlink_msg_image_available_get_ground_z(msg);
	image_available->width = mavlink_msg_image_available_get_width(msg);
	image_available->height = mavlink_msg_image_available_get_height(msg);
	image_available->depth = mavlink_msg_image_available_get_depth(msg);
	image_available->cam_no = mavlink_msg_image_available_get_cam_no(msg);
	image_available->channels = mavlink_msg_image_available_get_channels(msg);
#else
LM's avatar
LM committed
626
	memcpy(image_available, _MAV_PAYLOAD(msg), 92);
lm's avatar
lm committed
627
#endif
James Goppert's avatar
James Goppert committed
628
}