✨feat: 更好兼容matlab
uin64->uint32 payload64->payload
This commit is contained in:
@@ -3,22 +3,22 @@
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103
|
||||
|
||||
MAVPACKED(
|
||||
|
||||
typedef struct __mavlink_vision_speed_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/s] Global X speed*/
|
||||
float y; /*< [m/s] Global Y speed*/
|
||||
float z; /*< [m/s] Global Z speed*/
|
||||
float covariance[9]; /*< Linear velocity covariance matrix (1st three entries - 1st row, etc.)*/
|
||||
}) mavlink_vision_speed_estimate_t;
|
||||
} mavlink_vision_speed_estimate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 56
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN 20
|
||||
#define MAVLINK_MSG_ID_103_LEN 56
|
||||
#define MAVLINK_MSG_ID_103_MIN_LEN 20
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 52
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN 16
|
||||
#define MAVLINK_MSG_ID_103_LEN 52
|
||||
#define MAVLINK_MSG_ID_103_MIN_LEN 16
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 208
|
||||
#define MAVLINK_MSG_ID_103_CRC 208
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 164
|
||||
#define MAVLINK_MSG_ID_103_CRC 164
|
||||
|
||||
#define MAVLINK_MSG_VISION_SPEED_ESTIMATE_FIELD_COVARIANCE_LEN 9
|
||||
|
||||
@@ -27,22 +27,22 @@ typedef struct __mavlink_vision_speed_estimate_t {
|
||||
103, \
|
||||
"VISION_SPEED_ESTIMATE", \
|
||||
5, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 20, offsetof(mavlink_vision_speed_estimate_t, covariance) }, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vision_speed_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, z) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 16, offsetof(mavlink_vision_speed_estimate_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
|
||||
"VISION_SPEED_ESTIMATE", \
|
||||
5, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 20, offsetof(mavlink_vision_speed_estimate_t, covariance) }, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vision_speed_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, z) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 16, offsetof(mavlink_vision_speed_estimate_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
@@ -60,16 +60,16 @@ typedef struct __mavlink_vision_speed_estimate_t {
|
||||
* @param covariance Linear velocity covariance matrix (1st three entries - 1st row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t usec, float x, float y, float z, const float *covariance)
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t usec, float x, float y, float z, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_SPEED_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_array(buf, 20, covariance, 9);
|
||||
_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_array(buf, 16, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_vision_speed_estimate_t packet;
|
||||
@@ -98,17 +98,17 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id,
|
||||
* @param covariance Linear velocity covariance matrix (1st three entries - 1st row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
static inline uint16_t mavlink_msg_vision_speed_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,const float *covariance)
|
||||
uint32_t usec,float x,float y,float z,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_SPEED_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_array(buf, 20, covariance, 9);
|
||||
_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_array(buf, 16, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_vision_speed_estimate_t packet;
|
||||
@@ -132,7 +132,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vision_speed_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
|
||||
{
|
||||
return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z, vision_speed_estimate->covariance);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vision_speed_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
|
||||
{
|
||||
return mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, chan, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z, vision_speed_estimate->covariance);
|
||||
}
|
||||
@@ -163,15 +163,15 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint8_t sys
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, const float *covariance)
|
||||
static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint32_t usec, float x, float y, float z, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_SPEED_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_array(buf, 20, covariance, 9);
|
||||
_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_array(buf, 16, covariance, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_vision_speed_estimate_t packet;
|
||||
@@ -206,15 +206,15 @@ static inline void mavlink_msg_vision_speed_estimate_send_struct(mavlink_channel
|
||||
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_speed_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, const float *covariance)
|
||||
static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t usec, float x, float y, float z, 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_array(buf, 20, covariance, 9);
|
||||
_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_array(buf, 16, covariance, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_vision_speed_estimate_t *packet = (mavlink_vision_speed_estimate_t *)msgbuf;
|
||||
@@ -238,9 +238,9 @@ static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t
|
||||
*
|
||||
* @return [us] Timestamp (UNIX time or time since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,7 +250,7 @@ static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_
|
||||
*/
|
||||
static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,7 +260,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_messag
|
||||
*/
|
||||
static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,7 +270,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_messag
|
||||
*/
|
||||
static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,7 +280,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_messag
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_speed_estimate_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 9, 20);
|
||||
return _MAV_RETURN_float_array(msg, covariance, 9, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user