This commit is contained in:
PX4BuildBot
2015-02-09 22:58:32 +00:00
parent 5320c041b5
commit 264f281962
15 changed files with 1125 additions and 13 deletions
+6 -3
View File
File diff suppressed because one or more lines are too long
+377
View File
@@ -0,0 +1,377 @@
// MESSAGE ASL_OBCTRL PACKING
#define MAVLINK_MSG_ID_ASL_OBCTRL 207
typedef struct __mavlink_asl_obctrl_t
{
uint64_t timestamp; ///< Time since system start [us]
float uElev; ///< Elevator command [~]
float uThrot; ///< Throttle command [~]
float uThrot2; ///< Throttle 2 command [~]
float uAilL; ///< Left aileron command [~]
float uAilR; ///< Right aileron command [~]
float uRud; ///< Rudder command [~]
uint8_t obctrl_status; ///< Off-board computer status
} mavlink_asl_obctrl_t;
#define MAVLINK_MSG_ID_ASL_OBCTRL_LEN 33
#define MAVLINK_MSG_ID_207_LEN 33
#define MAVLINK_MSG_ID_ASL_OBCTRL_CRC 234
#define MAVLINK_MSG_ID_207_CRC 234
#define MAVLINK_MESSAGE_INFO_ASL_OBCTRL { \
"ASL_OBCTRL", \
8, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_asl_obctrl_t, timestamp) }, \
{ "uElev", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_asl_obctrl_t, uElev) }, \
{ "uThrot", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_asl_obctrl_t, uThrot) }, \
{ "uThrot2", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_asl_obctrl_t, uThrot2) }, \
{ "uAilL", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_asl_obctrl_t, uAilL) }, \
{ "uAilR", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_asl_obctrl_t, uAilR) }, \
{ "uRud", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_asl_obctrl_t, uRud) }, \
{ "obctrl_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_asl_obctrl_t, obctrl_status) }, \
} \
}
/**
* @brief Pack a asl_obctrl 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
*
* @param timestamp Time since system start [us]
* @param uElev Elevator command [~]
* @param uThrot Throttle command [~]
* @param uThrot2 Throttle 2 command [~]
* @param uAilL Left aileron command [~]
* @param uAilR Right aileron command [~]
* @param uRud Rudder command [~]
* @param obctrl_status Off-board computer status
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_asl_obctrl_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t timestamp, float uElev, float uThrot, float uThrot2, float uAilL, float uAilR, float uRud, uint8_t obctrl_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ASL_OBCTRL_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, uElev);
_mav_put_float(buf, 12, uThrot);
_mav_put_float(buf, 16, uThrot2);
_mav_put_float(buf, 20, uAilL);
_mav_put_float(buf, 24, uAilR);
_mav_put_float(buf, 28, uRud);
_mav_put_uint8_t(buf, 32, obctrl_status);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#else
mavlink_asl_obctrl_t packet;
packet.timestamp = timestamp;
packet.uElev = uElev;
packet.uThrot = uThrot;
packet.uThrot2 = uThrot2;
packet.uAilL = uAilL;
packet.uAilR = uAilR;
packet.uRud = uRud;
packet.obctrl_status = obctrl_status;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ASL_OBCTRL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
}
/**
* @brief Pack a asl_obctrl 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
* @param msg The MAVLink message to compress the data into
* @param timestamp Time since system start [us]
* @param uElev Elevator command [~]
* @param uThrot Throttle command [~]
* @param uThrot2 Throttle 2 command [~]
* @param uAilL Left aileron command [~]
* @param uAilR Right aileron command [~]
* @param uRud Rudder command [~]
* @param obctrl_status Off-board computer status
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_asl_obctrl_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t timestamp,float uElev,float uThrot,float uThrot2,float uAilL,float uAilR,float uRud,uint8_t obctrl_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ASL_OBCTRL_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, uElev);
_mav_put_float(buf, 12, uThrot);
_mav_put_float(buf, 16, uThrot2);
_mav_put_float(buf, 20, uAilL);
_mav_put_float(buf, 24, uAilR);
_mav_put_float(buf, 28, uRud);
_mav_put_uint8_t(buf, 32, obctrl_status);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#else
mavlink_asl_obctrl_t packet;
packet.timestamp = timestamp;
packet.uElev = uElev;
packet.uThrot = uThrot;
packet.uThrot2 = uThrot2;
packet.uAilL = uAilL;
packet.uAilR = uAilR;
packet.uRud = uRud;
packet.obctrl_status = obctrl_status;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ASL_OBCTRL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
}
/**
* @brief Encode a asl_obctrl 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 asl_obctrl C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_asl_obctrl_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_asl_obctrl_t* asl_obctrl)
{
return mavlink_msg_asl_obctrl_pack(system_id, component_id, msg, asl_obctrl->timestamp, asl_obctrl->uElev, asl_obctrl->uThrot, asl_obctrl->uThrot2, asl_obctrl->uAilL, asl_obctrl->uAilR, asl_obctrl->uRud, asl_obctrl->obctrl_status);
}
/**
* @brief Encode a asl_obctrl 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 asl_obctrl C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_asl_obctrl_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_asl_obctrl_t* asl_obctrl)
{
return mavlink_msg_asl_obctrl_pack_chan(system_id, component_id, chan, msg, asl_obctrl->timestamp, asl_obctrl->uElev, asl_obctrl->uThrot, asl_obctrl->uThrot2, asl_obctrl->uAilL, asl_obctrl->uAilR, asl_obctrl->uRud, asl_obctrl->obctrl_status);
}
/**
* @brief Send a asl_obctrl message
* @param chan MAVLink channel to send the message
*
* @param timestamp Time since system start [us]
* @param uElev Elevator command [~]
* @param uThrot Throttle command [~]
* @param uThrot2 Throttle 2 command [~]
* @param uAilL Left aileron command [~]
* @param uAilR Right aileron command [~]
* @param uRud Rudder command [~]
* @param obctrl_status Off-board computer status
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_asl_obctrl_send(mavlink_channel_t chan, uint64_t timestamp, float uElev, float uThrot, float uThrot2, float uAilL, float uAilR, float uRud, uint8_t obctrl_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ASL_OBCTRL_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, uElev);
_mav_put_float(buf, 12, uThrot);
_mav_put_float(buf, 16, uThrot2);
_mav_put_float(buf, 20, uAilL);
_mav_put_float(buf, 24, uAilR);
_mav_put_float(buf, 28, uRud);
_mav_put_uint8_t(buf, 32, obctrl_status);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
#else
mavlink_asl_obctrl_t packet;
packet.timestamp = timestamp;
packet.uElev = uElev;
packet.uThrot = uThrot;
packet.uThrot2 = uThrot2;
packet.uAilL = uAilL;
packet.uAilR = uAilR;
packet.uRud = uRud;
packet.obctrl_status = obctrl_status;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)&packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)&packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_ASL_OBCTRL_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
mavlink_message_t which is the size of a full mavlink message. This
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_asl_obctrl_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, float uElev, float uThrot, float uThrot2, float uAilL, float uAilR, float uRud, uint8_t obctrl_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, uElev);
_mav_put_float(buf, 12, uThrot);
_mav_put_float(buf, 16, uThrot2);
_mav_put_float(buf, 20, uAilL);
_mav_put_float(buf, 24, uAilR);
_mav_put_float(buf, 28, uRud);
_mav_put_uint8_t(buf, 32, obctrl_status);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
#else
mavlink_asl_obctrl_t *packet = (mavlink_asl_obctrl_t *)msgbuf;
packet->timestamp = timestamp;
packet->uElev = uElev;
packet->uThrot = uThrot;
packet->uThrot2 = uThrot2;
packet->uAilL = uAilL;
packet->uAilR = uAilR;
packet->uRud = uRud;
packet->obctrl_status = obctrl_status;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE ASL_OBCTRL UNPACKING
/**
* @brief Get field timestamp from asl_obctrl message
*
* @return Time since system start [us]
*/
static inline uint64_t mavlink_msg_asl_obctrl_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field uElev from asl_obctrl message
*
* @return Elevator command [~]
*/
static inline float mavlink_msg_asl_obctrl_get_uElev(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field uThrot from asl_obctrl message
*
* @return Throttle command [~]
*/
static inline float mavlink_msg_asl_obctrl_get_uThrot(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field uThrot2 from asl_obctrl message
*
* @return Throttle 2 command [~]
*/
static inline float mavlink_msg_asl_obctrl_get_uThrot2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field uAilL from asl_obctrl message
*
* @return Left aileron command [~]
*/
static inline float mavlink_msg_asl_obctrl_get_uAilL(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field uAilR from asl_obctrl message
*
* @return Right aileron command [~]
*/
static inline float mavlink_msg_asl_obctrl_get_uAilR(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field uRud from asl_obctrl message
*
* @return Rudder command [~]
*/
static inline float mavlink_msg_asl_obctrl_get_uRud(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field obctrl_status from asl_obctrl message
*
* @return Off-board computer status
*/
static inline uint8_t mavlink_msg_asl_obctrl_get_obctrl_status(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 32);
}
/**
* @brief Decode a asl_obctrl message into a struct
*
* @param msg The message to decode
* @param asl_obctrl C-struct to decode the message contents into
*/
static inline void mavlink_msg_asl_obctrl_decode(const mavlink_message_t* msg, mavlink_asl_obctrl_t* asl_obctrl)
{
#if MAVLINK_NEED_BYTE_SWAP
asl_obctrl->timestamp = mavlink_msg_asl_obctrl_get_timestamp(msg);
asl_obctrl->uElev = mavlink_msg_asl_obctrl_get_uElev(msg);
asl_obctrl->uThrot = mavlink_msg_asl_obctrl_get_uThrot(msg);
asl_obctrl->uThrot2 = mavlink_msg_asl_obctrl_get_uThrot2(msg);
asl_obctrl->uAilL = mavlink_msg_asl_obctrl_get_uAilL(msg);
asl_obctrl->uAilR = mavlink_msg_asl_obctrl_get_uAilR(msg);
asl_obctrl->uRud = mavlink_msg_asl_obctrl_get_uRud(msg);
asl_obctrl->obctrl_status = mavlink_msg_asl_obctrl_get_obctrl_status(msg);
#else
memcpy(asl_obctrl, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
#endif
}
+353
View File
@@ -0,0 +1,353 @@
// MESSAGE EKF_EXT PACKING
#define MAVLINK_MSG_ID_EKF_EXT 206
typedef struct __mavlink_ekf_ext_t
{
uint64_t timestamp; ///< Time since system start [us]
float Windspeed; ///< Magnitude of wind velocity (in lateral inertial plane) [m/s]
float WindDir; ///< Wind heading angle from North [rad]
float WindZ; ///< Z (Down) component of inertial wind velocity [m/s]
float Airspeed; ///< Magnitude of air velocity [m/s]
float beta; ///< Sideslip angle [rad]
float alpha; ///< Angle of attack [rad]
} mavlink_ekf_ext_t;
#define MAVLINK_MSG_ID_EKF_EXT_LEN 32
#define MAVLINK_MSG_ID_206_LEN 32
#define MAVLINK_MSG_ID_EKF_EXT_CRC 64
#define MAVLINK_MSG_ID_206_CRC 64
#define MAVLINK_MESSAGE_INFO_EKF_EXT { \
"EKF_EXT", \
7, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ekf_ext_t, timestamp) }, \
{ "Windspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ekf_ext_t, Windspeed) }, \
{ "WindDir", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ekf_ext_t, WindDir) }, \
{ "WindZ", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_ekf_ext_t, WindZ) }, \
{ "Airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_ekf_ext_t, Airspeed) }, \
{ "beta", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_ekf_ext_t, beta) }, \
{ "alpha", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_ekf_ext_t, alpha) }, \
} \
}
/**
* @brief Pack a ekf_ext 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
*
* @param timestamp Time since system start [us]
* @param Windspeed Magnitude of wind velocity (in lateral inertial plane) [m/s]
* @param WindDir Wind heading angle from North [rad]
* @param WindZ Z (Down) component of inertial wind velocity [m/s]
* @param Airspeed Magnitude of air velocity [m/s]
* @param beta Sideslip angle [rad]
* @param alpha Angle of attack [rad]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ekf_ext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t timestamp, float Windspeed, float WindDir, float WindZ, float Airspeed, float beta, float alpha)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_EKF_EXT_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, Windspeed);
_mav_put_float(buf, 12, WindDir);
_mav_put_float(buf, 16, WindZ);
_mav_put_float(buf, 20, Airspeed);
_mav_put_float(buf, 24, beta);
_mav_put_float(buf, 28, alpha);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EKF_EXT_LEN);
#else
mavlink_ekf_ext_t packet;
packet.timestamp = timestamp;
packet.Windspeed = Windspeed;
packet.WindDir = WindDir;
packet.WindZ = WindZ;
packet.Airspeed = Airspeed;
packet.beta = beta;
packet.alpha = alpha;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_EKF_EXT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EKF_EXT_LEN, MAVLINK_MSG_ID_EKF_EXT_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
}
/**
* @brief Pack a ekf_ext 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
* @param msg The MAVLink message to compress the data into
* @param timestamp Time since system start [us]
* @param Windspeed Magnitude of wind velocity (in lateral inertial plane) [m/s]
* @param WindDir Wind heading angle from North [rad]
* @param WindZ Z (Down) component of inertial wind velocity [m/s]
* @param Airspeed Magnitude of air velocity [m/s]
* @param beta Sideslip angle [rad]
* @param alpha Angle of attack [rad]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ekf_ext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t timestamp,float Windspeed,float WindDir,float WindZ,float Airspeed,float beta,float alpha)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_EKF_EXT_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, Windspeed);
_mav_put_float(buf, 12, WindDir);
_mav_put_float(buf, 16, WindZ);
_mav_put_float(buf, 20, Airspeed);
_mav_put_float(buf, 24, beta);
_mav_put_float(buf, 28, alpha);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EKF_EXT_LEN);
#else
mavlink_ekf_ext_t packet;
packet.timestamp = timestamp;
packet.Windspeed = Windspeed;
packet.WindDir = WindDir;
packet.WindZ = WindZ;
packet.Airspeed = Airspeed;
packet.beta = beta;
packet.alpha = alpha;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_EKF_EXT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EKF_EXT_LEN, MAVLINK_MSG_ID_EKF_EXT_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
}
/**
* @brief Encode a ekf_ext 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 ekf_ext C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_ekf_ext_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ekf_ext_t* ekf_ext)
{
return mavlink_msg_ekf_ext_pack(system_id, component_id, msg, ekf_ext->timestamp, ekf_ext->Windspeed, ekf_ext->WindDir, ekf_ext->WindZ, ekf_ext->Airspeed, ekf_ext->beta, ekf_ext->alpha);
}
/**
* @brief Encode a ekf_ext 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 ekf_ext C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_ekf_ext_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ekf_ext_t* ekf_ext)
{
return mavlink_msg_ekf_ext_pack_chan(system_id, component_id, chan, msg, ekf_ext->timestamp, ekf_ext->Windspeed, ekf_ext->WindDir, ekf_ext->WindZ, ekf_ext->Airspeed, ekf_ext->beta, ekf_ext->alpha);
}
/**
* @brief Send a ekf_ext message
* @param chan MAVLink channel to send the message
*
* @param timestamp Time since system start [us]
* @param Windspeed Magnitude of wind velocity (in lateral inertial plane) [m/s]
* @param WindDir Wind heading angle from North [rad]
* @param WindZ Z (Down) component of inertial wind velocity [m/s]
* @param Airspeed Magnitude of air velocity [m/s]
* @param beta Sideslip angle [rad]
* @param alpha Angle of attack [rad]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ekf_ext_send(mavlink_channel_t chan, uint64_t timestamp, float Windspeed, float WindDir, float WindZ, float Airspeed, float beta, float alpha)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_EKF_EXT_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, Windspeed);
_mav_put_float(buf, 12, WindDir);
_mav_put_float(buf, 16, WindZ);
_mav_put_float(buf, 20, Airspeed);
_mav_put_float(buf, 24, beta);
_mav_put_float(buf, 28, alpha);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, buf, MAVLINK_MSG_ID_EKF_EXT_LEN, MAVLINK_MSG_ID_EKF_EXT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, buf, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
#else
mavlink_ekf_ext_t packet;
packet.timestamp = timestamp;
packet.Windspeed = Windspeed;
packet.WindDir = WindDir;
packet.WindZ = WindZ;
packet.Airspeed = Airspeed;
packet.beta = beta;
packet.alpha = alpha;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, (const char *)&packet, MAVLINK_MSG_ID_EKF_EXT_LEN, MAVLINK_MSG_ID_EKF_EXT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, (const char *)&packet, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_EKF_EXT_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
mavlink_message_t which is the size of a full mavlink message. This
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_ekf_ext_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, float Windspeed, float WindDir, float WindZ, float Airspeed, float beta, float alpha)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, Windspeed);
_mav_put_float(buf, 12, WindDir);
_mav_put_float(buf, 16, WindZ);
_mav_put_float(buf, 20, Airspeed);
_mav_put_float(buf, 24, beta);
_mav_put_float(buf, 28, alpha);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, buf, MAVLINK_MSG_ID_EKF_EXT_LEN, MAVLINK_MSG_ID_EKF_EXT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, buf, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
#else
mavlink_ekf_ext_t *packet = (mavlink_ekf_ext_t *)msgbuf;
packet->timestamp = timestamp;
packet->Windspeed = Windspeed;
packet->WindDir = WindDir;
packet->WindZ = WindZ;
packet->Airspeed = Airspeed;
packet->beta = beta;
packet->alpha = alpha;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, (const char *)packet, MAVLINK_MSG_ID_EKF_EXT_LEN, MAVLINK_MSG_ID_EKF_EXT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_EXT, (const char *)packet, MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE EKF_EXT UNPACKING
/**
* @brief Get field timestamp from ekf_ext message
*
* @return Time since system start [us]
*/
static inline uint64_t mavlink_msg_ekf_ext_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field Windspeed from ekf_ext message
*
* @return Magnitude of wind velocity (in lateral inertial plane) [m/s]
*/
static inline float mavlink_msg_ekf_ext_get_Windspeed(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field WindDir from ekf_ext message
*
* @return Wind heading angle from North [rad]
*/
static inline float mavlink_msg_ekf_ext_get_WindDir(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field WindZ from ekf_ext message
*
* @return Z (Down) component of inertial wind velocity [m/s]
*/
static inline float mavlink_msg_ekf_ext_get_WindZ(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field Airspeed from ekf_ext message
*
* @return Magnitude of air velocity [m/s]
*/
static inline float mavlink_msg_ekf_ext_get_Airspeed(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field beta from ekf_ext message
*
* @return Sideslip angle [rad]
*/
static inline float mavlink_msg_ekf_ext_get_beta(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field alpha from ekf_ext message
*
* @return Angle of attack [rad]
*/
static inline float mavlink_msg_ekf_ext_get_alpha(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a ekf_ext message into a struct
*
* @param msg The message to decode
* @param ekf_ext C-struct to decode the message contents into
*/
static inline void mavlink_msg_ekf_ext_decode(const mavlink_message_t* msg, mavlink_ekf_ext_t* ekf_ext)
{
#if MAVLINK_NEED_BYTE_SWAP
ekf_ext->timestamp = mavlink_msg_ekf_ext_get_timestamp(msg);
ekf_ext->Windspeed = mavlink_msg_ekf_ext_get_Windspeed(msg);
ekf_ext->WindDir = mavlink_msg_ekf_ext_get_WindDir(msg);
ekf_ext->WindZ = mavlink_msg_ekf_ext_get_WindZ(msg);
ekf_ext->Airspeed = mavlink_msg_ekf_ext_get_Airspeed(msg);
ekf_ext->beta = mavlink_msg_ekf_ext_get_beta(msg);
ekf_ext->alpha = mavlink_msg_ekf_ext_get_alpha(msg);
#else
memcpy(ekf_ext, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_EKF_EXT_LEN);
#endif
}
+233
View File
@@ -0,0 +1,233 @@
// MESSAGE SENS_ATMOS PACKING
#define MAVLINK_MSG_ID_SENS_ATMOS 208
typedef struct __mavlink_sens_atmos_t
{
float TempAmbient; ///< Ambient temperature [degrees Celsius]
float Humidity; ///< Relative humidity [%]
} mavlink_sens_atmos_t;
#define MAVLINK_MSG_ID_SENS_ATMOS_LEN 8
#define MAVLINK_MSG_ID_208_LEN 8
#define MAVLINK_MSG_ID_SENS_ATMOS_CRC 175
#define MAVLINK_MSG_ID_208_CRC 175
#define MAVLINK_MESSAGE_INFO_SENS_ATMOS { \
"SENS_ATMOS", \
2, \
{ { "TempAmbient", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sens_atmos_t, TempAmbient) }, \
{ "Humidity", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sens_atmos_t, Humidity) }, \
} \
}
/**
* @brief Pack a sens_atmos 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
*
* @param TempAmbient Ambient temperature [degrees Celsius]
* @param Humidity Relative humidity [%]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_sens_atmos_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float TempAmbient, float Humidity)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SENS_ATMOS_LEN];
_mav_put_float(buf, 0, TempAmbient);
_mav_put_float(buf, 4, Humidity);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#else
mavlink_sens_atmos_t packet;
packet.TempAmbient = TempAmbient;
packet.Humidity = Humidity;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SENS_ATMOS;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENS_ATMOS_LEN, MAVLINK_MSG_ID_SENS_ATMOS_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
}
/**
* @brief Pack a sens_atmos 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
* @param msg The MAVLink message to compress the data into
* @param TempAmbient Ambient temperature [degrees Celsius]
* @param Humidity Relative humidity [%]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_sens_atmos_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float TempAmbient,float Humidity)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SENS_ATMOS_LEN];
_mav_put_float(buf, 0, TempAmbient);
_mav_put_float(buf, 4, Humidity);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#else
mavlink_sens_atmos_t packet;
packet.TempAmbient = TempAmbient;
packet.Humidity = Humidity;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SENS_ATMOS;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENS_ATMOS_LEN, MAVLINK_MSG_ID_SENS_ATMOS_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
}
/**
* @brief Encode a sens_atmos 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 sens_atmos C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_sens_atmos_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sens_atmos_t* sens_atmos)
{
return mavlink_msg_sens_atmos_pack(system_id, component_id, msg, sens_atmos->TempAmbient, sens_atmos->Humidity);
}
/**
* @brief Encode a sens_atmos 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 sens_atmos C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_sens_atmos_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sens_atmos_t* sens_atmos)
{
return mavlink_msg_sens_atmos_pack_chan(system_id, component_id, chan, msg, sens_atmos->TempAmbient, sens_atmos->Humidity);
}
/**
* @brief Send a sens_atmos message
* @param chan MAVLink channel to send the message
*
* @param TempAmbient Ambient temperature [degrees Celsius]
* @param Humidity Relative humidity [%]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_sens_atmos_send(mavlink_channel_t chan, float TempAmbient, float Humidity)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SENS_ATMOS_LEN];
_mav_put_float(buf, 0, TempAmbient);
_mav_put_float(buf, 4, Humidity);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, buf, MAVLINK_MSG_ID_SENS_ATMOS_LEN, MAVLINK_MSG_ID_SENS_ATMOS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, buf, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
#else
mavlink_sens_atmos_t packet;
packet.TempAmbient = TempAmbient;
packet.Humidity = Humidity;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, (const char *)&packet, MAVLINK_MSG_ID_SENS_ATMOS_LEN, MAVLINK_MSG_ID_SENS_ATMOS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, (const char *)&packet, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_SENS_ATMOS_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
mavlink_message_t which is the size of a full mavlink message. This
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_sens_atmos_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float TempAmbient, float Humidity)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, TempAmbient);
_mav_put_float(buf, 4, Humidity);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, buf, MAVLINK_MSG_ID_SENS_ATMOS_LEN, MAVLINK_MSG_ID_SENS_ATMOS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, buf, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
#else
mavlink_sens_atmos_t *packet = (mavlink_sens_atmos_t *)msgbuf;
packet->TempAmbient = TempAmbient;
packet->Humidity = Humidity;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, (const char *)packet, MAVLINK_MSG_ID_SENS_ATMOS_LEN, MAVLINK_MSG_ID_SENS_ATMOS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_ATMOS, (const char *)packet, MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE SENS_ATMOS UNPACKING
/**
* @brief Get field TempAmbient from sens_atmos message
*
* @return Ambient temperature [degrees Celsius]
*/
static inline float mavlink_msg_sens_atmos_get_TempAmbient(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field Humidity from sens_atmos message
*
* @return Relative humidity [%]
*/
static inline float mavlink_msg_sens_atmos_get_Humidity(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Decode a sens_atmos message into a struct
*
* @param msg The message to decode
* @param sens_atmos C-struct to decode the message contents into
*/
static inline void mavlink_msg_sens_atmos_decode(const mavlink_message_t* msg, mavlink_sens_atmos_t* sens_atmos)
{
#if MAVLINK_NEED_BYTE_SWAP
sens_atmos->TempAmbient = mavlink_msg_sens_atmos_get_TempAmbient(msg);
sens_atmos->Humidity = mavlink_msg_sens_atmos_get_Humidity(msg);
#else
memcpy(sens_atmos, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SENS_ATMOS_LEN);
#endif
}
+146
View File
@@ -291,6 +291,149 @@ static void mavlink_test_asluav_status(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ekf_ext(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_ekf_ext_t packet_in = {
93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
};
mavlink_ekf_ext_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.timestamp = packet_in.timestamp;
packet1.Windspeed = packet_in.Windspeed;
packet1.WindDir = packet_in.WindDir;
packet1.WindZ = packet_in.WindZ;
packet1.Airspeed = packet_in.Airspeed;
packet1.beta = packet_in.beta;
packet1.alpha = packet_in.alpha;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ekf_ext_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_ekf_ext_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ekf_ext_pack(system_id, component_id, &msg , packet1.timestamp , packet1.Windspeed , packet1.WindDir , packet1.WindZ , packet1.Airspeed , packet1.beta , packet1.alpha );
mavlink_msg_ekf_ext_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ekf_ext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.Windspeed , packet1.WindDir , packet1.WindZ , packet1.Airspeed , packet1.beta , packet1.alpha );
mavlink_msg_ekf_ext_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_ekf_ext_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ekf_ext_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.Windspeed , packet1.WindDir , packet1.WindZ , packet1.Airspeed , packet1.beta , packet1.alpha );
mavlink_msg_ekf_ext_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_asl_obctrl(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_asl_obctrl_t packet_in = {
93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,101
};
mavlink_asl_obctrl_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.timestamp = packet_in.timestamp;
packet1.uElev = packet_in.uElev;
packet1.uThrot = packet_in.uThrot;
packet1.uThrot2 = packet_in.uThrot2;
packet1.uAilL = packet_in.uAilL;
packet1.uAilR = packet_in.uAilR;
packet1.uRud = packet_in.uRud;
packet1.obctrl_status = packet_in.obctrl_status;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_asl_obctrl_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_asl_obctrl_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_asl_obctrl_pack(system_id, component_id, &msg , packet1.timestamp , packet1.uElev , packet1.uThrot , packet1.uThrot2 , packet1.uAilL , packet1.uAilR , packet1.uRud , packet1.obctrl_status );
mavlink_msg_asl_obctrl_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_asl_obctrl_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.uElev , packet1.uThrot , packet1.uThrot2 , packet1.uAilL , packet1.uAilR , packet1.uRud , packet1.obctrl_status );
mavlink_msg_asl_obctrl_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_asl_obctrl_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_asl_obctrl_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.uElev , packet1.uThrot , packet1.uThrot2 , packet1.uAilL , packet1.uAilR , packet1.uRud , packet1.obctrl_status );
mavlink_msg_asl_obctrl_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_sens_atmos(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_sens_atmos_t packet_in = {
17.0,45.0
};
mavlink_sens_atmos_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.TempAmbient = packet_in.TempAmbient;
packet1.Humidity = packet_in.Humidity;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_atmos_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_sens_atmos_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_atmos_pack(system_id, component_id, &msg , packet1.TempAmbient , packet1.Humidity );
mavlink_msg_sens_atmos_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_atmos_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.TempAmbient , packet1.Humidity );
mavlink_msg_sens_atmos_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_sens_atmos_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_atmos_send(MAVLINK_COMM_1 , packet1.TempAmbient , packet1.Humidity );
mavlink_msg_sens_atmos_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ASLUAV(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_sens_power(system_id, component_id, last_msg);
@@ -298,6 +441,9 @@ static void mavlink_test_ASLUAV(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_aslctrl_data(system_id, component_id, last_msg);
mavlink_test_aslctrl_debug(system_id, component_id, last_msg);
mavlink_test_asluav_status(system_id, component_id, last_msg);
mavlink_test_ekf_ext(system_id, component_id, last_msg);
mavlink_test_asl_obctrl(system_id, component_id, last_msg);
mavlink_test_sens_atmos(system_id, component_id, last_msg);
}
#ifdef __cplusplus
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Feb 2 23:23:19 2015"
#define MAVLINK_BUILD_DATE "Mon Feb 9 22:58:24 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255