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
+39 -39
View File
@@ -3,20 +3,20 @@
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140
MAVPACKED(
typedef struct __mavlink_actuator_control_target_t {
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.*/
float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/
uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/
}) mavlink_actuator_control_target_t;
} mavlink_actuator_control_target_t;
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 41
#define MAVLINK_MSG_ID_140_LEN 41
#define MAVLINK_MSG_ID_140_MIN_LEN 41
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 37
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 37
#define MAVLINK_MSG_ID_140_LEN 37
#define MAVLINK_MSG_ID_140_MIN_LEN 37
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 181
#define MAVLINK_MSG_ID_140_CRC 181
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 74
#define MAVLINK_MSG_ID_140_CRC 74
#define MAVLINK_MSG_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
@@ -25,18 +25,18 @@ typedef struct __mavlink_actuator_control_target_t {
140, \
"ACTUATOR_CONTROL_TARGET", \
3, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 4, offsetof(mavlink_actuator_control_target_t, controls) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
"ACTUATOR_CONTROL_TARGET", \
3, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 4, offsetof(mavlink_actuator_control_target_t, controls) }, \
} \
}
#endif
@@ -52,14 +52,14 @@ typedef struct __mavlink_actuator_control_target_t {
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, uint8_t group_mlx, const float *controls)
static inline uint16_t mavlink_msg_actuator_control_target_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_usec, uint8_t group_mlx, const float *controls)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 40, group_mlx);
_mav_put_float_array(buf, 8, controls, 8);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 36, group_mlx);
_mav_put_float_array(buf, 4, controls, 8);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
#else
mavlink_actuator_control_target_t packet;
@@ -84,15 +84,15 @@ static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_i
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,uint8_t group_mlx,const float *controls)
uint32_t time_usec,uint8_t group_mlx,const float *controls)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 40, group_mlx);
_mav_put_float_array(buf, 8, controls, 8);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 36, group_mlx);
_mav_put_float_array(buf, 4, controls, 8);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
#else
mavlink_actuator_control_target_t packet;
@@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t sys
* @param msg The MAVLink message to compress the data into
* @param actuator_control_target C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
static inline uint16_t mavlink_msg_actuator_control_target_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
{
return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
}
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system
* @param msg The MAVLink message to compress the data into
* @param actuator_control_target C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
{
return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
}
@@ -143,13 +143,13 @@ static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t s
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t group_mlx, const float *controls)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 40, group_mlx);
_mav_put_float_array(buf, 8, controls, 8);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 36, group_mlx);
_mav_put_float_array(buf, 4, controls, 8);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
#else
mavlink_actuator_control_target_t packet;
@@ -182,13 +182,13 @@ static inline void mavlink_msg_actuator_control_target_send_struct(mavlink_chann
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_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint8_t group_mlx, const float *controls)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 40, group_mlx);
_mav_put_float_array(buf, 8, controls, 8);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint8_t(buf, 36, group_mlx);
_mav_put_float_array(buf, 4, controls, 8);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
#else
mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf;
@@ -210,9 +210,9 @@ static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_
*
* @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_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
static inline uint32_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
@@ -222,7 +222,7 @@ static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const m
*/
static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 40);
return _MAV_RETURN_uint8_t(msg, 36);
}
/**
@@ -232,7 +232,7 @@ static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const ma
*/
static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
{
return _MAV_RETURN_float_array(msg, controls, 8, 8);
return _MAV_RETURN_float_array(msg, controls, 8, 4);
}
/**