✨feat: update definitions
This commit is contained in:
@@ -9,12 +9,13 @@ typedef struct __mavlink_vision_speed_estimate_t {
|
||||
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.)*/
|
||||
float covariance[9]; /*< Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array.*/
|
||||
uint8_t reset_counter; /*< Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.*/
|
||||
} mavlink_vision_speed_estimate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 52
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 53
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN 16
|
||||
#define MAVLINK_MSG_ID_103_LEN 52
|
||||
#define MAVLINK_MSG_ID_103_LEN 53
|
||||
#define MAVLINK_MSG_ID_103_MIN_LEN 16
|
||||
|
||||
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 164
|
||||
@@ -26,23 +27,25 @@ typedef struct __mavlink_vision_speed_estimate_t {
|
||||
#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
|
||||
103, \
|
||||
"VISION_SPEED_ESTIMATE", \
|
||||
5, \
|
||||
6, \
|
||||
{ { "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) }, \
|
||||
{ "reset_counter", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_vision_speed_estimate_t, reset_counter) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
|
||||
"VISION_SPEED_ESTIMATE", \
|
||||
5, \
|
||||
6, \
|
||||
{ { "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) }, \
|
||||
{ "reset_counter", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_vision_speed_estimate_t, reset_counter) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
@@ -57,11 +60,12 @@ typedef struct __mavlink_vision_speed_estimate_t {
|
||||
* @param x [m/s] Global X speed
|
||||
* @param y [m/s] Global Y speed
|
||||
* @param z [m/s] Global Z speed
|
||||
* @param covariance Linear velocity covariance matrix (1st three entries - 1st row, etc.)
|
||||
* @param covariance Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array.
|
||||
* @param reset_counter Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
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)
|
||||
uint32_t usec, float x, float y, float z, const float *covariance, uint8_t reset_counter)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN];
|
||||
@@ -69,6 +73,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint16_t system_id
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_uint8_t(buf, 52, reset_counter);
|
||||
_mav_put_float_array(buf, 16, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
#else
|
||||
@@ -77,6 +82,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint16_t system_id
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.reset_counter = reset_counter;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
#endif
|
||||
@@ -95,12 +101,13 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint16_t system_id
|
||||
* @param x [m/s] Global X speed
|
||||
* @param y [m/s] Global Y speed
|
||||
* @param z [m/s] Global Z speed
|
||||
* @param covariance Linear velocity covariance matrix (1st three entries - 1st row, etc.)
|
||||
* @param covariance Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array.
|
||||
* @param reset_counter Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
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,
|
||||
uint32_t usec,float x,float y,float z,const float *covariance)
|
||||
uint32_t usec,float x,float y,float z,const float *covariance,uint8_t reset_counter)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN];
|
||||
@@ -108,6 +115,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint16_t syst
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_uint8_t(buf, 52, reset_counter);
|
||||
_mav_put_float_array(buf, 16, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
#else
|
||||
@@ -116,6 +124,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint16_t syst
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.reset_counter = reset_counter;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
#endif
|
||||
@@ -134,7 +143,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint16_t syst
|
||||
*/
|
||||
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);
|
||||
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, vision_speed_estimate->reset_counter);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +157,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint16_t system_
|
||||
*/
|
||||
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);
|
||||
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, vision_speed_estimate->reset_counter);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,11 +168,12 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint16_t sy
|
||||
* @param x [m/s] Global X speed
|
||||
* @param y [m/s] Global Y speed
|
||||
* @param z [m/s] Global Z speed
|
||||
* @param covariance Linear velocity covariance matrix (1st three entries - 1st row, etc.)
|
||||
* @param covariance Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array.
|
||||
* @param reset_counter Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
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)
|
||||
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, uint8_t reset_counter)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN];
|
||||
@@ -171,6 +181,7 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_uint8_t(buf, 52, reset_counter);
|
||||
_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
|
||||
@@ -179,6 +190,7 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.reset_counter = reset_counter;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
|
||||
#endif
|
||||
@@ -192,7 +204,7 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan
|
||||
static inline void mavlink_msg_vision_speed_estimate_send_struct(mavlink_channel_t chan, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_vision_speed_estimate_send(chan, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z, vision_speed_estimate->covariance);
|
||||
mavlink_msg_vision_speed_estimate_send(chan, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z, vision_speed_estimate->covariance, vision_speed_estimate->reset_counter);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)vision_speed_estimate, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
|
||||
#endif
|
||||
@@ -206,7 +218,7 @@ 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, uint32_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, uint8_t reset_counter)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
@@ -214,6 +226,7 @@ static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_uint8_t(buf, 52, reset_counter);
|
||||
_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
|
||||
@@ -222,6 +235,7 @@ static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->reset_counter = reset_counter;
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
|
||||
#endif
|
||||
@@ -276,13 +290,23 @@ static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_messag
|
||||
/**
|
||||
* @brief Get field covariance from vision_speed_estimate message
|
||||
*
|
||||
* @return Linear velocity covariance matrix (1st three entries - 1st row, etc.)
|
||||
* @return Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array.
|
||||
*/
|
||||
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, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field reset_counter from vision_speed_estimate message
|
||||
*
|
||||
* @return Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_vision_speed_estimate_get_reset_counter(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a vision_speed_estimate message into a struct
|
||||
*
|
||||
@@ -297,6 +321,7 @@ static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_messag
|
||||
vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg);
|
||||
vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg);
|
||||
mavlink_msg_vision_speed_estimate_get_covariance(msg, vision_speed_estimate->covariance);
|
||||
vision_speed_estimate->reset_counter = mavlink_msg_vision_speed_estimate_get_reset_counter(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN;
|
||||
memset(vision_speed_estimate, 0, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
|
||||
|
||||
Reference in New Issue
Block a user