GCS_MAVLink: generate after updating LANDING_TARGET msg

This commit is contained in:
Daniel Nugent 2015-09-11 18:11:02 +09:00 committed by Randy Mackay
parent eba8dcffde
commit 3aa0063f31
4 changed files with 124 additions and 49 deletions

View File

@ -16,11 +16,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 0, 0, 0, 0, 36, 60, 14, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 12, 18, 34, 66, 98, 8, 48, 19, 3, 20, 24, 29, 45, 4, 40, 2, 0, 0, 29, 0, 0, 0, 0, 27, 44, 22, 25, 0, 0, 0, 0, 0, 42, 14, 2, 3, 2, 1, 33, 1, 6, 2, 4, 2, 3, 2, 0, 1, 3, 2, 4, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 254, 36, 30, 18, 18, 51, 9, 0}
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 0, 0, 0, 0, 36, 60, 30, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 12, 18, 34, 66, 98, 8, 48, 19, 3, 20, 24, 29, 45, 4, 40, 2, 0, 0, 29, 0, 0, 0, 0, 27, 44, 22, 25, 0, 0, 0, 0, 0, 42, 14, 2, 3, 2, 1, 33, 1, 6, 2, 4, 2, 3, 2, 0, 1, 3, 2, 4, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 254, 36, 30, 18, 18, 51, 9, 0}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 0, 0, 0, 0, 154, 178, 255, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 229, 85, 0, 0, 72, 0, 0, 0, 0, 92, 36, 71, 98, 0, 0, 0, 0, 0, 134, 205, 94, 128, 54, 63, 112, 201, 221, 226, 238, 103, 235, 14, 0, 77, 50, 163, 115, 47, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 0, 0, 0, 0, 154, 178, 200, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 229, 85, 0, 0, 72, 0, 0, 0, 0, 92, 36, 71, 98, 0, 0, 0, 0, 0, 134, 205, 94, 128, 54, 63, 112, 201, 221, 226, 238, 103, 235, 14, 0, 77, 50, 163, 115, 47, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}
#endif
#ifndef MAVLINK_MESSAGE_INFO

View File

@ -16,11 +16,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 0, 0, 0, 0, 36, 60, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 254, 36, 30, 18, 18, 51, 9, 0}
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 0, 0, 0, 0, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 254, 36, 30, 18, 18, 51, 9, 0}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 0, 0, 0, 0, 154, 178, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 0, 0, 0, 0, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}
#endif
#ifndef MAVLINK_MESSAGE_INFO

View File

