Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
MAVlink/include/pixhawk/mavlink_msg_image_available.h@0:826c6171fc1b, 2012-06-20 (annotated)
- Committer:
- shimniok
- Date:
- Wed Jun 20 14:57:48 2012 +0000
- Revision:
- 0:826c6171fc1b
Updated documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimniok | 0:826c6171fc1b | 1 | // MESSAGE IMAGE_AVAILABLE PACKING |
shimniok | 0:826c6171fc1b | 2 | |
shimniok | 0:826c6171fc1b | 3 | #define MAVLINK_MSG_ID_IMAGE_AVAILABLE 103 |
shimniok | 0:826c6171fc1b | 4 | |
shimniok | 0:826c6171fc1b | 5 | typedef struct __mavlink_image_available_t |
shimniok | 0:826c6171fc1b | 6 | { |
shimniok | 0:826c6171fc1b | 7 | uint64_t cam_id; ///< Camera id |
shimniok | 0:826c6171fc1b | 8 | uint8_t cam_no; ///< Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 9 | uint64_t timestamp; ///< Timestamp |
shimniok | 0:826c6171fc1b | 10 | uint64_t valid_until; ///< Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 11 | uint32_t img_seq; ///< The image sequence number |
shimniok | 0:826c6171fc1b | 12 | uint32_t img_buf_index; ///< Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 13 | uint16_t width; ///< Image width |
shimniok | 0:826c6171fc1b | 14 | uint16_t height; ///< Image height |
shimniok | 0:826c6171fc1b | 15 | uint16_t depth; ///< Image depth |
shimniok | 0:826c6171fc1b | 16 | uint8_t channels; ///< Image channels |
shimniok | 0:826c6171fc1b | 17 | uint32_t key; ///< Shared memory area key |
shimniok | 0:826c6171fc1b | 18 | uint32_t exposure; ///< Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 19 | float gain; ///< Camera gain |
shimniok | 0:826c6171fc1b | 20 | float roll; ///< Roll angle in rad |
shimniok | 0:826c6171fc1b | 21 | float pitch; ///< Pitch angle in rad |
shimniok | 0:826c6171fc1b | 22 | float yaw; ///< Yaw angle in rad |
shimniok | 0:826c6171fc1b | 23 | float local_z; ///< Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 24 | float lat; ///< GPS X coordinate |
shimniok | 0:826c6171fc1b | 25 | float lon; ///< GPS Y coordinate |
shimniok | 0:826c6171fc1b | 26 | float alt; ///< Global frame altitude |
shimniok | 0:826c6171fc1b | 27 | float ground_x; ///< Ground truth X |
shimniok | 0:826c6171fc1b | 28 | float ground_y; ///< Ground truth Y |
shimniok | 0:826c6171fc1b | 29 | float ground_z; ///< Ground truth Z |
shimniok | 0:826c6171fc1b | 30 | |
shimniok | 0:826c6171fc1b | 31 | } mavlink_image_available_t; |
shimniok | 0:826c6171fc1b | 32 | |
shimniok | 0:826c6171fc1b | 33 | |
shimniok | 0:826c6171fc1b | 34 | |
shimniok | 0:826c6171fc1b | 35 | /** |
shimniok | 0:826c6171fc1b | 36 | * @brief Pack a image_available message |
shimniok | 0:826c6171fc1b | 37 | * @param system_id ID of this system |
shimniok | 0:826c6171fc1b | 38 | * @param component_id ID of this component (e.g. 200 for IMU) |
shimniok | 0:826c6171fc1b | 39 | * @param msg The MAVLink message to compress the data into |
shimniok | 0:826c6171fc1b | 40 | * |
shimniok | 0:826c6171fc1b | 41 | * @param cam_id Camera id |
shimniok | 0:826c6171fc1b | 42 | * @param cam_no Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 43 | * @param timestamp Timestamp |
shimniok | 0:826c6171fc1b | 44 | * @param valid_until Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 45 | * @param img_seq The image sequence number |
shimniok | 0:826c6171fc1b | 46 | * @param img_buf_index Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 47 | * @param width Image width |
shimniok | 0:826c6171fc1b | 48 | * @param height Image height |
shimniok | 0:826c6171fc1b | 49 | * @param depth Image depth |
shimniok | 0:826c6171fc1b | 50 | * @param channels Image channels |
shimniok | 0:826c6171fc1b | 51 | * @param key Shared memory area key |
shimniok | 0:826c6171fc1b | 52 | * @param exposure Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 53 | * @param gain Camera gain |
shimniok | 0:826c6171fc1b | 54 | * @param roll Roll angle in rad |
shimniok | 0:826c6171fc1b | 55 | * @param pitch Pitch angle in rad |
shimniok | 0:826c6171fc1b | 56 | * @param yaw Yaw angle in rad |
shimniok | 0:826c6171fc1b | 57 | * @param local_z Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 58 | * @param lat GPS X coordinate |
shimniok | 0:826c6171fc1b | 59 | * @param lon GPS Y coordinate |
shimniok | 0:826c6171fc1b | 60 | * @param alt Global frame altitude |
shimniok | 0:826c6171fc1b | 61 | * @param ground_x Ground truth X |
shimniok | 0:826c6171fc1b | 62 | * @param ground_y Ground truth Y |
shimniok | 0:826c6171fc1b | 63 | * @param ground_z Ground truth Z |
shimniok | 0:826c6171fc1b | 64 | * @return length of the message in bytes (excluding serial stream start sign) |
shimniok | 0:826c6171fc1b | 65 | */ |
shimniok | 0:826c6171fc1b | 66 | 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) |
shimniok | 0:826c6171fc1b | 67 | { |
shimniok | 0:826c6171fc1b | 68 | uint16_t i = 0; |
shimniok | 0:826c6171fc1b | 69 | msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE; |
shimniok | 0:826c6171fc1b | 70 | |
shimniok | 0:826c6171fc1b | 71 | i += put_uint64_t_by_index(cam_id, i, msg->payload); // Camera id |
shimniok | 0:826c6171fc1b | 72 | i += put_uint8_t_by_index(cam_no, i, msg->payload); // Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 73 | i += put_uint64_t_by_index(timestamp, i, msg->payload); // Timestamp |
shimniok | 0:826c6171fc1b | 74 | i += put_uint64_t_by_index(valid_until, i, msg->payload); // Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 75 | i += put_uint32_t_by_index(img_seq, i, msg->payload); // The image sequence number |
shimniok | 0:826c6171fc1b | 76 | i += put_uint32_t_by_index(img_buf_index, i, msg->payload); // Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 77 | i += put_uint16_t_by_index(width, i, msg->payload); // Image width |
shimniok | 0:826c6171fc1b | 78 | i += put_uint16_t_by_index(height, i, msg->payload); // Image height |
shimniok | 0:826c6171fc1b | 79 | i += put_uint16_t_by_index(depth, i, msg->payload); // Image depth |
shimniok | 0:826c6171fc1b | 80 | i += put_uint8_t_by_index(channels, i, msg->payload); // Image channels |
shimniok | 0:826c6171fc1b | 81 | i += put_uint32_t_by_index(key, i, msg->payload); // Shared memory area key |
shimniok | 0:826c6171fc1b | 82 | i += put_uint32_t_by_index(exposure, i, msg->payload); // Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 83 | i += put_float_by_index(gain, i, msg->payload); // Camera gain |
shimniok | 0:826c6171fc1b | 84 | i += put_float_by_index(roll, i, msg->payload); // Roll angle in rad |
shimniok | 0:826c6171fc1b | 85 | i += put_float_by_index(pitch, i, msg->payload); // Pitch angle in rad |
shimniok | 0:826c6171fc1b | 86 | i += put_float_by_index(yaw, i, msg->payload); // Yaw angle in rad |
shimniok | 0:826c6171fc1b | 87 | i += put_float_by_index(local_z, i, msg->payload); // Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 88 | i += put_float_by_index(lat, i, msg->payload); // GPS X coordinate |
shimniok | 0:826c6171fc1b | 89 | i += put_float_by_index(lon, i, msg->payload); // GPS Y coordinate |
shimniok | 0:826c6171fc1b | 90 | i += put_float_by_index(alt, i, msg->payload); // Global frame altitude |
shimniok | 0:826c6171fc1b | 91 | i += put_float_by_index(ground_x, i, msg->payload); // Ground truth X |
shimniok | 0:826c6171fc1b | 92 | i += put_float_by_index(ground_y, i, msg->payload); // Ground truth Y |
shimniok | 0:826c6171fc1b | 93 | i += put_float_by_index(ground_z, i, msg->payload); // Ground truth Z |
shimniok | 0:826c6171fc1b | 94 | |
shimniok | 0:826c6171fc1b | 95 | return mavlink_finalize_message(msg, system_id, component_id, i); |
shimniok | 0:826c6171fc1b | 96 | } |
shimniok | 0:826c6171fc1b | 97 | |
shimniok | 0:826c6171fc1b | 98 | /** |
shimniok | 0:826c6171fc1b | 99 | * @brief Pack a image_available message |
shimniok | 0:826c6171fc1b | 100 | * @param system_id ID of this system |
shimniok | 0:826c6171fc1b | 101 | * @param component_id ID of this component (e.g. 200 for IMU) |
shimniok | 0:826c6171fc1b | 102 | * @param chan The MAVLink channel this message was sent over |
shimniok | 0:826c6171fc1b | 103 | * @param msg The MAVLink message to compress the data into |
shimniok | 0:826c6171fc1b | 104 | * @param cam_id Camera id |
shimniok | 0:826c6171fc1b | 105 | * @param cam_no Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 106 | * @param timestamp Timestamp |
shimniok | 0:826c6171fc1b | 107 | * @param valid_until Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 108 | * @param img_seq The image sequence number |
shimniok | 0:826c6171fc1b | 109 | * @param img_buf_index Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 110 | * @param width Image width |
shimniok | 0:826c6171fc1b | 111 | * @param height Image height |
shimniok | 0:826c6171fc1b | 112 | * @param depth Image depth |
shimniok | 0:826c6171fc1b | 113 | * @param channels Image channels |
shimniok | 0:826c6171fc1b | 114 | * @param key Shared memory area key |
shimniok | 0:826c6171fc1b | 115 | * @param exposure Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 116 | * @param gain Camera gain |
shimniok | 0:826c6171fc1b | 117 | * @param roll Roll angle in rad |
shimniok | 0:826c6171fc1b | 118 | * @param pitch Pitch angle in rad |
shimniok | 0:826c6171fc1b | 119 | * @param yaw Yaw angle in rad |
shimniok | 0:826c6171fc1b | 120 | * @param local_z Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 121 | * @param lat GPS X coordinate |
shimniok | 0:826c6171fc1b | 122 | * @param lon GPS Y coordinate |
shimniok | 0:826c6171fc1b | 123 | * @param alt Global frame altitude |
shimniok | 0:826c6171fc1b | 124 | * @param ground_x Ground truth X |
shimniok | 0:826c6171fc1b | 125 | * @param ground_y Ground truth Y |
shimniok | 0:826c6171fc1b | 126 | * @param ground_z Ground truth Z |
shimniok | 0:826c6171fc1b | 127 | * @return length of the message in bytes (excluding serial stream start sign) |
shimniok | 0:826c6171fc1b | 128 | */ |
shimniok | 0:826c6171fc1b | 129 | 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) |
shimniok | 0:826c6171fc1b | 130 | { |
shimniok | 0:826c6171fc1b | 131 | uint16_t i = 0; |
shimniok | 0:826c6171fc1b | 132 | msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE; |
shimniok | 0:826c6171fc1b | 133 | |
shimniok | 0:826c6171fc1b | 134 | i += put_uint64_t_by_index(cam_id, i, msg->payload); // Camera id |
shimniok | 0:826c6171fc1b | 135 | i += put_uint8_t_by_index(cam_no, i, msg->payload); // Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 136 | i += put_uint64_t_by_index(timestamp, i, msg->payload); // Timestamp |
shimniok | 0:826c6171fc1b | 137 | i += put_uint64_t_by_index(valid_until, i, msg->payload); // Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 138 | i += put_uint32_t_by_index(img_seq, i, msg->payload); // The image sequence number |
shimniok | 0:826c6171fc1b | 139 | i += put_uint32_t_by_index(img_buf_index, i, msg->payload); // Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 140 | i += put_uint16_t_by_index(width, i, msg->payload); // Image width |
shimniok | 0:826c6171fc1b | 141 | i += put_uint16_t_by_index(height, i, msg->payload); // Image height |
shimniok | 0:826c6171fc1b | 142 | i += put_uint16_t_by_index(depth, i, msg->payload); // Image depth |
shimniok | 0:826c6171fc1b | 143 | i += put_uint8_t_by_index(channels, i, msg->payload); // Image channels |
shimniok | 0:826c6171fc1b | 144 | i += put_uint32_t_by_index(key, i, msg->payload); // Shared memory area key |
shimniok | 0:826c6171fc1b | 145 | i += put_uint32_t_by_index(exposure, i, msg->payload); // Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 146 | i += put_float_by_index(gain, i, msg->payload); // Camera gain |
shimniok | 0:826c6171fc1b | 147 | i += put_float_by_index(roll, i, msg->payload); // Roll angle in rad |
shimniok | 0:826c6171fc1b | 148 | i += put_float_by_index(pitch, i, msg->payload); // Pitch angle in rad |
shimniok | 0:826c6171fc1b | 149 | i += put_float_by_index(yaw, i, msg->payload); // Yaw angle in rad |
shimniok | 0:826c6171fc1b | 150 | i += put_float_by_index(local_z, i, msg->payload); // Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 151 | i += put_float_by_index(lat, i, msg->payload); // GPS X coordinate |
shimniok | 0:826c6171fc1b | 152 | i += put_float_by_index(lon, i, msg->payload); // GPS Y coordinate |
shimniok | 0:826c6171fc1b | 153 | i += put_float_by_index(alt, i, msg->payload); // Global frame altitude |
shimniok | 0:826c6171fc1b | 154 | i += put_float_by_index(ground_x, i, msg->payload); // Ground truth X |
shimniok | 0:826c6171fc1b | 155 | i += put_float_by_index(ground_y, i, msg->payload); // Ground truth Y |
shimniok | 0:826c6171fc1b | 156 | i += put_float_by_index(ground_z, i, msg->payload); // Ground truth Z |
shimniok | 0:826c6171fc1b | 157 | |
shimniok | 0:826c6171fc1b | 158 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, i); |
shimniok | 0:826c6171fc1b | 159 | } |
shimniok | 0:826c6171fc1b | 160 | |
shimniok | 0:826c6171fc1b | 161 | /** |
shimniok | 0:826c6171fc1b | 162 | * @brief Encode a image_available struct into a message |
shimniok | 0:826c6171fc1b | 163 | * |
shimniok | 0:826c6171fc1b | 164 | * @param system_id ID of this system |
shimniok | 0:826c6171fc1b | 165 | * @param component_id ID of this component (e.g. 200 for IMU) |
shimniok | 0:826c6171fc1b | 166 | * @param msg The MAVLink message to compress the data into |
shimniok | 0:826c6171fc1b | 167 | * @param image_available C-struct to read the message contents from |
shimniok | 0:826c6171fc1b | 168 | */ |
shimniok | 0:826c6171fc1b | 169 | 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) |
shimniok | 0:826c6171fc1b | 170 | { |
shimniok | 0:826c6171fc1b | 171 | 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); |
shimniok | 0:826c6171fc1b | 172 | } |
shimniok | 0:826c6171fc1b | 173 | |
shimniok | 0:826c6171fc1b | 174 | /** |
shimniok | 0:826c6171fc1b | 175 | * @brief Send a image_available message |
shimniok | 0:826c6171fc1b | 176 | * @param chan MAVLink channel to send the message |
shimniok | 0:826c6171fc1b | 177 | * |
shimniok | 0:826c6171fc1b | 178 | * @param cam_id Camera id |
shimniok | 0:826c6171fc1b | 179 | * @param cam_no Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 180 | * @param timestamp Timestamp |
shimniok | 0:826c6171fc1b | 181 | * @param valid_until Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 182 | * @param img_seq The image sequence number |
shimniok | 0:826c6171fc1b | 183 | * @param img_buf_index Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 184 | * @param width Image width |
shimniok | 0:826c6171fc1b | 185 | * @param height Image height |
shimniok | 0:826c6171fc1b | 186 | * @param depth Image depth |
shimniok | 0:826c6171fc1b | 187 | * @param channels Image channels |
shimniok | 0:826c6171fc1b | 188 | * @param key Shared memory area key |
shimniok | 0:826c6171fc1b | 189 | * @param exposure Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 190 | * @param gain Camera gain |
shimniok | 0:826c6171fc1b | 191 | * @param roll Roll angle in rad |
shimniok | 0:826c6171fc1b | 192 | * @param pitch Pitch angle in rad |
shimniok | 0:826c6171fc1b | 193 | * @param yaw Yaw angle in rad |
shimniok | 0:826c6171fc1b | 194 | * @param local_z Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 195 | * @param lat GPS X coordinate |
shimniok | 0:826c6171fc1b | 196 | * @param lon GPS Y coordinate |
shimniok | 0:826c6171fc1b | 197 | * @param alt Global frame altitude |
shimniok | 0:826c6171fc1b | 198 | * @param ground_x Ground truth X |
shimniok | 0:826c6171fc1b | 199 | * @param ground_y Ground truth Y |
shimniok | 0:826c6171fc1b | 200 | * @param ground_z Ground truth Z |
shimniok | 0:826c6171fc1b | 201 | */ |
shimniok | 0:826c6171fc1b | 202 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
shimniok | 0:826c6171fc1b | 203 | |
shimniok | 0:826c6171fc1b | 204 | 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) |
shimniok | 0:826c6171fc1b | 205 | { |
shimniok | 0:826c6171fc1b | 206 | mavlink_message_t msg; |
shimniok | 0:826c6171fc1b | 207 | mavlink_msg_image_available_pack_chan(mavlink_system.sysid, mavlink_system.compid, chan, &msg, cam_id, cam_no, timestamp, valid_until, img_seq, img_buf_index, width, height, depth, channels, key, exposure, gain, roll, pitch, yaw, local_z, lat, lon, alt, ground_x, ground_y, ground_z); |
shimniok | 0:826c6171fc1b | 208 | mavlink_send_uart(chan, &msg); |
shimniok | 0:826c6171fc1b | 209 | } |
shimniok | 0:826c6171fc1b | 210 | |
shimniok | 0:826c6171fc1b | 211 | #endif |
shimniok | 0:826c6171fc1b | 212 | // MESSAGE IMAGE_AVAILABLE UNPACKING |
shimniok | 0:826c6171fc1b | 213 | |
shimniok | 0:826c6171fc1b | 214 | /** |
shimniok | 0:826c6171fc1b | 215 | * @brief Get field cam_id from image_available message |
shimniok | 0:826c6171fc1b | 216 | * |
shimniok | 0:826c6171fc1b | 217 | * @return Camera id |
shimniok | 0:826c6171fc1b | 218 | */ |
shimniok | 0:826c6171fc1b | 219 | static inline uint64_t mavlink_msg_image_available_get_cam_id(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 220 | { |
shimniok | 0:826c6171fc1b | 221 | generic_64bit r; |
shimniok | 0:826c6171fc1b | 222 | r.b[7] = (msg->payload)[0]; |
shimniok | 0:826c6171fc1b | 223 | r.b[6] = (msg->payload)[1]; |
shimniok | 0:826c6171fc1b | 224 | r.b[5] = (msg->payload)[2]; |
shimniok | 0:826c6171fc1b | 225 | r.b[4] = (msg->payload)[3]; |
shimniok | 0:826c6171fc1b | 226 | r.b[3] = (msg->payload)[4]; |
shimniok | 0:826c6171fc1b | 227 | r.b[2] = (msg->payload)[5]; |
shimniok | 0:826c6171fc1b | 228 | r.b[1] = (msg->payload)[6]; |
shimniok | 0:826c6171fc1b | 229 | r.b[0] = (msg->payload)[7]; |
shimniok | 0:826c6171fc1b | 230 | return (uint64_t)r.ll; |
shimniok | 0:826c6171fc1b | 231 | } |
shimniok | 0:826c6171fc1b | 232 | |
shimniok | 0:826c6171fc1b | 233 | /** |
shimniok | 0:826c6171fc1b | 234 | * @brief Get field cam_no from image_available message |
shimniok | 0:826c6171fc1b | 235 | * |
shimniok | 0:826c6171fc1b | 236 | * @return Camera # (starts with 0) |
shimniok | 0:826c6171fc1b | 237 | */ |
shimniok | 0:826c6171fc1b | 238 | static inline uint8_t mavlink_msg_image_available_get_cam_no(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 239 | { |
shimniok | 0:826c6171fc1b | 240 | return (uint8_t)(msg->payload+sizeof(uint64_t))[0]; |
shimniok | 0:826c6171fc1b | 241 | } |
shimniok | 0:826c6171fc1b | 242 | |
shimniok | 0:826c6171fc1b | 243 | /** |
shimniok | 0:826c6171fc1b | 244 | * @brief Get field timestamp from image_available message |
shimniok | 0:826c6171fc1b | 245 | * |
shimniok | 0:826c6171fc1b | 246 | * @return Timestamp |
shimniok | 0:826c6171fc1b | 247 | */ |
shimniok | 0:826c6171fc1b | 248 | static inline uint64_t mavlink_msg_image_available_get_timestamp(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 249 | { |
shimniok | 0:826c6171fc1b | 250 | generic_64bit r; |
shimniok | 0:826c6171fc1b | 251 | r.b[7] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[0]; |
shimniok | 0:826c6171fc1b | 252 | r.b[6] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[1]; |
shimniok | 0:826c6171fc1b | 253 | r.b[5] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[2]; |
shimniok | 0:826c6171fc1b | 254 | r.b[4] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[3]; |
shimniok | 0:826c6171fc1b | 255 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[4]; |
shimniok | 0:826c6171fc1b | 256 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[5]; |
shimniok | 0:826c6171fc1b | 257 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[6]; |
shimniok | 0:826c6171fc1b | 258 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t))[7]; |
shimniok | 0:826c6171fc1b | 259 | return (uint64_t)r.ll; |
shimniok | 0:826c6171fc1b | 260 | } |
shimniok | 0:826c6171fc1b | 261 | |
shimniok | 0:826c6171fc1b | 262 | /** |
shimniok | 0:826c6171fc1b | 263 | * @brief Get field valid_until from image_available message |
shimniok | 0:826c6171fc1b | 264 | * |
shimniok | 0:826c6171fc1b | 265 | * @return Until which timestamp this buffer will stay valid |
shimniok | 0:826c6171fc1b | 266 | */ |
shimniok | 0:826c6171fc1b | 267 | static inline uint64_t mavlink_msg_image_available_get_valid_until(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 268 | { |
shimniok | 0:826c6171fc1b | 269 | generic_64bit r; |
shimniok | 0:826c6171fc1b | 270 | r.b[7] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[0]; |
shimniok | 0:826c6171fc1b | 271 | r.b[6] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[1]; |
shimniok | 0:826c6171fc1b | 272 | r.b[5] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[2]; |
shimniok | 0:826c6171fc1b | 273 | r.b[4] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[3]; |
shimniok | 0:826c6171fc1b | 274 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[4]; |
shimniok | 0:826c6171fc1b | 275 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[5]; |
shimniok | 0:826c6171fc1b | 276 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[6]; |
shimniok | 0:826c6171fc1b | 277 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t))[7]; |
shimniok | 0:826c6171fc1b | 278 | return (uint64_t)r.ll; |
shimniok | 0:826c6171fc1b | 279 | } |
shimniok | 0:826c6171fc1b | 280 | |
shimniok | 0:826c6171fc1b | 281 | /** |
shimniok | 0:826c6171fc1b | 282 | * @brief Get field img_seq from image_available message |
shimniok | 0:826c6171fc1b | 283 | * |
shimniok | 0:826c6171fc1b | 284 | * @return The image sequence number |
shimniok | 0:826c6171fc1b | 285 | */ |
shimniok | 0:826c6171fc1b | 286 | static inline uint32_t mavlink_msg_image_available_get_img_seq(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 287 | { |
shimniok | 0:826c6171fc1b | 288 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 289 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t))[0]; |
shimniok | 0:826c6171fc1b | 290 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t))[1]; |
shimniok | 0:826c6171fc1b | 291 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t))[2]; |
shimniok | 0:826c6171fc1b | 292 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t))[3]; |
shimniok | 0:826c6171fc1b | 293 | return (uint32_t)r.i; |
shimniok | 0:826c6171fc1b | 294 | } |
shimniok | 0:826c6171fc1b | 295 | |
shimniok | 0:826c6171fc1b | 296 | /** |
shimniok | 0:826c6171fc1b | 297 | * @brief Get field img_buf_index from image_available message |
shimniok | 0:826c6171fc1b | 298 | * |
shimniok | 0:826c6171fc1b | 299 | * @return Position of the image in the buffer, starts with 0 |
shimniok | 0:826c6171fc1b | 300 | */ |
shimniok | 0:826c6171fc1b | 301 | static inline uint32_t mavlink_msg_image_available_get_img_buf_index(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 302 | { |
shimniok | 0:826c6171fc1b | 303 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 304 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t))[0]; |
shimniok | 0:826c6171fc1b | 305 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t))[1]; |
shimniok | 0:826c6171fc1b | 306 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t))[2]; |
shimniok | 0:826c6171fc1b | 307 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t))[3]; |
shimniok | 0:826c6171fc1b | 308 | return (uint32_t)r.i; |
shimniok | 0:826c6171fc1b | 309 | } |
shimniok | 0:826c6171fc1b | 310 | |
shimniok | 0:826c6171fc1b | 311 | /** |
shimniok | 0:826c6171fc1b | 312 | * @brief Get field width from image_available message |
shimniok | 0:826c6171fc1b | 313 | * |
shimniok | 0:826c6171fc1b | 314 | * @return Image width |
shimniok | 0:826c6171fc1b | 315 | */ |
shimniok | 0:826c6171fc1b | 316 | static inline uint16_t mavlink_msg_image_available_get_width(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 317 | { |
shimniok | 0:826c6171fc1b | 318 | generic_16bit r; |
shimniok | 0:826c6171fc1b | 319 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t))[0]; |
shimniok | 0:826c6171fc1b | 320 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t))[1]; |
shimniok | 0:826c6171fc1b | 321 | return (uint16_t)r.s; |
shimniok | 0:826c6171fc1b | 322 | } |
shimniok | 0:826c6171fc1b | 323 | |
shimniok | 0:826c6171fc1b | 324 | /** |
shimniok | 0:826c6171fc1b | 325 | * @brief Get field height from image_available message |
shimniok | 0:826c6171fc1b | 326 | * |
shimniok | 0:826c6171fc1b | 327 | * @return Image height |
shimniok | 0:826c6171fc1b | 328 | */ |
shimniok | 0:826c6171fc1b | 329 | static inline uint16_t mavlink_msg_image_available_get_height(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 330 | { |
shimniok | 0:826c6171fc1b | 331 | generic_16bit r; |
shimniok | 0:826c6171fc1b | 332 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t))[0]; |
shimniok | 0:826c6171fc1b | 333 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t))[1]; |
shimniok | 0:826c6171fc1b | 334 | return (uint16_t)r.s; |
shimniok | 0:826c6171fc1b | 335 | } |
shimniok | 0:826c6171fc1b | 336 | |
shimniok | 0:826c6171fc1b | 337 | /** |
shimniok | 0:826c6171fc1b | 338 | * @brief Get field depth from image_available message |
shimniok | 0:826c6171fc1b | 339 | * |
shimniok | 0:826c6171fc1b | 340 | * @return Image depth |
shimniok | 0:826c6171fc1b | 341 | */ |
shimniok | 0:826c6171fc1b | 342 | static inline uint16_t mavlink_msg_image_available_get_depth(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 343 | { |
shimniok | 0:826c6171fc1b | 344 | generic_16bit r; |
shimniok | 0:826c6171fc1b | 345 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t))[0]; |
shimniok | 0:826c6171fc1b | 346 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t))[1]; |
shimniok | 0:826c6171fc1b | 347 | return (uint16_t)r.s; |
shimniok | 0:826c6171fc1b | 348 | } |
shimniok | 0:826c6171fc1b | 349 | |
shimniok | 0:826c6171fc1b | 350 | /** |
shimniok | 0:826c6171fc1b | 351 | * @brief Get field channels from image_available message |
shimniok | 0:826c6171fc1b | 352 | * |
shimniok | 0:826c6171fc1b | 353 | * @return Image channels |
shimniok | 0:826c6171fc1b | 354 | */ |
shimniok | 0:826c6171fc1b | 355 | static inline uint8_t mavlink_msg_image_available_get_channels(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 356 | { |
shimniok | 0:826c6171fc1b | 357 | return (uint8_t)(msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t))[0]; |
shimniok | 0:826c6171fc1b | 358 | } |
shimniok | 0:826c6171fc1b | 359 | |
shimniok | 0:826c6171fc1b | 360 | /** |
shimniok | 0:826c6171fc1b | 361 | * @brief Get field key from image_available message |
shimniok | 0:826c6171fc1b | 362 | * |
shimniok | 0:826c6171fc1b | 363 | * @return Shared memory area key |
shimniok | 0:826c6171fc1b | 364 | */ |
shimniok | 0:826c6171fc1b | 365 | static inline uint32_t mavlink_msg_image_available_get_key(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 366 | { |
shimniok | 0:826c6171fc1b | 367 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 368 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t))[0]; |
shimniok | 0:826c6171fc1b | 369 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t))[1]; |
shimniok | 0:826c6171fc1b | 370 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t))[2]; |
shimniok | 0:826c6171fc1b | 371 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t))[3]; |
shimniok | 0:826c6171fc1b | 372 | return (uint32_t)r.i; |
shimniok | 0:826c6171fc1b | 373 | } |
shimniok | 0:826c6171fc1b | 374 | |
shimniok | 0:826c6171fc1b | 375 | /** |
shimniok | 0:826c6171fc1b | 376 | * @brief Get field exposure from image_available message |
shimniok | 0:826c6171fc1b | 377 | * |
shimniok | 0:826c6171fc1b | 378 | * @return Exposure time, in microseconds |
shimniok | 0:826c6171fc1b | 379 | */ |
shimniok | 0:826c6171fc1b | 380 | static inline uint32_t mavlink_msg_image_available_get_exposure(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 381 | { |
shimniok | 0:826c6171fc1b | 382 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 383 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t))[0]; |
shimniok | 0:826c6171fc1b | 384 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t))[1]; |
shimniok | 0:826c6171fc1b | 385 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t))[2]; |
shimniok | 0:826c6171fc1b | 386 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t))[3]; |
shimniok | 0:826c6171fc1b | 387 | return (uint32_t)r.i; |
shimniok | 0:826c6171fc1b | 388 | } |
shimniok | 0:826c6171fc1b | 389 | |
shimniok | 0:826c6171fc1b | 390 | /** |
shimniok | 0:826c6171fc1b | 391 | * @brief Get field gain from image_available message |
shimniok | 0:826c6171fc1b | 392 | * |
shimniok | 0:826c6171fc1b | 393 | * @return Camera gain |
shimniok | 0:826c6171fc1b | 394 | */ |
shimniok | 0:826c6171fc1b | 395 | static inline float mavlink_msg_image_available_get_gain(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 396 | { |
shimniok | 0:826c6171fc1b | 397 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 398 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t))[0]; |
shimniok | 0:826c6171fc1b | 399 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t))[1]; |
shimniok | 0:826c6171fc1b | 400 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t))[2]; |
shimniok | 0:826c6171fc1b | 401 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t))[3]; |
shimniok | 0:826c6171fc1b | 402 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 403 | } |
shimniok | 0:826c6171fc1b | 404 | |
shimniok | 0:826c6171fc1b | 405 | /** |
shimniok | 0:826c6171fc1b | 406 | * @brief Get field roll from image_available message |
shimniok | 0:826c6171fc1b | 407 | * |
shimniok | 0:826c6171fc1b | 408 | * @return Roll angle in rad |
shimniok | 0:826c6171fc1b | 409 | */ |
shimniok | 0:826c6171fc1b | 410 | static inline float mavlink_msg_image_available_get_roll(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 411 | { |
shimniok | 0:826c6171fc1b | 412 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 413 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 414 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 415 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 416 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 417 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 418 | } |
shimniok | 0:826c6171fc1b | 419 | |
shimniok | 0:826c6171fc1b | 420 | /** |
shimniok | 0:826c6171fc1b | 421 | * @brief Get field pitch from image_available message |
shimniok | 0:826c6171fc1b | 422 | * |
shimniok | 0:826c6171fc1b | 423 | * @return Pitch angle in rad |
shimniok | 0:826c6171fc1b | 424 | */ |
shimniok | 0:826c6171fc1b | 425 | static inline float mavlink_msg_image_available_get_pitch(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 426 | { |
shimniok | 0:826c6171fc1b | 427 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 428 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 429 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 430 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 431 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 432 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 433 | } |
shimniok | 0:826c6171fc1b | 434 | |
shimniok | 0:826c6171fc1b | 435 | /** |
shimniok | 0:826c6171fc1b | 436 | * @brief Get field yaw from image_available message |
shimniok | 0:826c6171fc1b | 437 | * |
shimniok | 0:826c6171fc1b | 438 | * @return Yaw angle in rad |
shimniok | 0:826c6171fc1b | 439 | */ |
shimniok | 0:826c6171fc1b | 440 | static inline float mavlink_msg_image_available_get_yaw(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 441 | { |
shimniok | 0:826c6171fc1b | 442 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 443 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 444 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 445 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 446 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 447 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 448 | } |
shimniok | 0:826c6171fc1b | 449 | |
shimniok | 0:826c6171fc1b | 450 | /** |
shimniok | 0:826c6171fc1b | 451 | * @brief Get field local_z from image_available message |
shimniok | 0:826c6171fc1b | 452 | * |
shimniok | 0:826c6171fc1b | 453 | * @return Local frame Z coordinate (height over ground) |
shimniok | 0:826c6171fc1b | 454 | */ |
shimniok | 0:826c6171fc1b | 455 | static inline float mavlink_msg_image_available_get_local_z(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 456 | { |
shimniok | 0:826c6171fc1b | 457 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 458 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 459 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 460 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 461 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 462 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 463 | } |
shimniok | 0:826c6171fc1b | 464 | |
shimniok | 0:826c6171fc1b | 465 | /** |
shimniok | 0:826c6171fc1b | 466 | * @brief Get field lat from image_available message |
shimniok | 0:826c6171fc1b | 467 | * |
shimniok | 0:826c6171fc1b | 468 | * @return GPS X coordinate |
shimniok | 0:826c6171fc1b | 469 | */ |
shimniok | 0:826c6171fc1b | 470 | static inline float mavlink_msg_image_available_get_lat(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 471 | { |
shimniok | 0:826c6171fc1b | 472 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 473 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 474 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 475 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 476 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 477 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 478 | } |
shimniok | 0:826c6171fc1b | 479 | |
shimniok | 0:826c6171fc1b | 480 | /** |
shimniok | 0:826c6171fc1b | 481 | * @brief Get field lon from image_available message |
shimniok | 0:826c6171fc1b | 482 | * |
shimniok | 0:826c6171fc1b | 483 | * @return GPS Y coordinate |
shimniok | 0:826c6171fc1b | 484 | */ |
shimniok | 0:826c6171fc1b | 485 | static inline float mavlink_msg_image_available_get_lon(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 486 | { |
shimniok | 0:826c6171fc1b | 487 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 488 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 489 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 490 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 491 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 492 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 493 | } |
shimniok | 0:826c6171fc1b | 494 | |
shimniok | 0:826c6171fc1b | 495 | /** |
shimniok | 0:826c6171fc1b | 496 | * @brief Get field alt from image_available message |
shimniok | 0:826c6171fc1b | 497 | * |
shimniok | 0:826c6171fc1b | 498 | * @return Global frame altitude |
shimniok | 0:826c6171fc1b | 499 | */ |
shimniok | 0:826c6171fc1b | 500 | static inline float mavlink_msg_image_available_get_alt(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 501 | { |
shimniok | 0:826c6171fc1b | 502 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 503 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 504 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 505 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 506 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 507 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 508 | } |
shimniok | 0:826c6171fc1b | 509 | |
shimniok | 0:826c6171fc1b | 510 | /** |
shimniok | 0:826c6171fc1b | 511 | * @brief Get field ground_x from image_available message |
shimniok | 0:826c6171fc1b | 512 | * |
shimniok | 0:826c6171fc1b | 513 | * @return Ground truth X |
shimniok | 0:826c6171fc1b | 514 | */ |
shimniok | 0:826c6171fc1b | 515 | static inline float mavlink_msg_image_available_get_ground_x(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 516 | { |
shimniok | 0:826c6171fc1b | 517 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 518 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 519 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 520 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 521 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 522 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 523 | } |
shimniok | 0:826c6171fc1b | 524 | |
shimniok | 0:826c6171fc1b | 525 | /** |
shimniok | 0:826c6171fc1b | 526 | * @brief Get field ground_y from image_available message |
shimniok | 0:826c6171fc1b | 527 | * |
shimniok | 0:826c6171fc1b | 528 | * @return Ground truth Y |
shimniok | 0:826c6171fc1b | 529 | */ |
shimniok | 0:826c6171fc1b | 530 | static inline float mavlink_msg_image_available_get_ground_y(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 531 | { |
shimniok | 0:826c6171fc1b | 532 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 533 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 534 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 535 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 536 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 537 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 538 | } |
shimniok | 0:826c6171fc1b | 539 | |
shimniok | 0:826c6171fc1b | 540 | /** |
shimniok | 0:826c6171fc1b | 541 | * @brief Get field ground_z from image_available message |
shimniok | 0:826c6171fc1b | 542 | * |
shimniok | 0:826c6171fc1b | 543 | * @return Ground truth Z |
shimniok | 0:826c6171fc1b | 544 | */ |
shimniok | 0:826c6171fc1b | 545 | static inline float mavlink_msg_image_available_get_ground_z(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 546 | { |
shimniok | 0:826c6171fc1b | 547 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 548 | r.b[3] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 549 | r.b[2] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 550 | r.b[1] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 551 | r.b[0] = (msg->payload+sizeof(uint64_t)+sizeof(uint8_t)+sizeof(uint64_t)+sizeof(uint64_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint8_t)+sizeof(uint32_t)+sizeof(uint32_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 552 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 553 | } |
shimniok | 0:826c6171fc1b | 554 | |
shimniok | 0:826c6171fc1b | 555 | /** |
shimniok | 0:826c6171fc1b | 556 | * @brief Decode a image_available message into a struct |
shimniok | 0:826c6171fc1b | 557 | * |
shimniok | 0:826c6171fc1b | 558 | * @param msg The message to decode |
shimniok | 0:826c6171fc1b | 559 | * @param image_available C-struct to decode the message contents into |
shimniok | 0:826c6171fc1b | 560 | */ |
shimniok | 0:826c6171fc1b | 561 | static inline void mavlink_msg_image_available_decode(const mavlink_message_t* msg, mavlink_image_available_t* image_available) |
shimniok | 0:826c6171fc1b | 562 | { |
shimniok | 0:826c6171fc1b | 563 | image_available->cam_id = mavlink_msg_image_available_get_cam_id(msg); |
shimniok | 0:826c6171fc1b | 564 | image_available->cam_no = mavlink_msg_image_available_get_cam_no(msg); |
shimniok | 0:826c6171fc1b | 565 | image_available->timestamp = mavlink_msg_image_available_get_timestamp(msg); |
shimniok | 0:826c6171fc1b | 566 | image_available->valid_until = mavlink_msg_image_available_get_valid_until(msg); |
shimniok | 0:826c6171fc1b | 567 | image_available->img_seq = mavlink_msg_image_available_get_img_seq(msg); |
shimniok | 0:826c6171fc1b | 568 | image_available->img_buf_index = mavlink_msg_image_available_get_img_buf_index(msg); |
shimniok | 0:826c6171fc1b | 569 | image_available->width = mavlink_msg_image_available_get_width(msg); |
shimniok | 0:826c6171fc1b | 570 | image_available->height = mavlink_msg_image_available_get_height(msg); |
shimniok | 0:826c6171fc1b | 571 | image_available->depth = mavlink_msg_image_available_get_depth(msg); |
shimniok | 0:826c6171fc1b | 572 | image_available->channels = mavlink_msg_image_available_get_channels(msg); |
shimniok | 0:826c6171fc1b | 573 | image_available->key = mavlink_msg_image_available_get_key(msg); |
shimniok | 0:826c6171fc1b | 574 | image_available->exposure = mavlink_msg_image_available_get_exposure(msg); |
shimniok | 0:826c6171fc1b | 575 | image_available->gain = mavlink_msg_image_available_get_gain(msg); |
shimniok | 0:826c6171fc1b | 576 | image_available->roll = mavlink_msg_image_available_get_roll(msg); |
shimniok | 0:826c6171fc1b | 577 | image_available->pitch = mavlink_msg_image_available_get_pitch(msg); |
shimniok | 0:826c6171fc1b | 578 | image_available->yaw = mavlink_msg_image_available_get_yaw(msg); |
shimniok | 0:826c6171fc1b | 579 | image_available->local_z = mavlink_msg_image_available_get_local_z(msg); |
shimniok | 0:826c6171fc1b | 580 | image_available->lat = mavlink_msg_image_available_get_lat(msg); |
shimniok | 0:826c6171fc1b | 581 | image_available->lon = mavlink_msg_image_available_get_lon(msg); |
shimniok | 0:826c6171fc1b | 582 | image_available->alt = mavlink_msg_image_available_get_alt(msg); |
shimniok | 0:826c6171fc1b | 583 | image_available->ground_x = mavlink_msg_image_available_get_ground_x(msg); |
shimniok | 0:826c6171fc1b | 584 | image_available->ground_y = mavlink_msg_image_available_get_ground_y(msg); |
shimniok | 0:826c6171fc1b | 585 | image_available->ground_z = mavlink_msg_image_available_get_ground_z(msg); |
shimniok | 0:826c6171fc1b | 586 | } |