✨feat: 更好兼容matlab
uin64->uint32 payload64->payload
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 102
|
||||
|
||||
MAVPACKED(
|
||||
|
||||
typedef struct __mavlink_vision_position_estimate_t {
|
||||
uint64_t usec; /*< [us] Timestamp (UNIX time or time since system boot)*/
|
||||
uint32_t usec; /*< [us] Timestamp (UNIX time or time since system boot)*/
|
||||
float x; /*< [m] Global X position*/
|
||||
float y; /*< [m] Global Y position*/
|
||||
float z; /*< [m] Global Z position*/
|
||||
@@ -13,15 +13,15 @@ typedef struct __mavlink_vision_position_estimate_t {
|
||||
float pitch; /*< [rad] Pitch angle*/
|
||||
float yaw; /*< [rad] Yaw angle*/
|
||||
float covariance[21]; /*< Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)*/
|
||||
}) mavlink_vision_position_estimate_t;
|
||||
} mavlink_vision_position_estimate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 116
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_102_LEN 116
|
||||
#define MAVLINK_MSG_ID_102_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 112
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_102_LEN 112
|
||||
#define MAVLINK_MSG_ID_102_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC 158
|
||||
#define MAVLINK_MSG_ID_102_CRC 158
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC 14
|
||||
#define MAVLINK_MSG_ID_102_CRC 14
|
||||
|
||||
#define MAVLINK_MSG_VISION_POSITION_ESTIMATE_FIELD_COVARIANCE_LEN 21
|
||||
|
||||
@@ -30,28 +30,28 @@ typedef struct __mavlink_vision_position_estimate_t {
|
||||
102, \
|
||||
"VISION_POSITION_ESTIMATE", \
|
||||
8, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_vision_position_estimate_t, covariance) }, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 28, offsetof(mavlink_vision_position_estimate_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \
|
||||
"VISION_POSITION_ESTIMATE", \
|
||||
8, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_vision_position_estimate_t, covariance) }, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 28, offsetof(mavlink_vision_position_estimate_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
@@ -72,19 +72,19 @@ typedef struct __mavlink_vision_position_estimate_t {
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
_mav_put_uint32_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
_mav_put_float_array(buf, 28, covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_vision_position_estimate_t packet;
|
||||
@@ -119,20 +119,20 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw,const float *covariance)
|
||||
uint32_t usec,float x,float y,float z,float roll,float pitch,float yaw,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
_mav_put_uint32_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
_mav_put_float_array(buf, 28, covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_vision_position_estimate_t packet;
|
||||
@@ -159,7 +159,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vision_position_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
|
||||
{
|
||||
return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw, vision_position_estimate->covariance);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vision_position_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
|
||||
{
|
||||
return mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw, vision_position_estimate->covariance);
|
||||
}
|
||||
@@ -193,18 +193,18 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint8_t
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint32_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
_mav_put_uint32_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
_mav_put_float_array(buf, 28, covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_vision_position_estimate_t packet;
|
||||
@@ -242,18 +242,18 @@ static inline void mavlink_msg_vision_position_estimate_send_struct(mavlink_chan
|
||||
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_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
static inline void mavlink_msg_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
_mav_put_uint32_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
_mav_put_float_array(buf, 28, covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_vision_position_estimate_t *packet = (mavlink_vision_position_estimate_t *)msgbuf;
|
||||
@@ -280,9 +280,9 @@ static inline void mavlink_msg_vision_position_estimate_send_buf(mavlink_message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX time or time since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +292,7 @@ static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavli
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,7 +302,7 @@ static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_mes
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,7 +312,7 @@ static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_mes
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +322,7 @@ static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_mes
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -332,7 +332,7 @@ static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -342,7 +342,7 @@ static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -352,7 +352,7 @@ static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_m
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_estimate_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 21, 32);
|
||||
return _MAV_RETURN_float_array(msg, covariance, 21, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user