feat: 更好兼容matlab

uin64->uint32
payload64->payload
This commit is contained in:
matt
2020-09-20 10:12:24 +08:00
parent 1465895353
commit e79d1f21fb
289 changed files with 6428 additions and 15915 deletions
+19 -19
View File
@@ -16,12 +16,12 @@ typedef struct __mavlink_set_home_position_t {
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.*/
uint8_t target_system; /*< System ID.*/
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.*/
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_set_home_position_t;
#define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 61
#define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 57
#define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN 53
#define MAVLINK_MSG_ID_243_LEN 61
#define MAVLINK_MSG_ID_243_LEN 57
#define MAVLINK_MSG_ID_243_MIN_LEN 53
#define MAVLINK_MSG_ID_SET_HOME_POSITION_CRC 85
@@ -45,7 +45,7 @@ typedef struct __mavlink_set_home_position_t {
{ "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
{ "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
{ "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 53, offsetof(mavlink_set_home_position_t, time_usec) }, \
{ "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 53, offsetof(mavlink_set_home_position_t, time_usec) }, \
} \
}
#else
@@ -63,7 +63,7 @@ typedef struct __mavlink_set_home_position_t {
{ "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
{ "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
{ "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 53, offsetof(mavlink_set_home_position_t, time_usec) }, \
{ "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 53, offsetof(mavlink_set_home_position_t, time_usec) }, \
} \
}
#endif
@@ -88,8 +88,8 @@ typedef struct __mavlink_set_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_set_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, 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_set_home_position_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, 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_SET_HOME_POSITION_LEN];
@@ -103,7 +103,7 @@ static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uin
_mav_put_float(buf, 44, approach_y);
_mav_put_float(buf, 48, approach_z);
_mav_put_uint8_t(buf, 52, target_system);
_mav_put_uint64_t(buf, 53, time_usec);
_mav_put_uint32_t(buf, 53, time_usec);
_mav_put_float_array(buf, 24, q, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
#else
@@ -147,9 +147,9 @@ static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uin
* @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_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,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)
uint8_t target_system,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_SET_HOME_POSITION_LEN];
@@ -163,7 +163,7 @@ static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id
_mav_put_float(buf, 44, approach_y);
_mav_put_float(buf, 48, approach_z);
_mav_put_uint8_t(buf, 52, target_system);
_mav_put_uint64_t(buf, 53, time_usec);
_mav_put_uint32_t(buf, 53, time_usec);
_mav_put_float_array(buf, 24, q, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
#else
@@ -195,7 +195,7 @@ static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id
* @param msg The MAVLink message to compress the data into
* @param set_home_position C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
static inline uint16_t mavlink_msg_set_home_position_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
{
return mavlink_msg_set_home_position_pack(system_id, component_id, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z, set_home_position->time_usec);
}
@@ -209,7 +209,7 @@ static inline uint16_t mavlink_msg_set_home_position_encode(uint8_t system_id, u
* @param msg The MAVLink message to compress the data into
* @param set_home_position C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
{
return mavlink_msg_set_home_position_pack_chan(system_id, component_id, chan, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z, set_home_position->time_usec);
}
@@ -233,7 +233,7 @@ static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_home_position_send(mavlink_channel_t chan, uint8_t target_system, 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_set_home_position_send(mavlink_channel_t chan, uint8_t target_system, 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_SET_HOME_POSITION_LEN];
@@ -247,7 +247,7 @@ static inline void mavlink_msg_set_home_position_send(mavlink_channel_t chan, ui
_mav_put_float(buf, 44, approach_y);
_mav_put_float(buf, 48, approach_z);
_mav_put_uint8_t(buf, 52, target_system);
_mav_put_uint64_t(buf, 53, time_usec);
_mav_put_uint32_t(buf, 53, time_usec);
_mav_put_float_array(buf, 24, q, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
#else
@@ -290,7 +290,7 @@ static inline void mavlink_msg_set_home_position_send_struct(mavlink_channel_t c
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_set_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, 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_set_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, 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;
@@ -304,7 +304,7 @@ static inline void mavlink_msg_set_home_position_send_buf(mavlink_message_t *msg
_mav_put_float(buf, 44, approach_y);
_mav_put_float(buf, 48, approach_z);
_mav_put_uint8_t(buf, 52, target_system);
_mav_put_uint64_t(buf, 53, time_usec);
_mav_put_uint32_t(buf, 53, time_usec);
_mav_put_float_array(buf, 24, q, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
#else
@@ -446,9 +446,9 @@ static inline float mavlink_msg_set_home_position_get_approach_z(const mavlink_m
*
* @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_set_home_position_get_time_usec(const mavlink_message_t* msg)
static inline uint32_t mavlink_msg_set_home_position_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 53);
return _MAV_RETURN_uint32_t(msg, 53);
}
/**