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

#define MAVLINK_MSG_ID_IMAGE_AVAILABLE 103
lm's avatar
lm committed
4 5
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN 92
#define MAVLINK_MSG_103_LEN 92
lm's avatar
lm committed
6 7
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_KEY 0xA5
#define MAVLINK_MSG_103_KEY 0xA5
James Goppert's avatar
James Goppert committed
8 9 10

typedef struct __mavlink_image_available_t 
{
lm's avatar
lm committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
	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
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

} mavlink_image_available_t;

/**
 * @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
63 64 65
 * @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
66 67
 * @return length of the message in bytes (excluding serial stream start sign)
 */
LM's avatar
LM committed
68
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
69
{
lm's avatar
lm committed
70
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
James Goppert's avatar
James Goppert committed
71 72
	msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;

lm's avatar
lm committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
	p->cam_id = cam_id;	// uint64_t:Camera id
	p->cam_no = cam_no;	// uint8_t:Camera # (starts with 0)
	p->timestamp = timestamp;	// uint64_t:Timestamp
	p->valid_until = valid_until;	// uint64_t:Until which timestamp this buffer will stay valid
	p->img_seq = img_seq;	// uint32_t:The image sequence number
	p->img_buf_index = img_buf_index;	// uint32_t:Position of the image in the buffer, starts with 0
	p->width = width;	// uint16_t:Image width
	p->height = height;	// uint16_t:Image height
	p->depth = depth;	// uint16_t:Image depth
	p->channels = channels;	// uint8_t:Image channels
	p->key = key;	// uint32_t:Shared memory area key
	p->exposure = exposure;	// uint32_t:Exposure time, in microseconds
	p->gain = gain;	// float:Camera gain
	p->roll = roll;	// float:Roll angle in rad
	p->pitch = pitch;	// float:Pitch angle in rad
	p->yaw = yaw;	// float:Yaw angle in rad
	p->local_z = local_z;	// float:Local frame Z coordinate (height over ground)
	p->lat = lat;	// float:GPS X coordinate
	p->lon = lon;	// float:GPS Y coordinate
	p->alt = alt;	// float:Global frame altitude
	p->ground_x = ground_x;	// float:Ground truth X
	p->ground_y = ground_y;	// float:Ground truth Y
	p->ground_z = ground_z;	// float:Ground truth Z
lm's avatar
lm committed
96 97

	return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
James Goppert's avatar
James Goppert committed
98 99 100 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
}

/**
 * @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 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
126 127 128
 * @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
129 130
 * @return length of the message in bytes (excluding serial stream start sign)
 */
LM's avatar
LM committed
131
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
132
{
lm's avatar
lm committed
133
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
James Goppert's avatar
James Goppert committed
134 135
	msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;

lm's avatar
lm committed
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
	p->cam_id = cam_id;	// uint64_t:Camera id
	p->cam_no = cam_no;	// uint8_t:Camera # (starts with 0)
	p->timestamp = timestamp;	// uint64_t:Timestamp
	p->valid_until = valid_until;	// uint64_t:Until which timestamp this buffer will stay valid
	p->img_seq = img_seq;	// uint32_t:The image sequence number
	p->img_buf_index = img_buf_index;	// uint32_t:Position of the image in the buffer, starts with 0
	p->width = width;	// uint16_t:Image width
	p->height = height;	// uint16_t:Image height
	p->depth = depth;	// uint16_t:Image depth
	p->channels = channels;	// uint8_t:Image channels
	p->key = key;	// uint32_t:Shared memory area key
	p->exposure = exposure;	// uint32_t:Exposure time, in microseconds
	p->gain = gain;	// float:Camera gain
	p->roll = roll;	// float:Roll angle in rad
	p->pitch = pitch;	// float:Pitch angle in rad
	p->yaw = yaw;	// float:Yaw angle in rad
	p->local_z = local_z;	// float:Local frame Z coordinate (height over ground)
	p->lat = lat;	// float:GPS X coordinate
	p->lon = lon;	// float:GPS Y coordinate
	p->alt = alt;	// float:Global frame altitude
	p->ground_x = ground_x;	// float:Ground truth X
	p->ground_y = ground_y;	// float:Ground truth Y
	p->ground_z = ground_z;	// float:Ground truth Z
lm's avatar
lm committed
159 160

	return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
James Goppert's avatar
James Goppert committed
161 162 163 164 165 166 167 168 169 170 171 172
}

/**
 * @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)
 * @param msg The MAVLink message to compress the data into
 * @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)
{
LM's avatar
LM committed
173
	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);
James Goppert's avatar
James Goppert committed
174 175
}

lm's avatar
lm committed
176 177

#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
James Goppert's avatar
James Goppert committed
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
/**
 * @brief Send a image_available message
 * @param chan MAVLink channel to send the message
 *
 * @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
202 203 204
 * @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
205
 */
