✨feat: 更好兼容matlab
uin64->uint32 payload64->payload
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION 242
|
||||
|
||||
MAVPACKED(
|
||||
|
||||
typedef struct __mavlink_home_position_t {
|
||||
int32_t latitude; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t longitude; /*< [degE7] Longitude (WGS84)*/
|
||||
@@ -15,12 +15,12 @@ typedef struct __mavlink_home_position_t {
|
||||
float approach_x; /*< [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
|
||||
float approach_y; /*< [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
|
||||
float approach_z; /*< [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
}) mavlink_home_position_t;
|
||||
uint32_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
} mavlink_home_position_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_LEN 60
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_LEN 56
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52
|
||||
#define MAVLINK_MSG_ID_242_LEN 60
|
||||
#define MAVLINK_MSG_ID_242_LEN 56
|
||||
#define MAVLINK_MSG_ID_242_MIN_LEN 52
|
||||
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_CRC 104
|
||||
@@ -43,7 +43,7 @@ typedef struct __mavlink_home_position_t {
|
||||
{ "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
|
||||
{ "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
|
||||
{ "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
@@ -60,7 +60,7 @@ typedef struct __mavlink_home_position_t {
|
||||
{ "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
|
||||
{ "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
|
||||
{ "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
@@ -84,8 +84,8 @@ typedef struct __mavlink_home_position_t {
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint64_t time_usec)
|
||||
static inline uint16_t mavlink_msg_home_position_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint32_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
|
||||
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_uint32_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
#else
|
||||
@@ -140,9 +140,9 @@ static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
static inline uint16_t mavlink_msg_home_position_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z,uint64_t time_usec)
|
||||
int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z,uint32_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
|
||||
@@ -155,7 +155,7 @@ static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, ui
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_uint32_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
#else
|
||||
@@ -186,7 +186,7 @@ static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, ui
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param home_position C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
|
||||
static inline uint16_t mavlink_msg_home_position_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
|
||||
{
|
||||
return mavlink_msg_home_position_pack(system_id, component_id, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param home_position C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
|
||||
static inline uint16_t mavlink_msg_home_position_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
|
||||
{
|
||||
return mavlink_msg_home_position_pack_chan(system_id, component_id, chan, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id,
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint64_t time_usec)
|
||||
static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint32_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
|
||||
@@ -236,7 +236,7 @@ static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_uint32_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#else
|
||||
@@ -278,7 +278,7 @@ static inline void mavlink_msg_home_position_send_struct(mavlink_channel_t 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_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint64_t time_usec)
|
||||
static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint32_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
@@ -291,7 +291,7 @@ static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf,
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_uint32_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#else
|
||||
@@ -422,9 +422,9 @@ static inline float mavlink_msg_home_position_get_approach_z(const mavlink_messa
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_home_position_get_time_usec(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_home_position_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 52);
|
||||
return _MAV_RETURN_uint32_t(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user