feat: update definitions

This commit is contained in:
matt
2020-09-20 13:56:18 +08:00
parent 36a71efa12
commit b2baf4bffc
146 changed files with 28320 additions and 3729 deletions
+43 -18
View File
@@ -3,9 +3,9 @@
#define MAVLINK_MSG_ID_GPS2_RAW 124
MAVPACKED(
typedef struct __mavlink_gps2_raw_t {
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.*/
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 of the number.*/
int32_t lat; /*< [degE7] Latitude (WGS84)*/
int32_t lon; /*< [degE7] Longitude (WGS84)*/
int32_t alt; /*< [mm] Altitude (MSL). Positive for up.*/
@@ -17,11 +17,12 @@ typedef struct __mavlink_gps2_raw_t {
uint8_t fix_type; /*< GPS fix type.*/
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
uint8_t dgps_numch; /*< Number of DGPS satellites*/
} mavlink_gps2_raw_t;
uint16_t yaw; /*< [cdeg] Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.*/
}) mavlink_gps2_raw_t;
#define MAVLINK_MSG_ID_GPS2_RAW_LEN 31
#define MAVLINK_MSG_ID_GPS2_RAW_LEN 33
#define MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN 31
#define MAVLINK_MSG_ID_124_LEN 31
#define MAVLINK_MSG_ID_124_LEN 33
#define MAVLINK_MSG_ID_124_MIN_LEN 31
#define MAVLINK_MSG_ID_GPS2_RAW_CRC 7
@@ -33,7 +34,7 @@ typedef struct __mavlink_gps2_raw_t {
#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
124, \
"GPS2_RAW", \
12, \
13, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps2_raw_t, fix_type) }, \
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps2_raw_t, lat) }, \
@@ -46,12 +47,13 @@ typedef struct __mavlink_gps2_raw_t {
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
{ "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
{ "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
{ "yaw", NULL, MAVLINK_TYPE_UINT16_T, 0, 31, offsetof(mavlink_gps2_raw_t, yaw) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
"GPS2_RAW", \
12, \
13, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps2_raw_t, fix_type) }, \
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps2_raw_t, lat) }, \
@@ -64,6 +66,7 @@ typedef struct __mavlink_gps2_raw_t {
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
{ "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
{ "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
{ "yaw", NULL, MAVLINK_TYPE_UINT16_T, 0, 31, offsetof(mavlink_gps2_raw_t, yaw) }, \
} \
}
#endif
@@ -74,7 +77,7 @@ typedef struct __mavlink_gps2_raw_t {
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @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.
* @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 of the number.
* @param fix_type GPS fix type.
* @param lat [degE7] Latitude (WGS84)
* @param lon [degE7] Longitude (WGS84)
@@ -86,10 +89,11 @@ typedef struct __mavlink_gps2_raw_t {
* @param satellites_visible Number of satellites visible. If unknown, set to 255
* @param dgps_numch Number of DGPS satellites
* @param dgps_age [ms] Age of DGPS info
* @param yaw [cdeg] Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_gps2_raw_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
uint32_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age, uint16_t yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
@@ -105,6 +109,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint16_t system_id, uint8_t com
_mav_put_uint8_t(buf, 28, fix_type);
_mav_put_uint8_t(buf, 29, satellites_visible);
_mav_put_uint8_t(buf, 30, dgps_numch);
_mav_put_uint16_t(buf, 31, yaw);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
#else
@@ -121,6 +126,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint16_t system_id, uint8_t com
packet.fix_type = fix_type;
packet.satellites_visible = satellites_visible;
packet.dgps_numch = dgps_numch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
#endif
@@ -135,7 +141,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint16_t system_id, uint8_t com
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @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.
* @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 of the number.
* @param fix_type GPS fix type.
* @param lat [degE7] Latitude (WGS84)
* @param lon [degE7] Longitude (WGS84)
@@ -147,11 +153,12 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint16_t system_id, uint8_t com
* @param satellites_visible Number of satellites visible. If unknown, set to 255
* @param dgps_numch Number of DGPS satellites
* @param dgps_age [ms] Age of DGPS info
* @param yaw [cdeg] Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age)
uint32_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age,uint16_t yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
@@ -167,6 +174,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint16_t system_id, uint8_
_mav_put_uint8_t(buf, 28, fix_type);
_mav_put_uint8_t(buf, 29, satellites_visible);
_mav_put_uint8_t(buf, 30, dgps_numch);
_mav_put_uint16_t(buf, 31, yaw);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
#else
@@ -183,6 +191,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint16_t system_id, uint8_
packet.fix_type = fix_type;
packet.satellites_visible = satellites_visible;
packet.dgps_numch = dgps_numch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
#endif
@@ -201,7 +210,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint16_t system_id, uint8_
*/
static inline uint16_t mavlink_msg_gps2_raw_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
{
return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age, gps2_raw->yaw);
}
/**
@@ -215,14 +224,14 @@ static inline uint16_t mavlink_msg_gps2_raw_encode(uint16_t system_id, uint8_t c
*/
static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
{
return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age, gps2_raw->yaw);
}
/**
* @brief Send a gps2_raw message
* @param chan MAVLink channel to send the message
*
* @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.
* @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 of the number.
* @param fix_type GPS fix type.
* @param lat [degE7] Latitude (WGS84)
* @param lon [degE7] Longitude (WGS84)
@@ -234,10 +243,11 @@ static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint16_t system_id, uint
* @param satellites_visible Number of satellites visible. If unknown, set to 255
* @param dgps_numch Number of DGPS satellites
* @param dgps_age [ms] Age of DGPS info
* @param yaw [cdeg] Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age, uint16_t yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
@@ -253,6 +263,7 @@ static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint32_t ti
_mav_put_uint8_t(buf, 28, fix_type);
_mav_put_uint8_t(buf, 29, satellites_visible);
_mav_put_uint8_t(buf, 30, dgps_numch);
_mav_put_uint16_t(buf, 31, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
#else
@@ -269,6 +280,7 @@ static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint32_t ti
packet.fix_type = fix_type;
packet.satellites_visible = satellites_visible;
packet.dgps_numch = dgps_numch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
#endif
@@ -282,7 +294,7 @@ static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint32_t ti
static inline void mavlink_msg_gps2_raw_send_struct(mavlink_channel_t chan, const mavlink_gps2_raw_t* gps2_raw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_gps2_raw_send(chan, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
mavlink_msg_gps2_raw_send(chan, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age, gps2_raw->yaw);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)gps2_raw, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
#endif
@@ -296,7 +308,7 @@ static inline void mavlink_msg_gps2_raw_send_struct(mavlink_channel_t chan, cons
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_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age, uint16_t yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
@@ -312,6 +324,7 @@ static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavl
_mav_put_uint8_t(buf, 28, fix_type);
_mav_put_uint8_t(buf, 29, satellites_visible);
_mav_put_uint8_t(buf, 30, dgps_numch);
_mav_put_uint16_t(buf, 31, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
#else
@@ -328,6 +341,7 @@ static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavl
packet->fix_type = fix_type;
packet->satellites_visible = satellites_visible;
packet->dgps_numch = dgps_numch;
packet->yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
#endif
@@ -342,7 +356,7 @@ static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavl
/**
* @brief Get field time_usec from gps2_raw 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.
* @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 of the number.
*/
static inline uint32_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg)
{
@@ -459,6 +473,16 @@ static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t
return _MAV_RETURN_uint32_t(msg, 16);
}
/**
* @brief Get field yaw from gps2_raw message
*
* @return [cdeg] Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.
*/
static inline uint16_t mavlink_msg_gps2_raw_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 31);
}
/**
* @brief Decode a gps2_raw message into a struct
*
@@ -480,6 +504,7 @@ static inline void mavlink_msg_gps2_raw_decode(const mavlink_message_t* msg, mav
gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg);
gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg);
gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg);
gps2_raw->yaw = mavlink_msg_gps2_raw_get_yaw(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RAW_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RAW_LEN;
memset(gps2_raw, 0, MAVLINK_MSG_ID_GPS2_RAW_LEN);