lm's avatar
lm committed
206 207 208 209 210
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)
{
	mavlink_header_t hdr;
	mavlink_image_available_t payload;

lm's avatar
lm committed
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
	MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN )
	payload.cam_id = cam_id;	// uint64_t:Camera id
	payload.cam_no = cam_no;	// uint8_t:Camera # (starts with 0)
	payload.timestamp = timestamp;	// uint64_t:Timestamp
	payload.valid_until = valid_until;	// uint64_t:Until which timestamp this buffer will stay valid
	payload.img_seq = img_seq;	// uint32_t:The image sequence number
	payload.img_buf_index = img_buf_index;	// uint32_t:Position of the image in the buffer, starts with 0
	payload.width = width;	// uint16_t:Image width
	payload.height = height;	// uint16_t:Image height
	payload.depth = depth;	// uint16_t:Image depth
	payload.channels = channels;	// uint8_t:Image channels
	payload.key = key;	// uint32_t:Shared memory area key
	payload.exposure = exposure;	// uint32_t:Exposure time, in microseconds
	payload.gain = gain;	// float:Camera gain
	payload.roll = roll;	// float:Roll angle in rad
	payload.pitch = pitch;	// float:Pitch angle in rad
	payload.yaw = yaw;	// float:Yaw angle in rad
	payload.local_z = local_z;	// float:Local frame Z coordinate (height over ground)
	payload.lat = lat;	// float:GPS X coordinate
	payload.lon = lon;	// float:GPS Y coordinate
	payload.alt = alt;	// float:Global frame altitude
	payload.ground_x = ground_x;	// float:Ground truth X
	payload.ground_y = ground_y;	// float:Ground truth Y
	payload.ground_z = ground_z;	// float:Ground truth Z
lm's avatar
lm committed
235 236 237 238 239 240 241 242 243 244

	hdr.STX = MAVLINK_STX;
	hdr.len = MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN;
	hdr.msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
	hdr.sysid = mavlink_system.sysid;
	hdr.compid = mavlink_system.compid;
	hdr.seq = mavlink_get_channel_status(chan)->current_tx_seq;
	mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
	mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );

lm's avatar
lm committed
245 246 247 248 249 250
	crc_init(&hdr.ck);
	crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
	crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
	crc_accumulate( 0xA5, &hdr.ck); /// include key in X25 checksum
	mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
	MAVLINK_BUFFER_CHECK_END
James Goppert's avatar
James Goppert committed
251 252 253 254 255 256 257 258 259 260 261 262
}

#endif
// MESSAGE IMAGE_AVAILABLE UNPACKING

/**
 * @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
263 264
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint64_t)(p->cam_id);
James Goppert's avatar
James Goppert committed
265 266 267 268 269 270 271 272 273
}

/**
 * @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
274 275
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint8_t)(p->cam_no);
James Goppert's avatar
James Goppert committed
276 277 278 279 280 281 282 283 284
}

/**
 * @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
285 286
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint64_t)(p->timestamp);
James Goppert's avatar
James Goppert committed
287 288 289 290 291 292 293 294 295
}

/**
 * @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
296 297
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint64_t)(p->valid_until);
James Goppert's avatar
James Goppert committed
298 299 300 301 302 303 304 305 306
}

/**
 * @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
307 308
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint32_t)(p->img_seq);
James Goppert's avatar
James Goppert committed
309 310 311 312 313 314 315 316 317
}

/**
 * @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
318 319
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint32_t)(p->img_buf_index);
James Goppert's avatar
James Goppert committed
320 321 322 323 324 325 326 327 328
}

/**
 * @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
329 330
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint16_t)(p->width);
James Goppert's avatar
James Goppert committed
331 332 333 334 335 336 337 338 339
}

/**
 * @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
340 341
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint16_t)(p->height);
James Goppert's avatar
James Goppert committed
342 343 344 345 346 347 348 349 350
}

/**
 * @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
351 352
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint16_t)(p->depth);
James Goppert's avatar
James Goppert committed
353 354 355 356 357 358 359 360 361
}

/**
 * @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
362 363
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint8_t)(p->channels);
James Goppert's avatar
James Goppert committed
364 365 366 367 368 369 370 371 372
}

/**
 * @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
373 374
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint32_t)(p->key);
James Goppert's avatar
James Goppert committed
375 376 377 378 379 380 381 382 383
}

/**
 * @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
384 385
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (uint32_t)(p->exposure);
James Goppert's avatar
James Goppert committed
386 387 388 389 390 391 392 393 394
}

/**
 * @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
395 396
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->gain);
James Goppert's avatar
James Goppert committed
397 398 399 400 401 402 403 404 405
}

/**
 * @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
406 407
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->roll);
James Goppert's avatar
James Goppert committed
408 409 410 411 412 413 414 415 416
}

/**
 * @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
417 418
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->pitch);
James Goppert's avatar
James Goppert committed
419 420 421 422 423 424 425 426 427
}

/**
 * @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
428 429
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->yaw);
James Goppert's avatar
James Goppert committed
430 431 432 433 434 435 436 437 438
}

/**
 * @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
439 440
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->local_z);
James Goppert's avatar
James Goppert committed
441 442 443 444 445 446 447 448 449
}

/**
 * @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
450 451
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->lat);
James Goppert's avatar
James Goppert committed
452 453 454 455 456 457 458 459 460
}

/**
 * @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
461 462
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->lon);
James Goppert's avatar
James Goppert committed
463 464 465 466 467 468 469 470 471
}

/**
 * @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
472 473
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->alt);
James Goppert's avatar
James Goppert committed
474 475
}

LM's avatar
LM committed
476 477 478 479 480 481 482
/**
 * @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
483 484
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->ground_x);
LM's avatar
LM committed
485 486 487 488 489 490 491 492 493
}

/**
 * @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
494 495
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->ground_y);
LM's avatar
LM committed
496 497 498 499 500 501 502 503 504
}

/**
 * @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
505 506
	mavlink_image_available_t *p = (mavlink_image_available_t *)&msg->payload[0];
	return (float)(p->ground_z);
LM's avatar
LM committed
507 508
}

James Goppert's avatar
James Goppert committed
509 510 511 512 513 514 515 516
/**
 * @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
517
	memcpy( image_available, msg->payload, sizeof(mavlink_image_available_t));
James Goppert's avatar
James Goppert committed
518
}