✨feat: 更好兼容matlab
uin64->uint32 payload64->payload
This commit is contained in:
@@ -3,22 +3,22 @@
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA 11011
|
||||
|
||||
MAVPACKED(
|
||||
|
||||
typedef struct __mavlink_vision_position_delta_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (synced to UNIX time or since system boot).*/
|
||||
uint64_t time_delta_usec; /*< [us] Time since the last reported camera frame.*/
|
||||
uint32_t time_usec; /*< [us] Timestamp (synced to UNIX time or since system boot).*/
|
||||
uint32_t time_delta_usec; /*< [us] Time since the last reported camera frame.*/
|
||||
float angle_delta[3]; /*< Defines a rotation vector in body frame that rotates the vehicle from the previous to the current orientation.*/
|
||||
float position_delta[3]; /*< [m] Change in position from previous to current frame rotated into body frame (0=forward, 1=right, 2=down).*/
|
||||
float confidence; /*< [%] Normalised confidence value from 0 to 100.*/
|
||||
}) mavlink_vision_position_delta_t;
|
||||
} mavlink_vision_position_delta_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN 44
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN 44
|
||||
#define MAVLINK_MSG_ID_11011_LEN 44
|
||||
#define MAVLINK_MSG_ID_11011_MIN_LEN 44
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN 36
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_11011_LEN 36
|
||||
#define MAVLINK_MSG_ID_11011_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA_CRC 106
|
||||
#define MAVLINK_MSG_ID_11011_CRC 106
|
||||
#define MAVLINK_MSG_ID_VISION_POSITION_DELTA_CRC 187
|
||||
#define MAVLINK_MSG_ID_11011_CRC 187
|
||||
|
||||
#define MAVLINK_MSG_VISION_POSITION_DELTA_FIELD_ANGLE_DELTA_LEN 3
|
||||
#define MAVLINK_MSG_VISION_POSITION_DELTA_FIELD_POSITION_DELTA_LEN 3
|
||||
@@ -28,22 +28,22 @@ typedef struct __mavlink_vision_position_delta_t {
|
||||
11011, \
|
||||
"VISION_POSITION_DELTA", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_delta_t, time_usec) }, \
|
||||
{ "time_delta_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_vision_position_delta_t, time_delta_usec) }, \
|
||||
{ "angle_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 16, offsetof(mavlink_vision_position_delta_t, angle_delta) }, \
|
||||
{ "position_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_vision_position_delta_t, position_delta) }, \
|
||||
{ "confidence", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_vision_position_delta_t, confidence) }, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vision_position_delta_t, time_usec) }, \
|
||||
{ "time_delta_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_vision_position_delta_t, time_delta_usec) }, \
|
||||
{ "angle_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 8, offsetof(mavlink_vision_position_delta_t, angle_delta) }, \
|
||||
{ "position_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 20, offsetof(mavlink_vision_position_delta_t, position_delta) }, \
|
||||
{ "confidence", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_vision_position_delta_t, confidence) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_VISION_POSITION_DELTA { \
|
||||
"VISION_POSITION_DELTA", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_delta_t, time_usec) }, \
|
||||
{ "time_delta_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_vision_position_delta_t, time_delta_usec) }, \
|
||||
{ "angle_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 16, offsetof(mavlink_vision_position_delta_t, angle_delta) }, \
|
||||
{ "position_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_vision_position_delta_t, position_delta) }, \
|
||||
{ "confidence", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_vision_position_delta_t, confidence) }, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vision_position_delta_t, time_usec) }, \
|
||||
{ "time_delta_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_vision_position_delta_t, time_delta_usec) }, \
|
||||
{ "angle_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 8, offsetof(mavlink_vision_position_delta_t, angle_delta) }, \
|
||||
{ "position_delta", NULL, MAVLINK_TYPE_FLOAT, 3, 20, offsetof(mavlink_vision_position_delta_t, position_delta) }, \
|
||||
{ "confidence", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_vision_position_delta_t, confidence) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
@@ -61,16 +61,16 @@ typedef struct __mavlink_vision_position_delta_t {
|
||||
* @param confidence [%] Normalised confidence value from 0 to 100.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint64_t time_delta_usec, const float *angle_delta, const float *position_delta, float confidence)
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_usec, uint32_t time_delta_usec, const float *angle_delta, const float *position_delta, float confidence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, time_delta_usec);
|
||||
_mav_put_float(buf, 40, confidence);
|
||||
_mav_put_float_array(buf, 16, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 28, position_delta, 3);
|
||||
_mav_put_uint32_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 4, time_delta_usec);
|
||||
_mav_put_float(buf, 32, confidence);
|
||||
_mav_put_float_array(buf, 8, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 20, position_delta, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN);
|
||||
#else
|
||||
mavlink_vision_position_delta_t packet;
|
||||
@@ -99,17 +99,17 @@ static inline uint16_t mavlink_msg_vision_position_delta_pack(uint8_t system_id,
|
||||
* @param confidence [%] Normalised confidence value from 0 to 100.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint64_t time_delta_usec,const float *angle_delta,const float *position_delta,float confidence)
|
||||
uint32_t time_usec,uint32_t time_delta_usec,const float *angle_delta,const float *position_delta,float confidence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, time_delta_usec);
|
||||
_mav_put_float(buf, 40, confidence);
|
||||
_mav_put_float_array(buf, 16, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 28, position_delta, 3);
|
||||
_mav_put_uint32_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 4, time_delta_usec);
|
||||
_mav_put_float(buf, 32, confidence);
|
||||
_mav_put_float_array(buf, 8, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 20, position_delta, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN);
|
||||
#else
|
||||
mavlink_vision_position_delta_t packet;
|
||||
@@ -133,7 +133,7 @@ static inline uint16_t mavlink_msg_vision_position_delta_pack_chan(uint8_t syste
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vision_position_delta C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_delta_t* vision_position_delta)
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_delta_t* vision_position_delta)
|
||||
{
|
||||
return mavlink_msg_vision_position_delta_pack(system_id, component_id, msg, vision_position_delta->time_usec, vision_position_delta->time_delta_usec, vision_position_delta->angle_delta, vision_position_delta->position_delta, vision_position_delta->confidence);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ static inline uint16_t mavlink_msg_vision_position_delta_encode(uint8_t system_i
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vision_position_delta C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_position_delta_t* vision_position_delta)
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_position_delta_t* vision_position_delta)
|
||||
{
|
||||
return mavlink_msg_vision_position_delta_pack_chan(system_id, component_id, chan, msg, vision_position_delta->time_usec, vision_position_delta->time_delta_usec, vision_position_delta->angle_delta, vision_position_delta->position_delta, vision_position_delta->confidence);
|
||||
}
|
||||
@@ -164,15 +164,15 @@ static inline uint16_t mavlink_msg_vision_position_delta_encode_chan(uint8_t sys
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_vision_position_delta_send(mavlink_channel_t chan, uint64_t time_usec, uint64_t time_delta_usec, const float *angle_delta, const float *position_delta, float confidence)
|
||||
static inline void mavlink_msg_vision_position_delta_send(mavlink_channel_t chan, uint32_t time_usec, uint32_t time_delta_usec, const float *angle_delta, const float *position_delta, float confidence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, time_delta_usec);
|
||||
_mav_put_float(buf, 40, confidence);
|
||||
_mav_put_float_array(buf, 16, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 28, position_delta, 3);
|
||||
_mav_put_uint32_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 4, time_delta_usec);
|
||||
_mav_put_float(buf, 32, confidence);
|
||||
_mav_put_float_array(buf, 8, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 20, position_delta, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_DELTA, buf, MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN, MAVLINK_MSG_ID_VISION_POSITION_DELTA_CRC);
|
||||
#else
|
||||
mavlink_vision_position_delta_t packet;
|
||||
@@ -207,15 +207,15 @@ static inline void mavlink_msg_vision_position_delta_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_position_delta_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint64_t time_delta_usec, const float *angle_delta, const float *position_delta, float confidence)
|
||||
static inline void mavlink_msg_vision_position_delta_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint32_t time_delta_usec, const float *angle_delta, const float *position_delta, float confidence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, time_delta_usec);
|
||||
_mav_put_float(buf, 40, confidence);
|
||||
_mav_put_float_array(buf, 16, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 28, position_delta, 3);
|
||||
_mav_put_uint32_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 4, time_delta_usec);
|
||||
_mav_put_float(buf, 32, confidence);
|
||||
_mav_put_float_array(buf, 8, angle_delta, 3);
|
||||
_mav_put_float_array(buf, 20, position_delta, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_DELTA, buf, MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_DELTA_LEN, MAVLINK_MSG_ID_VISION_POSITION_DELTA_CRC);
|
||||
#else
|
||||
mavlink_vision_position_delta_t *packet = (mavlink_vision_position_delta_t *)msgbuf;
|
||||
@@ -239,9 +239,9 @@ static inline void mavlink_msg_vision_position_delta_send_buf(mavlink_message_t
|
||||
*
|
||||
* @return [us] Timestamp (synced to UNIX time or since system boot).
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_vision_position_delta_get_time_usec(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_vision_position_delta_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,9 +249,9 @@ static inline uint64_t mavlink_msg_vision_position_delta_get_time_usec(const mav
|
||||
*
|
||||
* @return [us] Time since the last reported camera frame.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_vision_position_delta_get_time_delta_usec(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_vision_position_delta_get_time_delta_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,7 +261,7 @@ static inline uint64_t mavlink_msg_vision_position_delta_get_time_delta_usec(con
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_get_angle_delta(const mavlink_message_t* msg, float *angle_delta)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, angle_delta, 3, 16);
|
||||
return _MAV_RETURN_float_array(msg, angle_delta, 3, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,7 +271,7 @@ static inline uint16_t mavlink_msg_vision_position_delta_get_angle_delta(const m
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_vision_position_delta_get_position_delta(const mavlink_message_t* msg, float *position_delta)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, position_delta, 3, 28);
|
||||
return _MAV_RETURN_float_array(msg, position_delta, 3, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,7 +281,7 @@ static inline uint16_t mavlink_msg_vision_position_delta_get_position_delta(cons
|
||||
*/
|
||||
static inline float mavlink_msg_vision_position_delta_get_confidence(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user