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
+88 -13
View File
@@ -3,7 +3,7 @@
#define MAVLINK_MSG_ID_INS2 20104
MAVPACKED(
typedef struct __mavlink_ins2_t {
double lon; /*< lon(deg)*/
double lat; /*< lat(deg)*/
@@ -27,11 +27,14 @@ typedef struct __mavlink_ins2_t {
uint8_t gps_status; /*< gps_status*/
uint8_t BIT; /*< BIT*/
uint8_t seq; /*< sequeue index*/
} mavlink_ins2_t;
uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/
uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
}) mavlink_ins2_t;
#define MAVLINK_MSG_ID_INS2_LEN 85
#define MAVLINK_MSG_ID_INS2_LEN 90
#define MAVLINK_MSG_ID_INS2_MIN_LEN 85
#define MAVLINK_MSG_ID_20104_LEN 85
#define MAVLINK_MSG_ID_20104_LEN 90
#define MAVLINK_MSG_ID_20104_MIN_LEN 85
#define MAVLINK_MSG_ID_INS2_CRC 212
@@ -43,7 +46,7 @@ typedef struct __mavlink_ins2_t {
#define MAVLINK_MESSAGE_INFO_INS2 { \
20104, \
"INS2", \
22, \
25, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_ins2_t, time_boot_ms) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_ins2_t, pitch) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_ins2_t, roll) }, \
@@ -66,12 +69,15 @@ typedef struct __mavlink_ins2_t {
{ "gps_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_ins2_t, gps_status) }, \
{ "BIT", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_ins2_t, BIT) }, \
{ "seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_ins2_t, seq) }, \
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 85, offsetof(mavlink_ins2_t, eph) }, \
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 87, offsetof(mavlink_ins2_t, epv) }, \
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 89, offsetof(mavlink_ins2_t, satellites_visible) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_INS2 { \
"INS2", \
22, \
25, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_ins2_t, time_boot_ms) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_ins2_t, pitch) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_ins2_t, roll) }, \
@@ -94,6 +100,9 @@ typedef struct __mavlink_ins2_t {
{ "gps_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_ins2_t, gps_status) }, \
{ "BIT", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_ins2_t, BIT) }, \
{ "seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_ins2_t, seq) }, \
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 85, offsetof(mavlink_ins2_t, eph) }, \
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 87, offsetof(mavlink_ins2_t, epv) }, \
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 89, offsetof(mavlink_ins2_t, satellites_visible) }, \
} \
}
#endif
@@ -126,10 +135,13 @@ typedef struct __mavlink_ins2_t {
* @param gps_status gps_status
* @param BIT BIT
* @param seq sequeue index
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
* @param satellites_visible Number of satellites visible. If unknown, set to 255
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ins2_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, float pitch, float roll, float yaw, double lon, double lat, float alt, float v_north, float v_up, float v_east, float gx, float gy, float gz, float ax, float ay, float az, double time, uint8_t sys_status, uint8_t com_status, uint8_t gps_status, uint8_t BIT, uint8_t seq)
uint32_t time_boot_ms, float pitch, float roll, float yaw, double lon, double lat, float alt, float v_north, float v_up, float v_east, float gx, float gy, float gz, float ax, float ay, float az, double time, uint8_t sys_status, uint8_t com_status, uint8_t gps_status, uint8_t BIT, uint8_t seq, uint16_t eph, uint16_t epv, uint8_t satellites_visible)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_INS2_LEN];
@@ -155,6 +167,9 @@ static inline uint16_t mavlink_msg_ins2_pack(uint16_t system_id, uint8_t compone
_mav_put_uint8_t(buf, 82, gps_status);
_mav_put_uint8_t(buf, 83, BIT);
_mav_put_uint8_t(buf, 84, seq);
_mav_put_uint16_t(buf, 85, eph);
_mav_put_uint16_t(buf, 87, epv);
_mav_put_uint8_t(buf, 89, satellites_visible);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_INS2_LEN);
#else
@@ -181,6 +196,9 @@ static inline uint16_t mavlink_msg_ins2_pack(uint16_t system_id, uint8_t compone
packet.gps_status = gps_status;
packet.BIT = BIT;
packet.seq = seq;
packet.eph = eph;
packet.epv = epv;
packet.satellites_visible = satellites_visible;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_INS2_LEN);
#endif
@@ -217,11 +235,14 @@ static inline uint16_t mavlink_msg_ins2_pack(uint16_t system_id, uint8_t compone
* @param gps_status gps_status
* @param BIT BIT
* @param seq sequeue index
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
* @param satellites_visible Number of satellites visible. If unknown, set to 255
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ins2_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,float pitch,float roll,float yaw,double lon,double lat,float alt,float v_north,float v_up,float v_east,float gx,float gy,float gz,float ax,float ay,float az,double time,uint8_t sys_status,uint8_t com_status,uint8_t gps_status,uint8_t BIT,uint8_t seq)
uint32_t time_boot_ms,float pitch,float roll,float yaw,double lon,double lat,float alt,float v_north,float v_up,float v_east,float gx,float gy,float gz,float ax,float ay,float az,double time,uint8_t sys_status,uint8_t com_status,uint8_t gps_status,uint8_t BIT,uint8_t seq,uint16_t eph,uint16_t epv,uint8_t satellites_visible)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_INS2_LEN];
@@ -247,6 +268,9 @@ static inline uint16_t mavlink_msg_ins2_pack_chan(uint16_t system_id, uint8_t co
_mav_put_uint8_t(buf, 82, gps_status);
_mav_put_uint8_t(buf, 83, BIT);
_mav_put_uint8_t(buf, 84, seq);
_mav_put_uint16_t(buf, 85, eph);
_mav_put_uint16_t(buf, 87, epv);
_mav_put_uint8_t(buf, 89, satellites_visible);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_INS2_LEN);
#else
@@ -273,6 +297,9 @@ static inline uint16_t mavlink_msg_ins2_pack_chan(uint16_t system_id, uint8_t co
packet.gps_status = gps_status;
packet.BIT = BIT;
packet.seq = seq;
packet.eph = eph;
packet.epv = epv;
packet.satellites_visible = satellites_visible;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_INS2_LEN);
#endif
@@ -291,7 +318,7 @@ static inline uint16_t mavlink_msg_ins2_pack_chan(uint16_t system_id, uint8_t co
*/
static inline uint16_t mavlink_msg_ins2_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ins2_t* ins2)
{
return mavlink_msg_ins2_pack(system_id, component_id, msg, ins2->time_boot_ms, ins2->pitch, ins2->roll, ins2->yaw, ins2->lon, ins2->lat, ins2->alt, ins2->v_north, ins2->v_up, ins2->v_east, ins2->gx, ins2->gy, ins2->gz, ins2->ax, ins2->ay, ins2->az, ins2->time, ins2->sys_status, ins2->com_status, ins2->gps_status, ins2->BIT, ins2->seq);
return mavlink_msg_ins2_pack(system_id, component_id, msg, ins2->time_boot_ms, ins2->pitch, ins2->roll, ins2->yaw, ins2->lon, ins2->lat, ins2->alt, ins2->v_north, ins2->v_up, ins2->v_east, ins2->gx, ins2->gy, ins2->gz, ins2->ax, ins2->ay, ins2->az, ins2->time, ins2->sys_status, ins2->com_status, ins2->gps_status, ins2->BIT, ins2->seq, ins2->eph, ins2->epv, ins2->satellites_visible);
}
/**
@@ -305,7 +332,7 @@ static inline uint16_t mavlink_msg_ins2_encode(uint16_t system_id, uint8_t compo
*/
static inline uint16_t mavlink_msg_ins2_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ins2_t* ins2)
{
return mavlink_msg_ins2_pack_chan(system_id, component_id, chan, msg, ins2->time_boot_ms, ins2->pitch, ins2->roll, ins2->yaw, ins2->lon, ins2->lat, ins2->alt, ins2->v_north, ins2->v_up, ins2->v_east, ins2->gx, ins2->gy, ins2->gz, ins2->ax, ins2->ay, ins2->az, ins2->time, ins2->sys_status, ins2->com_status, ins2->gps_status, ins2->BIT, ins2->seq);
return mavlink_msg_ins2_pack_chan(system_id, component_id, chan, msg, ins2->time_boot_ms, ins2->pitch, ins2->roll, ins2->yaw, ins2->lon, ins2->lat, ins2->alt, ins2->v_north, ins2->v_up, ins2->v_east, ins2->gx, ins2->gy, ins2->gz, ins2->ax, ins2->ay, ins2->az, ins2->time, ins2->sys_status, ins2->com_status, ins2->gps_status, ins2->BIT, ins2->seq, ins2->eph, ins2->epv, ins2->satellites_visible);
}
/**
@@ -334,10 +361,13 @@ static inline uint16_t mavlink_msg_ins2_encode_chan(uint16_t system_id, uint8_t
* @param gps_status gps_status
* @param BIT BIT
* @param seq sequeue index
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
* @param satellites_visible Number of satellites visible. If unknown, set to 255
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ins2_send(mavlink_channel_t chan, uint32_t time_boot_ms, float pitch, float roll, float yaw, double lon, double lat, float alt, float v_north, float v_up, float v_east, float gx, float gy, float gz, float ax, float ay, float az, double time, uint8_t sys_status, uint8_t com_status, uint8_t gps_status, uint8_t BIT, uint8_t seq)
static inline void mavlink_msg_ins2_send(mavlink_channel_t chan, uint32_t time_boot_ms, float pitch, float roll, float yaw, double lon, double lat, float alt, float v_north, float v_up, float v_east, float gx, float gy, float gz, float ax, float ay, float az, double time, uint8_t sys_status, uint8_t com_status, uint8_t gps_status, uint8_t BIT, uint8_t seq, uint16_t eph, uint16_t epv, uint8_t satellites_visible)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_INS2_LEN];
@@ -363,6 +393,9 @@ static inline void mavlink_msg_ins2_send(mavlink_channel_t chan, uint32_t time_b
_mav_put_uint8_t(buf, 82, gps_status);
_mav_put_uint8_t(buf, 83, BIT);
_mav_put_uint8_t(buf, 84, seq);
_mav_put_uint16_t(buf, 85, eph);
_mav_put_uint16_t(buf, 87, epv);
_mav_put_uint8_t(buf, 89, satellites_visible);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_INS2, buf, MAVLINK_MSG_ID_INS2_MIN_LEN, MAVLINK_MSG_ID_INS2_LEN, MAVLINK_MSG_ID_INS2_CRC);
#else
@@ -389,6 +422,9 @@ static inline void mavlink_msg_ins2_send(mavlink_channel_t chan, uint32_t time_b
packet.gps_status = gps_status;
packet.BIT = BIT;
packet.seq = seq;
packet.eph = eph;
packet.epv = epv;
packet.satellites_visible = satellites_visible;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_INS2, (const char *)&packet, MAVLINK_MSG_ID_INS2_MIN_LEN, MAVLINK_MSG_ID_INS2_LEN, MAVLINK_MSG_ID_INS2_CRC);
#endif
@@ -402,7 +438,7 @@ static inline void mavlink_msg_ins2_send(mavlink_channel_t chan, uint32_t time_b
static inline void mavlink_msg_ins2_send_struct(mavlink_channel_t chan, const mavlink_ins2_t* ins2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_ins2_send(chan, ins2->time_boot_ms, ins2->pitch, ins2->roll, ins2->yaw, ins2->lon, ins2->lat, ins2->alt, ins2->v_north, ins2->v_up, ins2->v_east, ins2->gx, ins2->gy, ins2->gz, ins2->ax, ins2->ay, ins2->az, ins2->time, ins2->sys_status, ins2->com_status, ins2->gps_status, ins2->BIT, ins2->seq);
mavlink_msg_ins2_send(chan, ins2->time_boot_ms, ins2->pitch, ins2->roll, ins2->yaw, ins2->lon, ins2->lat, ins2->alt, ins2->v_north, ins2->v_up, ins2->v_east, ins2->gx, ins2->gy, ins2->gz, ins2->ax, ins2->ay, ins2->az, ins2->time, ins2->sys_status, ins2->com_status, ins2->gps_status, ins2->BIT, ins2->seq, ins2->eph, ins2->epv, ins2->satellites_visible);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_INS2, (const char *)ins2, MAVLINK_MSG_ID_INS2_MIN_LEN, MAVLINK_MSG_ID_INS2_LEN, MAVLINK_MSG_ID_INS2_CRC);
#endif
@@ -416,7 +452,7 @@ static inline void mavlink_msg_ins2_send_struct(mavlink_channel_t chan, const ma
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_ins2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float pitch, float roll, float yaw, double lon, double lat, float alt, float v_north, float v_up, float v_east, float gx, float gy, float gz, float ax, float ay, float az, double time, uint8_t sys_status, uint8_t com_status, uint8_t gps_status, uint8_t BIT, uint8_t seq)
static inline void mavlink_msg_ins2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float pitch, float roll, float yaw, double lon, double lat, float alt, float v_north, float v_up, float v_east, float gx, float gy, float gz, float ax, float ay, float az, double time, uint8_t sys_status, uint8_t com_status, uint8_t gps_status, uint8_t BIT, uint8_t seq, uint16_t eph, uint16_t epv, uint8_t satellites_visible)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
@@ -442,6 +478,9 @@ static inline void mavlink_msg_ins2_send_buf(mavlink_message_t *msgbuf, mavlink_
_mav_put_uint8_t(buf, 82, gps_status);
_mav_put_uint8_t(buf, 83, BIT);
_mav_put_uint8_t(buf, 84, seq);
_mav_put_uint16_t(buf, 85, eph);
_mav_put_uint16_t(buf, 87, epv);
_mav_put_uint8_t(buf, 89, satellites_visible);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_INS2, buf, MAVLINK_MSG_ID_INS2_MIN_LEN, MAVLINK_MSG_ID_INS2_LEN, MAVLINK_MSG_ID_INS2_CRC);
#else
@@ -468,6 +507,9 @@ static inline void mavlink_msg_ins2_send_buf(mavlink_message_t *msgbuf, mavlink_
packet->gps_status = gps_status;
packet->BIT = BIT;
packet->seq = seq;
packet->eph = eph;
packet->epv = epv;
packet->satellites_visible = satellites_visible;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_INS2, (const char *)packet, MAVLINK_MSG_ID_INS2_MIN_LEN, MAVLINK_MSG_ID_INS2_LEN, MAVLINK_MSG_ID_INS2_CRC);
#endif
@@ -699,6 +741,36 @@ static inline uint8_t mavlink_msg_ins2_get_seq(const mavlink_message_t* msg)
return _MAV_RETURN_uint8_t(msg, 84);
}
/**
* @brief Get field eph from ins2 message
*
* @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
*/
static inline uint16_t mavlink_msg_ins2_get_eph(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 85);
}
/**
* @brief Get field epv from ins2 message
*
* @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
*/
static inline uint16_t mavlink_msg_ins2_get_epv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 87);
}
/**
* @brief Get field satellites_visible from ins2 message
*
* @return Number of satellites visible. If unknown, set to 255
*/
static inline uint8_t mavlink_msg_ins2_get_satellites_visible(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 89);
}
/**
* @brief Decode a ins2 message into a struct
*
@@ -730,6 +802,9 @@ static inline void mavlink_msg_ins2_decode(const mavlink_message_t* msg, mavlink
ins2->gps_status = mavlink_msg_ins2_get_gps_status(msg);
ins2->BIT = mavlink_msg_ins2_get_BIT(msg);
ins2->seq = mavlink_msg_ins2_get_seq(msg);
ins2->eph = mavlink_msg_ins2_get_eph(msg);
ins2->epv = mavlink_msg_ins2_get_epv(msg);
ins2->satellites_visible = mavlink_msg_ins2_get_satellites_visible(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_INS2_LEN? msg->len : MAVLINK_MSG_ID_INS2_LEN;
memset(ins2, 0, MAVLINK_MSG_ID_INS2_LEN);