@ -4,29 +4,35 @@
typedef struct __mavlink_landing_target_t
{
uint64_t time_usec; ///< Timestamp (micros since boot or Unix epoch)
float angle_x; ///< X-axis angular offset (in radians) of the target from the center of the image
float angle_y; ///< Y-axis angular offset (in radians) of the target from the center of the image
float distance; ///< Distance to the target from the vehicle in meters
float size_x; ///< Size in radians of target along x-axis
float size_y; ///< Size in radians of target along y-axis
uint8_t target_num; ///< The ID of the target if multiple targets are present
uint8_t frame; ///< MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
} mavlink_landing_target_t;
#define MAVLINK_MSG_ID_LANDING_TARGET_LEN 14
#define MAVLINK_MSG_ID_149_LEN 14
#define MAVLINK_MSG_ID_LANDING_TARGET_LEN 30
#define MAVLINK_MSG_ID_149_LEN 30
#define MAVLINK_MSG_ID_LANDING_TARGET_CRC 255
#define MAVLINK_MSG_ID_149_CRC 255
#define MAVLINK_MSG_ID_LANDING_TARGET_CRC 200
#define MAVLINK_MSG_ID_149_CRC 200
#define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
"LANDING_TARGET", \
5, \
{ { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_landing_target_t, angle_x) }, \
{ "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_landing_target_t, angle_y) }, \
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, distance) }, \
{ "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_landing_target_t, target_num) }, \
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_landing_target_t, frame) }, \
8, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
{ "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
{ "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
{ "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
{ "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
{ "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
} \
}
@ -37,30 +43,39 @@ typedef struct __mavlink_landing_target_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param time_usec Timestamp (micros since boot or Unix epoch)
* @param target_num The ID of the target if multiple targets are present
* @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
* @param angle_x X-axis angular offset (in radians) of the target from the center of the image
* @param angle_y Y-axis angular offset (in radians) of the target from the center of the image
* @param distance Distance to the target from the vehicle in meters
* @param size_x Size in radians of target along x-axis
* @param size_y Size in radians of target along y-axis
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance)
uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
_mav_put_float(buf, 0, angle_x);
_mav_put_float(buf, 4, angle_y);
_mav_put_float(buf, 8, distance);
_mav_put_uint8_t(buf, 12, target_num);
_mav_put_uint8_t(buf, 13, frame);
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, angle_x);
_mav_put_float(buf, 12, angle_y);
_mav_put_float(buf, 16, distance);
_mav_put_float(buf, 20, size_x);
_mav_put_float(buf, 24, size_y);
_mav_put_uint8_t(buf, 28, target_num);
_mav_put_uint8_t(buf, 29, frame);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
#else
mavlink_landing_target_t packet;
packet.time_usec = time_usec;
packet.angle_x = angle_x;
packet.angle_y = angle_y;
packet.distance = distance;
packet.size_x = size_x;
packet.size_y = size_y;
packet.target_num = target_num;
packet.frame = frame;
@ -81,31 +96,40 @@ static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param time_usec Timestamp (micros since boot or Unix epoch)
* @param target_num The ID of the target if multiple targets are present
* @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
* @param angle_x X-axis angular offset (in radians) of the target from the center of the image
* @param angle_y Y-axis angular offset (in radians) of the target from the center of the image
* @param distance Distance to the target from the vehicle in meters
* @param size_x Size in radians of target along x-axis
* @param size_y Size in radians of target along y-axis
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance)
uint64_t time_usec,uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance,float size_x,float size_y)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
_mav_put_float(buf, 0, angle_x);
_mav_put_float(buf, 4, angle_y);
_mav_put_float(buf, 8, distance);
_mav_put_uint8_t(buf, 12, target_num);
_mav_put_uint8_t(buf, 13, frame);
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, angle_x);
_mav_put_float(buf, 12, angle_y);
_mav_put_float(buf, 16, distance);
_mav_put_float(buf, 20, size_x);
_mav_put_float(buf, 24, size_y);
_mav_put_uint8_t(buf, 28, target_num);
_mav_put_uint8_t(buf, 29, frame);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
#else
mavlink_landing_target_t packet;
packet.time_usec = time_usec;
packet.angle_x = angle_x;
packet.angle_y = angle_y;
packet.distance = distance;
packet.size_x = size_x;
packet.size_y = size_y;
packet.target_num = target_num;
packet.frame = frame;
@ -130,7 +154,7 @@ static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, u
*/
static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
{
return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance);
return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y);
}
/**
@ -144,30 +168,36 @@ static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint
*/
static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
{
return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance);
return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y);
}
/**
* @brief Send a landing_target message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (micros since boot or Unix epoch)
* @param target_num The ID of the target if multiple targets are present
* @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
* @param angle_x X-axis angular offset (in radians) of the target from the center of the image
* @param angle_y Y-axis angular offset (in radians) of the target from the center of the image
* @param distance Distance to the target from the vehicle in meters
* @param size_x Size in radians of target along x-axis
* @param size_y Size in radians of target along y-axis
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance)
static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
_mav_put_float(buf, 0, angle_x);
_mav_put_float(buf, 4, angle_y);
_mav_put_float(buf, 8, distance);
_mav_put_uint8_t(buf, 12, target_num);
_mav_put_uint8_t(buf, 13, frame);
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, angle_x);
_mav_put_float(buf, 12, angle_y);
_mav_put_float(buf, 16, distance);
_mav_put_float(buf, 20, size_x);
_mav_put_float(buf, 24, size_y);
_mav_put_uint8_t(buf, 28, target_num);
_mav_put_uint8_t(buf, 29, frame);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
@ -176,9 +206,12 @@ static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint8
#endif
#else
mavlink_landing_target_t packet;
packet.time_usec = time_usec;
packet.angle_x = angle_x;
packet.angle_y = angle_y;
packet.distance = distance;
packet.size_x = size_x;
packet.size_y = size_y;
packet.target_num = target_num;
packet.frame = frame;
@ -198,15 +231,18 @@ static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint8
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance)
static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, angle_x);
_mav_put_float(buf, 4, angle_y);
_mav_put_float(buf, 8, distance);
_mav_put_uint8_t(buf, 12, target_num);
_mav_put_uint8_t(buf, 13, frame);
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, angle_x);
_mav_put_float(buf, 12, angle_y);
_mav_put_float(buf, 16, distance);
_mav_put_float(buf, 20, size_x);
_mav_put_float(buf, 24, size_y);
_mav_put_uint8_t(buf, 28, target_num);
_mav_put_uint8_t(buf, 29, frame);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
@ -215,9 +251,12 @@ static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf
#endif
#else
mavlink_landing_target_t *packet = (mavlink_landing_target_t *)msgbuf;
packet->time_usec = time_usec;
packet->angle_x = angle_x;
packet->angle_y = angle_y;
packet->distance = distance;
packet->size_x = size_x;
packet->size_y = size_y;
packet->target_num = target_num;
packet->frame = frame;
@ -235,6 +274,16 @@ static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf
// MESSAGE LANDING_TARGET UNPACKING
/**
* @brief Get field time_usec from landing_target message
*
* @return Timestamp (micros since boot or Unix epoch)
*/
static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field target_num from landing_target message
*
@ -242,7 +291,7 @@ static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf
*/
static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 12);
return _MAV_RETURN_uint8_t(msg, 28);
}
/**
@ -252,7 +301,7 @@ static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_me
*/
static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 13);
return _MAV_RETURN_uint8_t(msg, 29);
}
/**
@ -262,7 +311,7 @@ static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message
*/
static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
return _MAV_RETURN_float(msg, 8);
}
/**
@ -272,7 +321,7 @@ static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message
*/
static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 12);
}
/**
@ -282,7 +331,27 @@ static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message
*/
static inline float mavlink_msg_landing_target_get_distance(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field size_x from landing_target message
*
* @return Size in radians of target along x-axis
*/
static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field size_y from landing_target message
*
* @return Size in radians of target along y-axis
*/
static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
@ -294,9 +363,12 @@ static inline float mavlink_msg_landing_target_get_distance(const mavlink_messag
static inline void mavlink_msg_landing_target_decode(const mavlink_message_t* msg, mavlink_landing_target_t* landing_target)
{
#if MAVLINK_NEED_BYTE_SWAP
landing_target->time_usec = mavlink_msg_landing_target_get_time_usec(msg);
landing_target->angle_x = mavlink_msg_landing_target_get_angle_x(msg);
landing_target->angle_y = mavlink_msg_landing_target_get_angle_y(msg);
landing_target->distance = mavlink_msg_landing_target_get_distance(msg);
landing_target->size_x = mavlink_msg_landing_target_get_size_x(msg);
landing_target->size_y = mavlink_msg_landing_target_get_size_y(msg);
landing_target->target_num = mavlink_msg_landing_target_get_target_num(msg);
landing_target->frame = mavlink_msg_landing_target_get_frame(msg);
#else

View File

@ -5370,13 +5370,16 @@ static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id,
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_landing_target_t packet_in = {
17.0,45.0,73.0,41,108
93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,89,156
};
mavlink_landing_target_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.angle_x = packet_in.angle_x;
packet1.angle_y = packet_in.angle_y;
packet1.distance = packet_in.distance;
packet1.size_x = packet_in.size_x;
packet1.size_y = packet_in.size_y;
packet1.target_num = packet_in.target_num;
packet1.frame = packet_in.frame;
@ -5388,12 +5391,12 @@ static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance );
mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y );
mavlink_msg_landing_target_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance );
mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y );
mavlink_msg_landing_target_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@ -5406,7 +5409,7 @@ static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_landing_target_send(MAVLINK_COMM_1 , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance );
mavlink_msg_landing_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y );
mavlink_msg_landing_target_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}