This commit is contained in:
PX4BuildBot
2016-04-19 10:05:53 +00:00
parent 8868836564
commit 39c14e81ed
10 changed files with 120 additions and 120 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
// MESSAGE WIND PACKING
// MESSAGE WIND_COV PACKING
#define MAVLINK_MSG_ID_WIND 231
#define MAVLINK_MSG_ID_WIND_COV 231
typedef struct __mavlink_wind_t
typedef struct __mavlink_wind_cov_t
{
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
float wind_x; /*< Wind in X (NED) direction in m/s*/
@@ -13,34 +13,34 @@ typedef struct __mavlink_wind_t
float wind_alt; /*< AMSL altitude (m) this measurement was taken at*/
float horiz_accuracy; /*< Horizontal speed 1-STD accuracy*/
float vert_accuracy; /*< Vertical speed 1-STD accuracy*/
} mavlink_wind_t;
} mavlink_wind_cov_t;
#define MAVLINK_MSG_ID_WIND_LEN 40
#define MAVLINK_MSG_ID_WIND_COV_LEN 40
#define MAVLINK_MSG_ID_231_LEN 40
#define MAVLINK_MSG_ID_WIND_CRC 113
#define MAVLINK_MSG_ID_231_CRC 113
#define MAVLINK_MSG_ID_WIND_COV_CRC 105
#define MAVLINK_MSG_ID_231_CRC 105
#define MAVLINK_MESSAGE_INFO_WIND { \
"WIND", \
#define MAVLINK_MESSAGE_INFO_WIND_COV { \
"WIND_COV", \
9, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_t, time_usec) }, \
{ "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_t, wind_x) }, \
{ "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_t, wind_y) }, \
{ "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_t, wind_z) }, \
{ "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_t, var_horiz) }, \
{ "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_t, var_vert) }, \
{ "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_t, wind_alt) }, \
{ "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_t, horiz_accuracy) }, \
{ "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_t, vert_accuracy) }, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \
{ "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \
{ "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \
{ "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \
{ "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \
{ "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \
{ "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \
{ "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \
{ "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \
} \
}
/**
* @brief Pack a wind message
* @brief Pack a wind_cov message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
@@ -56,11 +56,11 @@ typedef struct __mavlink_wind_t
* @param vert_accuracy Vertical speed 1-STD accuracy
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WIND_LEN];
char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, wind_x);
_mav_put_float(buf, 12, wind_y);
@@ -71,9 +71,9 @@ static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t componen
_mav_put_float(buf, 32, horiz_accuracy);
_mav_put_float(buf, 36, vert_accuracy);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_LEN);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
#else
mavlink_wind_t packet;
mavlink_wind_cov_t packet;
packet.time_usec = time_usec;
packet.wind_x = wind_x;
packet.wind_y = wind_y;
@@ -84,19 +84,19 @@ static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t componen
packet.horiz_accuracy = horiz_accuracy;
packet.vert_accuracy = vert_accuracy;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_LEN);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WIND;
msg->msgid = MAVLINK_MSG_ID_WIND_COV;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_LEN);
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
}
/**
* @brief Pack a wind message on a channel
* @brief Pack a wind_cov message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
@@ -112,12 +112,12 @@ static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t componen
* @param vert_accuracy Vertical speed 1-STD accuracy
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,float wind_x,float wind_y,float wind_z,float var_horiz,float var_vert,float wind_alt,float horiz_accuracy,float vert_accuracy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WIND_LEN];
char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, wind_x);
_mav_put_float(buf, 12, wind_y);
@@ -128,9 +128,9 @@ static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t com
_mav_put_float(buf, 32, horiz_accuracy);
_mav_put_float(buf, 36, vert_accuracy);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_LEN);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
#else
mavlink_wind_t packet;
mavlink_wind_cov_t packet;
packet.time_usec = time_usec;
packet.wind_x = wind_x;
packet.wind_y = wind_y;
@@ -141,46 +141,46 @@ static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t com
packet.horiz_accuracy = horiz_accuracy;
packet.vert_accuracy = vert_accuracy;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_LEN);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WIND;
msg->msgid = MAVLINK_MSG_ID_WIND_COV;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_LEN);
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
}
/**
* @brief Encode a wind struct
* @brief Encode a wind_cov struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param wind C-struct to read the message contents from
* @param wind_cov C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_wind_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_t* wind)
static inline uint16_t mavlink_msg_wind_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
{
return mavlink_msg_wind_pack(system_id, component_id, msg, wind->time_usec, wind->wind_x, wind->wind_y, wind->wind_z, wind->var_horiz, wind->var_vert, wind->wind_alt, wind->horiz_accuracy, wind->vert_accuracy);
return mavlink_msg_wind_cov_pack(system_id, component_id, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
}
/**
* @brief Encode a wind struct on a channel
* @brief Encode a wind_cov struct on a channel
*
* @param system_id ID of this system
* @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 wind C-struct to read the message contents from
* @param wind_cov C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_wind_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_t* wind)
static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
{
return mavlink_msg_wind_pack_chan(system_id, component_id, chan, msg, wind->time_usec, wind->wind_x, wind->wind_y, wind->wind_z, wind->var_horiz, wind->var_vert, wind->wind_alt, wind->horiz_accuracy, wind->vert_accuracy);
return mavlink_msg_wind_cov_pack_chan(system_id, component_id, chan, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
}
/**
* @brief Send a wind message
* @brief Send a wind_cov message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (micros since boot or Unix epoch)
@@ -195,10 +195,10 @@ static inline uint16_t mavlink_msg_wind_encode_chan(uint8_t system_id, uint8_t c
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_wind_send(mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
static inline void mavlink_msg_wind_cov_send(mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WIND_LEN];
char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, wind_x);
_mav_put_float(buf, 12, wind_y);
@@ -210,12 +210,12 @@ static inline void mavlink_msg_wind_send(mavlink_channel_t chan, uint64_t time_u
_mav_put_float(buf, 36, vert_accuracy);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, MAVLINK_MSG_ID_WIND_LEN);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
#else
mavlink_wind_t packet;
mavlink_wind_cov_t packet;
packet.time_usec = time_usec;
packet.wind_x = wind_x;
packet.wind_y = wind_y;
@@ -227,14 +227,14 @@ static inline void mavlink_msg_wind_send(mavlink_channel_t chan, uint64_t time_u
packet.vert_accuracy = vert_accuracy;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, MAVLINK_MSG_ID_WIND_LEN);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_WIND_LEN <= MAVLINK_MAX_PAYLOAD_LEN
#if MAVLINK_MSG_ID_WIND_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
@@ -242,7 +242,7 @@ static inline void mavlink_msg_wind_send(mavlink_channel_t chan, uint64_t time_u
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_wind_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
@@ -257,12 +257,12 @@ static inline void mavlink_msg_wind_send_buf(mavlink_message_t *msgbuf, mavlink_
_mav_put_float(buf, 36, vert_accuracy);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, MAVLINK_MSG_ID_WIND_LEN);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
#else
mavlink_wind_t *packet = (mavlink_wind_t *)msgbuf;
mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf;
packet->time_usec = time_usec;
packet->wind_x = wind_x;
packet->wind_y = wind_y;
@@ -274,9 +274,9 @@ static inline void mavlink_msg_wind_send_buf(mavlink_message_t *msgbuf, mavlink_
packet->vert_accuracy = vert_accuracy;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)packet, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)packet, MAVLINK_MSG_ID_WIND_LEN);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
#endif
}
@@ -284,118 +284,118 @@ static inline void mavlink_msg_wind_send_buf(mavlink_message_t *msgbuf, mavlink_
#endif
// MESSAGE WIND UNPACKING
// MESSAGE WIND_COV UNPACKING
/**
* @brief Get field time_usec from wind message
* @brief Get field time_usec from wind_cov message
*
* @return Timestamp (micros since boot or Unix epoch)
*/
static inline uint64_t mavlink_msg_wind_get_time_usec(const mavlink_message_t* msg)
static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field wind_x from wind message
* @brief Get field wind_x from wind_cov message
*
* @return Wind in X (NED) direction in m/s
*/
static inline float mavlink_msg_wind_get_wind_x(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field wind_y from wind message
* @brief Get field wind_y from wind_cov message
*
* @return Wind in Y (NED) direction in m/s
*/
static inline float mavlink_msg_wind_get_wind_y(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field wind_z from wind message
* @brief Get field wind_z from wind_cov message
*
* @return Wind in Z (NED) direction in m/s
*/
static inline float mavlink_msg_wind_get_wind_z(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field var_horiz from wind message
* @brief Get field var_horiz from wind_cov message
*
* @return Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
*/
static inline float mavlink_msg_wind_get_var_horiz(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field var_vert from wind message
* @brief Get field var_vert from wind_cov message
*
* @return Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
*/
static inline float mavlink_msg_wind_get_var_vert(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field wind_alt from wind message
* @brief Get field wind_alt from wind_cov message
*
* @return AMSL altitude (m) this measurement was taken at
*/
static inline float mavlink_msg_wind_get_wind_alt(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field horiz_accuracy from wind message
* @brief Get field horiz_accuracy from wind_cov message
*
* @return Horizontal speed 1-STD accuracy
*/
static inline float mavlink_msg_wind_get_horiz_accuracy(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field vert_accuracy from wind message
* @brief Get field vert_accuracy from wind_cov message
*
* @return Vertical speed 1-STD accuracy
*/
static inline float mavlink_msg_wind_get_vert_accuracy(const mavlink_message_t* msg)
static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 36);
}
/**
* @brief Decode a wind message into a struct
* @brief Decode a wind_cov message into a struct
*
* @param msg The message to decode
* @param wind C-struct to decode the message contents into
* @param wind_cov C-struct to decode the message contents into
*/
static inline void mavlink_msg_wind_decode(const mavlink_message_t* msg, mavlink_wind_t* wind)
static inline void mavlink_msg_wind_cov_decode(const mavlink_message_t* msg, mavlink_wind_cov_t* wind_cov)
{
#if MAVLINK_NEED_BYTE_SWAP
wind->time_usec = mavlink_msg_wind_get_time_usec(msg);
wind->wind_x = mavlink_msg_wind_get_wind_x(msg);
wind->wind_y = mavlink_msg_wind_get_wind_y(msg);
wind->wind_z = mavlink_msg_wind_get_wind_z(msg);
wind->var_horiz = mavlink_msg_wind_get_var_horiz(msg);
wind->var_vert = mavlink_msg_wind_get_var_vert(msg);
wind->wind_alt = mavlink_msg_wind_get_wind_alt(msg);
wind->horiz_accuracy = mavlink_msg_wind_get_horiz_accuracy(msg);
wind->vert_accuracy = mavlink_msg_wind_get_vert_accuracy(msg);
wind_cov->time_usec = mavlink_msg_wind_cov_get_time_usec(msg);
wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg);
wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg);
wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg);
wind_cov->var_horiz = mavlink_msg_wind_cov_get_var_horiz(msg);
wind_cov->var_vert = mavlink_msg_wind_cov_get_var_vert(msg);
wind_cov->wind_alt = mavlink_msg_wind_cov_get_wind_alt(msg);
wind_cov->horiz_accuracy = mavlink_msg_wind_cov_get_horiz_accuracy(msg);
wind_cov->vert_accuracy = mavlink_msg_wind_cov_get_vert_accuracy(msg);
#else
memcpy(wind, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WIND_LEN);
memcpy(wind_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WIND_COV_LEN);
#endif
}
+13 -13
View File
@@ -5767,15 +5767,15 @@ static void mavlink_test_estimator_status(uint8_t system_id, uint8_t component_i
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
static void mavlink_test_wind_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_wind_t packet_in = {
mavlink_wind_cov_t packet_in = {
93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0
};
mavlink_wind_t packet1, packet2;
mavlink_wind_cov_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.wind_x = packet_in.wind_x;
@@ -5790,18 +5790,18 @@ static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_m
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_wind_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_wind_decode(&msg, &packet2);
mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_wind_cov_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_wind_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
mavlink_msg_wind_decode(&msg, &packet2);
mavlink_msg_wind_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
mavlink_msg_wind_cov_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_wind_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
mavlink_msg_wind_decode(&msg, &packet2);
mavlink_msg_wind_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
mavlink_msg_wind_cov_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
@@ -5809,12 +5809,12 @@ static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_m
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_wind_decode(last_msg, &packet2);
mavlink_msg_wind_cov_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_wind_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
mavlink_msg_wind_decode(last_msg, &packet2);
mavlink_msg_wind_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
mavlink_msg_wind_cov_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
@@ -6552,7 +6552,7 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_autopilot_version(system_id, component_id, last_msg);
mavlink_test_landing_target(system_id, component_id, last_msg);
mavlink_test_estimator_status(system_id, component_id, last_msg);
mavlink_test_wind(system_id, component_id, last_msg);
mavlink_test_wind_cov(system_id, component_id, last_msg);
mavlink_test_vibration(system_id, component_id, last_msg);
mavlink_test_home_position(system_id, component_id, last_msg);
mavlink_test_set_home_position(system_id, component_id, last_msg);
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -3301,7 +3301,7 @@
<field name="pos_horiz_accuracy" type="float">Horizontal position 1-STD accuracy relative to the EKF local origin (m)</field>
<field name="pos_vert_accuracy" type="float">Vertical position 1-STD accuracy relative to the EKF local origin (m)</field>
</message>
<message id="231" name="WIND">
<message id="231" name="WIND_COV">
<field type="uint64_t" name="time_usec">Timestamp (micros since boot or Unix epoch)</field>
<field type="float" name="wind_x">Wind in X (NED) direction in m/s</field>
<field type="float" name="wind_y">Wind in Y (NED) direction in m/s</field>
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long