update ins1/ins2/atmo

This commit is contained in:
matt
2020-10-22 07:15:10 +08:00
parent 54c7286a2c
commit d1fe3a364f
11 changed files with 249 additions and 57 deletions
+38 -13
View File
@@ -3,7 +3,7 @@
#define MAVLINK_MSG_ID_EMB_ATMO_COM 20101
MAVPACKED(
typedef struct __mavlink_emb_atmo_com_t {
uint32_t time_boot_ms; /*< [ms] Timestamp (milliseconds since system boot)*/
float Airspeed; /*< Magnitude of air velocity [m/s]*/
@@ -12,11 +12,12 @@ typedef struct __mavlink_emb_atmo_com_t {
float ps; /*< Static pressure [Pa]*/
float qbar; /*< Dynamic pressure [Pa]*/
uint8_t seq; /*< sequeue index*/
} mavlink_emb_atmo_com_t;
float mach; /*< Mach*/
}) mavlink_emb_atmo_com_t;
#define MAVLINK_MSG_ID_EMB_ATMO_COM_LEN 25
#define MAVLINK_MSG_ID_EMB_ATMO_COM_LEN 29
#define MAVLINK_MSG_ID_EMB_ATMO_COM_MIN_LEN 25
#define MAVLINK_MSG_ID_20101_LEN 25
#define MAVLINK_MSG_ID_20101_LEN 29
#define MAVLINK_MSG_ID_20101_MIN_LEN 25
#define MAVLINK_MSG_ID_EMB_ATMO_COM_CRC 87
@@ -28,7 +29,7 @@ typedef struct __mavlink_emb_atmo_com_t {
#define MAVLINK_MESSAGE_INFO_EMB_ATMO_COM { \
20101, \
"EMB_ATMO_COM", \
7, \
8, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_emb_atmo_com_t, time_boot_ms) }, \
{ "Airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_emb_atmo_com_t, Airspeed) }, \
{ "beta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_emb_atmo_com_t, beta) }, \
@@ -36,12 +37,13 @@ typedef struct __mavlink_emb_atmo_com_t {
{ "ps", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_emb_atmo_com_t, ps) }, \
{ "qbar", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_emb_atmo_com_t, qbar) }, \
{ "seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_emb_atmo_com_t, seq) }, \
{ "mach", NULL, MAVLINK_TYPE_FLOAT, 0, 25, offsetof(mavlink_emb_atmo_com_t, mach) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_EMB_ATMO_COM { \
"EMB_ATMO_COM", \
7, \
8, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_emb_atmo_com_t, time_boot_ms) }, \
{ "Airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_emb_atmo_com_t, Airspeed) }, \
{ "beta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_emb_atmo_com_t, beta) }, \
@@ -49,6 +51,7 @@ typedef struct __mavlink_emb_atmo_com_t {
{ "ps", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_emb_atmo_com_t, ps) }, \
{ "qbar", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_emb_atmo_com_t, qbar) }, \
{ "seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_emb_atmo_com_t, seq) }, \
{ "mach", NULL, MAVLINK_TYPE_FLOAT, 0, 25, offsetof(mavlink_emb_atmo_com_t, mach) }, \
} \
}
#endif
@@ -66,10 +69,11 @@ typedef struct __mavlink_emb_atmo_com_t {
* @param ps Static pressure [Pa]
* @param qbar Dynamic pressure [Pa]
* @param seq sequeue index
* @param mach Mach
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_emb_atmo_com_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, float Airspeed, float beta, float alpha, float ps, float qbar, uint8_t seq)
uint32_t time_boot_ms, float Airspeed, float beta, float alpha, float ps, float qbar, uint8_t seq, float mach)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_EMB_ATMO_COM_LEN];
@@ -80,6 +84,7 @@ static inline uint16_t mavlink_msg_emb_atmo_com_pack(uint16_t system_id, uint8_t
_mav_put_float(buf, 16, ps);
_mav_put_float(buf, 20, qbar);
_mav_put_uint8_t(buf, 24, seq);
_mav_put_float(buf, 25, mach);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN);
#else
@@ -91,6 +96,7 @@ static inline uint16_t mavlink_msg_emb_atmo_com_pack(uint16_t system_id, uint8_t
packet.ps = ps;
packet.qbar = qbar;
packet.seq = seq;
packet.mach = mach;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN);
#endif
@@ -112,11 +118,12 @@ static inline uint16_t mavlink_msg_emb_atmo_com_pack(uint16_t system_id, uint8_t
* @param ps Static pressure [Pa]
* @param qbar Dynamic pressure [Pa]
* @param seq sequeue index
* @param mach Mach
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_emb_atmo_com_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,float Airspeed,float beta,float alpha,float ps,float qbar,uint8_t seq)
uint32_t time_boot_ms,float Airspeed,float beta,float alpha,float ps,float qbar,uint8_t seq,float mach)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_EMB_ATMO_COM_LEN];
@@ -127,6 +134,7 @@ static inline uint16_t mavlink_msg_emb_atmo_com_pack_chan(uint16_t system_id, ui
_mav_put_float(buf, 16, ps);
_mav_put_float(buf, 20, qbar);
_mav_put_uint8_t(buf, 24, seq);
_mav_put_float(buf, 25, mach);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN);
#else
@@ -138,6 +146,7 @@ static inline uint16_t mavlink_msg_emb_atmo_com_pack_chan(uint16_t system_id, ui
packet.ps = ps;
packet.qbar = qbar;
packet.seq = seq;
packet.mach = mach;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN);
#endif
@@ -156,7 +165,7 @@ static inline uint16_t mavlink_msg_emb_atmo_com_pack_chan(uint16_t system_id, ui
*/
static inline uint16_t mavlink_msg_emb_atmo_com_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_emb_atmo_com_t* emb_atmo_com)
{
return mavlink_msg_emb_atmo_com_pack(system_id, component_id, msg, emb_atmo_com->time_boot_ms, emb_atmo_com->Airspeed, emb_atmo_com->beta, emb_atmo_com->alpha, emb_atmo_com->ps, emb_atmo_com->qbar, emb_atmo_com->seq);
return mavlink_msg_emb_atmo_com_pack(system_id, component_id, msg, emb_atmo_com->time_boot_ms, emb_atmo_com->Airspeed, emb_atmo_com->beta, emb_atmo_com->alpha, emb_atmo_com->ps, emb_atmo_com->qbar, emb_atmo_com->seq, emb_atmo_com->mach);
}
/**
@@ -170,7 +179,7 @@ static inline uint16_t mavlink_msg_emb_atmo_com_encode(uint16_t system_id, uint8
*/
static inline uint16_t mavlink_msg_emb_atmo_com_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_emb_atmo_com_t* emb_atmo_com)
{
return mavlink_msg_emb_atmo_com_pack_chan(system_id, component_id, chan, msg, emb_atmo_com->time_boot_ms, emb_atmo_com->Airspeed, emb_atmo_com->beta, emb_atmo_com->alpha, emb_atmo_com->ps, emb_atmo_com->qbar, emb_atmo_com->seq);
return mavlink_msg_emb_atmo_com_pack_chan(system_id, component_id, chan, msg, emb_atmo_com->time_boot_ms, emb_atmo_com->Airspeed, emb_atmo_com->beta, emb_atmo_com->alpha, emb_atmo_com->ps, emb_atmo_com->qbar, emb_atmo_com->seq, emb_atmo_com->mach);
}
/**
@@ -184,10 +193,11 @@ static inline uint16_t mavlink_msg_emb_atmo_com_encode_chan(uint16_t system_id,
* @param ps Static pressure [Pa]
* @param qbar Dynamic pressure [Pa]
* @param seq sequeue index
* @param mach Mach
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_emb_atmo_com_send(mavlink_channel_t chan, uint32_t time_boot_ms, float Airspeed, float beta, float alpha, float ps, float qbar, uint8_t seq)
static inline void mavlink_msg_emb_atmo_com_send(mavlink_channel_t chan, uint32_t time_boot_ms, float Airspeed, float beta, float alpha, float ps, float qbar, uint8_t seq, float mach)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_EMB_ATMO_COM_LEN];
@@ -198,6 +208,7 @@ static inline void mavlink_msg_emb_atmo_com_send(mavlink_channel_t chan, uint32_
_mav_put_float(buf, 16, ps);
_mav_put_float(buf, 20, qbar);
_mav_put_uint8_t(buf, 24, seq);
_mav_put_float(buf, 25, mach);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EMB_ATMO_COM, buf, MAVLINK_MSG_ID_EMB_ATMO_COM_MIN_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_CRC);
#else
@@ -209,6 +220,7 @@ static inline void mavlink_msg_emb_atmo_com_send(mavlink_channel_t chan, uint32_
packet.ps = ps;
packet.qbar = qbar;
packet.seq = seq;
packet.mach = mach;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EMB_ATMO_COM, (const char *)&packet, MAVLINK_MSG_ID_EMB_ATMO_COM_MIN_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_CRC);
#endif
@@ -222,7 +234,7 @@ static inline void mavlink_msg_emb_atmo_com_send(mavlink_channel_t chan, uint32_
static inline void mavlink_msg_emb_atmo_com_send_struct(mavlink_channel_t chan, const mavlink_emb_atmo_com_t* emb_atmo_com)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_emb_atmo_com_send(chan, emb_atmo_com->time_boot_ms, emb_atmo_com->Airspeed, emb_atmo_com->beta, emb_atmo_com->alpha, emb_atmo_com->ps, emb_atmo_com->qbar, emb_atmo_com->seq);
mavlink_msg_emb_atmo_com_send(chan, emb_atmo_com->time_boot_ms, emb_atmo_com->Airspeed, emb_atmo_com->beta, emb_atmo_com->alpha, emb_atmo_com->ps, emb_atmo_com->qbar, emb_atmo_com->seq, emb_atmo_com->mach);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EMB_ATMO_COM, (const char *)emb_atmo_com, MAVLINK_MSG_ID_EMB_ATMO_COM_MIN_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_CRC);
#endif
@@ -236,7 +248,7 @@ static inline void mavlink_msg_emb_atmo_com_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_emb_atmo_com_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float Airspeed, float beta, float alpha, float ps, float qbar, uint8_t seq)
static inline void mavlink_msg_emb_atmo_com_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float Airspeed, float beta, float alpha, float ps, float qbar, uint8_t seq, float mach)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
@@ -247,6 +259,7 @@ static inline void mavlink_msg_emb_atmo_com_send_buf(mavlink_message_t *msgbuf,
_mav_put_float(buf, 16, ps);
_mav_put_float(buf, 20, qbar);
_mav_put_uint8_t(buf, 24, seq);
_mav_put_float(buf, 25, mach);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EMB_ATMO_COM, buf, MAVLINK_MSG_ID_EMB_ATMO_COM_MIN_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_CRC);
#else
@@ -258,6 +271,7 @@ static inline void mavlink_msg_emb_atmo_com_send_buf(mavlink_message_t *msgbuf,
packet->ps = ps;
packet->qbar = qbar;
packet->seq = seq;
packet->mach = mach;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EMB_ATMO_COM, (const char *)packet, MAVLINK_MSG_ID_EMB_ATMO_COM_MIN_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN, MAVLINK_MSG_ID_EMB_ATMO_COM_CRC);
#endif
@@ -339,6 +353,16 @@ static inline uint8_t mavlink_msg_emb_atmo_com_get_seq(const mavlink_message_t*
return _MAV_RETURN_uint8_t(msg, 24);
}
/**
* @brief Get field mach from emb_atmo_com message
*
* @return Mach
*/
static inline float mavlink_msg_emb_atmo_com_get_mach(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 25);
}
/**
* @brief Decode a emb_atmo_com message into a struct
*
@@ -355,6 +379,7 @@ static inline void mavlink_msg_emb_atmo_com_decode(const mavlink_message_t* msg,
emb_atmo_com->ps = mavlink_msg_emb_atmo_com_get_ps(msg);
emb_atmo_com->qbar = mavlink_msg_emb_atmo_com_get_qbar(msg);
emb_atmo_com->seq = mavlink_msg_emb_atmo_com_get_seq(msg);
emb_atmo_com->mach = mavlink_msg_emb_atmo_com_get_mach(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_EMB_ATMO_COM_LEN? msg->len : MAVLINK_MSG_ID_EMB_ATMO_COM_LEN;
memset(emb_atmo_com, 0, MAVLINK_MSG_ID_EMB_ATMO_COM_LEN);