✨feat: 更好兼容matlab
uin64->uint32 payload64->payload
This commit is contained in:
+102
-102
@@ -3,10 +3,9 @@
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET 144
|
||||
|
||||
MAVPACKED(
|
||||
|
||||
typedef struct __mavlink_follow_target_t {
|
||||
uint64_t timestamp; /*< [ms] Timestamp (time since system boot).*/
|
||||
uint64_t custom_state; /*< button states or switches of a tracker device*/
|
||||
uint32_t timestamp; /*< [ms] Timestamp (time since system boot).*/
|
||||
int32_t lat; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t lon; /*< [degE7] Longitude (WGS84)*/
|
||||
float alt; /*< [m] Altitude (MSL)*/
|
||||
@@ -15,16 +14,17 @@ typedef struct __mavlink_follow_target_t {
|
||||
float attitude_q[4]; /*< (1 0 0 0 for unknown)*/
|
||||
float rates[3]; /*< (0 0 0 for unknown)*/
|
||||
float position_cov[3]; /*< eph epv*/
|
||||
uint32_t custom_state; /*< button states or switches of a tracker device*/
|
||||
uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/
|
||||
}) mavlink_follow_target_t;
|
||||
} mavlink_follow_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93
|
||||
#define MAVLINK_MSG_ID_144_LEN 93
|
||||
#define MAVLINK_MSG_ID_144_MIN_LEN 93
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 85
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 85
|
||||
#define MAVLINK_MSG_ID_144_LEN 85
|
||||
#define MAVLINK_MSG_ID_144_MIN_LEN 85
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 127
|
||||
#define MAVLINK_MSG_ID_144_CRC 127
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 26
|
||||
#define MAVLINK_MSG_ID_144_CRC 26
|
||||
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_VEL_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ACC_LEN 3
|
||||
@@ -37,34 +37,34 @@ typedef struct __mavlink_follow_target_t {
|
||||
144, \
|
||||
"FOLLOW_TARGET", \
|
||||
11, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 16, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 40, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 56, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 80, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
|
||||
"FOLLOW_TARGET", \
|
||||
11, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 16, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 40, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 56, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 80, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
@@ -88,30 +88,30 @@ typedef struct __mavlink_follow_target_t {
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
static inline uint16_t mavlink_msg_follow_target_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint32_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_float(buf, 12, alt);
|
||||
_mav_put_uint32_t(buf, 80, custom_state);
|
||||
_mav_put_uint8_t(buf, 84, est_capabilities);
|
||||
_mav_put_float_array(buf, 16, vel, 3);
|
||||
_mav_put_float_array(buf, 28, acc, 3);
|
||||
_mav_put_float_array(buf, 40, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 56, rates, 3);
|
||||
_mav_put_float_array(buf, 68, position_cov, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.custom_state = custom_state;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
@@ -144,31 +144,31 @@ static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
static inline uint16_t mavlink_msg_follow_target_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state)
|
||||
uint32_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint32_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_float(buf, 12, alt);
|
||||
_mav_put_uint32_t(buf, 80, custom_state);
|
||||
_mav_put_uint8_t(buf, 84, est_capabilities);
|
||||
_mav_put_float_array(buf, 16, vel, 3);
|
||||
_mav_put_float_array(buf, 28, acc, 3);
|
||||
_mav_put_float_array(buf, 40, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 56, rates, 3);
|
||||
_mav_put_float_array(buf, 68, position_cov, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.custom_state = custom_state;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
@@ -190,7 +190,7 @@ static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, ui
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param follow_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
static inline uint16_t mavlink_msg_follow_target_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param follow_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
static inline uint16_t mavlink_msg_follow_target_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
}
|
||||
@@ -227,29 +227,29 @@ static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id,
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint32_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint32_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_float(buf, 12, alt);
|
||||
_mav_put_uint32_t(buf, 80, custom_state);
|
||||
_mav_put_uint8_t(buf, 84, est_capabilities);
|
||||
_mav_put_float_array(buf, 16, vel, 3);
|
||||
_mav_put_float_array(buf, 28, acc, 3);
|
||||
_mav_put_float_array(buf, 40, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 56, rates, 3);
|
||||
_mav_put_float_array(buf, 68, position_cov, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.custom_state = custom_state;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
@@ -282,29 +282,29 @@ static inline void mavlink_msg_follow_target_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_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint32_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_float(buf, 12, alt);
|
||||
_mav_put_uint32_t(buf, 80, custom_state);
|
||||
_mav_put_uint8_t(buf, 84, est_capabilities);
|
||||
_mav_put_float_array(buf, 16, vel, 3);
|
||||
_mav_put_float_array(buf, 28, acc, 3);
|
||||
_mav_put_float_array(buf, 40, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 56, rates, 3);
|
||||
_mav_put_float_array(buf, 68, position_cov, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#else
|
||||
mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf;
|
||||
packet->timestamp = timestamp;
|
||||
packet->custom_state = custom_state;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->custom_state = custom_state;
|
||||
packet->est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet->vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->acc, acc, sizeof(float)*3);
|
||||
@@ -326,9 +326,9 @@ static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf,
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +338,7 @@ static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_mes
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 92);
|
||||
return _MAV_RETURN_uint8_t(msg, 84);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,7 +348,7 @@ static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavli
|
||||
*/
|
||||
static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -358,7 +358,7 @@ static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t*
|
||||
*/
|
||||
static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,7 +368,7 @@ static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t*
|
||||
*/
|
||||
static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* m
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, vel, 3, 28);
|
||||
return _MAV_RETURN_float_array(msg, vel, 3, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -388,7 +388,7 @@ static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, acc, 3, 40);
|
||||
return _MAV_RETURN_float_array(msg, acc, 3, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,7 +398,7 @@ static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, attitude_q, 4, 52);
|
||||
return _MAV_RETURN_float_array(msg, attitude_q, 4, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -408,7 +408,7 @@ static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_me
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, rates, 3, 68);
|
||||
return _MAV_RETURN_float_array(msg, rates, 3, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,7 +418,7 @@ static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, position_cov, 3, 80);
|
||||
return _MAV_RETURN_float_array(msg, position_cov, 3, 68);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -426,9 +426,9 @@ static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_
|
||||
*
|
||||
* @return button states or switches of a tracker device
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg)
|
||||
static inline uint32_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
return _MAV_RETURN_uint32_t(msg, 80);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -441,7 +441,6 @@ static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg);
|
||||
follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg);
|
||||
follow_target->lat = mavlink_msg_follow_target_get_lat(msg);
|
||||
follow_target->lon = mavlink_msg_follow_target_get_lon(msg);
|
||||
follow_target->alt = mavlink_msg_follow_target_get_alt(msg);
|
||||
@@ -450,6 +449,7 @@ static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg
|
||||
mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q);
|
||||
mavlink_msg_follow_target_get_rates(msg, follow_target->rates);
|
||||
mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov);
|
||||
follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg);
|
||||
follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FOLLOW_TARGET_LEN? msg->len : MAVLINK_MSG_ID_FOLLOW_TARGET_LEN;
|
||||
|
||||
Reference in New Issue
Block a user