mirror of https://github.com/ArduPilot/ardupilot
GCS_MAVLink: regenerate MAVLink headers
This commit is contained in:
parent
73670edda6
commit
53adcc9a25
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,377 @@
|
|||
// MESSAGE GIMBAL_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL 185
|
||||
|
||||
typedef struct __mavlink_gimbal_control_t
|
||||
{
|
||||
float demanded_rate_x; ///< Demanded angular rate X, radians/s
|
||||
float demanded_rate_y; ///< Demanded angular rate Y, radians/s
|
||||
float demanded_rate_z; ///< Demanded angular rate Z, radians/s
|
||||
float gyro_bias_x; ///< Gyro bias X, radians/s
|
||||
float gyro_bias_y; ///< Gyro bias Y, radians/s
|
||||
float gyro_bias_z; ///< Gyro bias Z, radians/s
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
} mavlink_gimbal_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN 26
|
||||
#define MAVLINK_MSG_ID_185_LEN 26
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC 239
|
||||
#define MAVLINK_MSG_ID_185_CRC 239
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_CONTROL { \
|
||||
"GIMBAL_CONTROL", \
|
||||
8, \
|
||||
{ { "demanded_rate_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_gimbal_control_t, demanded_rate_x) }, \
|
||||
{ "demanded_rate_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_control_t, demanded_rate_y) }, \
|
||||
{ "demanded_rate_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_control_t, demanded_rate_z) }, \
|
||||
{ "gyro_bias_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_control_t, gyro_bias_x) }, \
|
||||
{ "gyro_bias_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_control_t, gyro_bias_y) }, \
|
||||
{ "gyro_bias_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_control_t, gyro_bias_z) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_gimbal_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_gimbal_control_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_control 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 target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param demanded_rate_x Demanded angular rate X, radians/s
|
||||
* @param demanded_rate_y Demanded angular rate Y, radians/s
|
||||
* @param demanded_rate_z Demanded angular rate Z, radians/s
|
||||
* @param gyro_bias_x Gyro bias X, radians/s
|
||||
* @param gyro_bias_y Gyro bias Y, radians/s
|
||||
* @param gyro_bias_z Gyro bias Z, radians/s
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, float demanded_rate_x, float demanded_rate_y, float demanded_rate_z, float gyro_bias_x, float gyro_bias_y, float gyro_bias_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_float(buf, 12, gyro_bias_x);
|
||||
_mav_put_float(buf, 16, gyro_bias_y);
|
||||
_mav_put_float(buf, 20, gyro_bias_z);
|
||||
_mav_put_uint8_t(buf, 24, target_system);
|
||||
_mav_put_uint8_t(buf, 25, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_gimbal_control_t packet;
|
||||
packet.demanded_rate_x = demanded_rate_x;
|
||||
packet.demanded_rate_y = demanded_rate_y;
|
||||
packet.demanded_rate_z = demanded_rate_z;
|
||||
packet.gyro_bias_x = gyro_bias_x;
|
||||
packet.gyro_bias_y = gyro_bias_y;
|
||||
packet.gyro_bias_z = gyro_bias_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_control 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 target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param demanded_rate_x Demanded angular rate X, radians/s
|
||||
* @param demanded_rate_y Demanded angular rate Y, radians/s
|
||||
* @param demanded_rate_z Demanded angular rate Z, radians/s
|
||||
* @param gyro_bias_x Gyro bias X, radians/s
|
||||
* @param gyro_bias_y Gyro bias Y, radians/s
|
||||
* @param gyro_bias_z Gyro bias Z, radians/s
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,float demanded_rate_x,float demanded_rate_y,float demanded_rate_z,float gyro_bias_x,float gyro_bias_y,float gyro_bias_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_float(buf, 12, gyro_bias_x);
|
||||
_mav_put_float(buf, 16, gyro_bias_y);
|
||||
_mav_put_float(buf, 20, gyro_bias_z);
|
||||
_mav_put_uint8_t(buf, 24, target_system);
|
||||
_mav_put_uint8_t(buf, 25, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_gimbal_control_t packet;
|
||||
packet.demanded_rate_x = demanded_rate_x;
|
||||
packet.demanded_rate_y = demanded_rate_y;
|
||||
packet.demanded_rate_z = demanded_rate_z;
|
||||
packet.gyro_bias_x = gyro_bias_x;
|
||||
packet.gyro_bias_y = gyro_bias_y;
|
||||
packet.gyro_bias_z = gyro_bias_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_control 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 gimbal_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
return mavlink_msg_gimbal_control_pack(system_id, component_id, msg, gimbal_control->target_system, gimbal_control->target_component, gimbal_control->demanded_rate_x, gimbal_control->demanded_rate_y, gimbal_control->demanded_rate_z, gimbal_control->gyro_bias_x, gimbal_control->gyro_bias_y, gimbal_control->gyro_bias_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_control 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 gimbal_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
return mavlink_msg_gimbal_control_pack_chan(system_id, component_id, chan, msg, gimbal_control->target_system, gimbal_control->target_component, gimbal_control->demanded_rate_x, gimbal_control->demanded_rate_y, gimbal_control->demanded_rate_z, gimbal_control->gyro_bias_x, gimbal_control->gyro_bias_y, gimbal_control->gyro_bias_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param demanded_rate_x Demanded angular rate X, radians/s
|
||||
* @param demanded_rate_y Demanded angular rate Y, radians/s
|
||||
* @param demanded_rate_z Demanded angular rate Z, radians/s
|
||||
* @param gyro_bias_x Gyro bias X, radians/s
|
||||
* @param gyro_bias_y Gyro bias Y, radians/s
|
||||
* @param gyro_bias_z Gyro bias Z, radians/s
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gimbal_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float demanded_rate_x, float demanded_rate_y, float demanded_rate_z, float gyro_bias_x, float gyro_bias_y, float gyro_bias_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_float(buf, 12, gyro_bias_x);
|
||||
_mav_put_float(buf, 16, gyro_bias_y);
|
||||
_mav_put_float(buf, 20, gyro_bias_z);
|
||||
_mav_put_uint8_t(buf, 24, target_system);
|
||||
_mav_put_uint8_t(buf, 25, target_component);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_gimbal_control_t packet;
|
||||
packet.demanded_rate_x = demanded_rate_x;
|
||||
packet.demanded_rate_y = demanded_rate_y;
|
||||
packet.demanded_rate_z = demanded_rate_z;
|
||||
packet.gyro_bias_x = gyro_bias_x;
|
||||
packet.gyro_bias_y = gyro_bias_y;
|
||||
packet.gyro_bias_z = gyro_bias_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GIMBAL_CONTROL_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_gimbal_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float demanded_rate_x, float demanded_rate_y, float demanded_rate_z, float gyro_bias_x, float gyro_bias_y, float gyro_bias_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_float(buf, 12, gyro_bias_x);
|
||||
_mav_put_float(buf, 16, gyro_bias_y);
|
||||
_mav_put_float(buf, 20, gyro_bias_z);
|
||||
_mav_put_uint8_t(buf, 24, target_system);
|
||||
_mav_put_uint8_t(buf, 25, target_component);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_gimbal_control_t *packet = (mavlink_gimbal_control_t *)msgbuf;
|
||||
packet->demanded_rate_x = demanded_rate_x;
|
||||
packet->demanded_rate_y = demanded_rate_y;
|
||||
packet->demanded_rate_z = demanded_rate_z;
|
||||
packet->gyro_bias_x = gyro_bias_x;
|
||||
packet->gyro_bias_y = gyro_bias_y;
|
||||
packet->gyro_bias_z = gyro_bias_z;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GIMBAL_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gimbal_control message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gimbal_control message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_control_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 25);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field demanded_rate_x from gimbal_control message
|
||||
*
|
||||
* @return Demanded angular rate X, radians/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_demanded_rate_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field demanded_rate_y from gimbal_control message
|
||||
*
|
||||
* @return Demanded angular rate Y, radians/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_demanded_rate_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field demanded_rate_z from gimbal_control message
|
||||
*
|
||||
* @return Demanded angular rate Z, radians/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_demanded_rate_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyro_bias_x from gimbal_control message
|
||||
*
|
||||
* @return Gyro bias X, radians/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_gyro_bias_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyro_bias_y from gimbal_control message
|
||||
*
|
||||
* @return Gyro bias Y, radians/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_gyro_bias_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyro_bias_z from gimbal_control message
|
||||
*
|
||||
* @return Gyro bias Z, radians/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_gyro_bias_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gimbal_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gimbal_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_control_decode(const mavlink_message_t* msg, mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
gimbal_control->demanded_rate_x = mavlink_msg_gimbal_control_get_demanded_rate_x(msg);
|
||||
gimbal_control->demanded_rate_y = mavlink_msg_gimbal_control_get_demanded_rate_y(msg);
|
||||
gimbal_control->demanded_rate_z = mavlink_msg_gimbal_control_get_demanded_rate_z(msg);
|
||||
gimbal_control->gyro_bias_x = mavlink_msg_gimbal_control_get_gyro_bias_x(msg);
|
||||
gimbal_control->gyro_bias_y = mavlink_msg_gimbal_control_get_gyro_bias_y(msg);
|
||||
gimbal_control->gyro_bias_z = mavlink_msg_gimbal_control_get_gyro_bias_z(msg);
|
||||
gimbal_control->target_system = mavlink_msg_gimbal_control_get_target_system(msg);
|
||||
gimbal_control->target_component = mavlink_msg_gimbal_control_get_target_component(msg);
|
||||
#else
|
||||
memcpy(gimbal_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,425 @@
|
|||
// MESSAGE GIMBAL_REPORT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT 184
|
||||
|
||||
typedef struct __mavlink_gimbal_report_t
|
||||
{
|
||||
uint32_t counter; ///< Report counter
|
||||
float delta_angle_x; ///< Delta angle X, radians
|
||||
float delta_angle_y; ///< Delta angle Y, radians
|
||||
float delta_angle_z; ///< Delta angle Z, radians
|
||||
float delta_velocity_x; ///< Delta velocity X, m/s
|
||||
float delta_velocity_y; ///< Delta velocity Y, m/s
|
||||
float delta_velocity_z; ///< Delta velocity Z, m/s
|
||||
float joint_yaw; ///< Joint yaw, radians
|
||||
float joint_roll; ///< Joint roll, radians
|
||||
float joint_pitch; ///< Joint pitch, radians
|
||||
} mavlink_gimbal_report_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT_LEN 40
|
||||
#define MAVLINK_MSG_ID_184_LEN 40
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT_CRC 89
|
||||
#define MAVLINK_MSG_ID_184_CRC 89
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_REPORT { \
|
||||
"GIMBAL_REPORT", \
|
||||
10, \
|
||||
{ { "counter", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gimbal_report_t, counter) }, \
|
||||
{ "delta_angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_report_t, delta_angle_x) }, \
|
||||
{ "delta_angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_report_t, delta_angle_y) }, \
|
||||
{ "delta_angle_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_report_t, delta_angle_z) }, \
|
||||
{ "delta_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_report_t, delta_velocity_x) }, \
|
||||
{ "delta_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_report_t, delta_velocity_y) }, \
|
||||
{ "delta_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_report_t, delta_velocity_z) }, \
|
||||
{ "joint_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_report_t, joint_yaw) }, \
|
||||
{ "joint_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_report_t, joint_roll) }, \
|
||||
{ "joint_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_report_t, joint_pitch) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_report 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 counter Report counter
|
||||
* @param delta_angle_x Delta angle X, radians
|
||||
* @param delta_angle_y Delta angle Y, radians
|
||||
* @param delta_angle_z Delta angle Z, radians
|
||||
* @param delta_velocity_x Delta velocity X, m/s
|
||||
* @param delta_velocity_y Delta velocity Y, m/s
|
||||
* @param delta_velocity_z Delta velocity Z, m/s
|
||||
* @param joint_yaw Joint yaw, radians
|
||||
* @param joint_roll Joint roll, radians
|
||||
* @param joint_pitch Joint pitch, radians
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t counter, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_yaw, float joint_roll, float joint_pitch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_REPORT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, counter);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_yaw);
|
||||
_mav_put_float(buf, 32, joint_roll);
|
||||
_mav_put_float(buf, 36, joint_pitch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#else
|
||||
mavlink_gimbal_report_t packet;
|
||||
packet.counter = counter;
|
||||
packet.delta_angle_x = delta_angle_x;
|
||||
packet.delta_angle_y = delta_angle_y;
|
||||
packet.delta_angle_z = delta_angle_z;
|
||||
packet.delta_velocity_x = delta_velocity_x;
|
||||
packet.delta_velocity_y = delta_velocity_y;
|
||||
packet.delta_velocity_z = delta_velocity_z;
|
||||
packet.joint_yaw = joint_yaw;
|
||||
packet.joint_roll = joint_roll;
|
||||
packet.joint_pitch = joint_pitch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_REPORT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_report 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 counter Report counter
|
||||
* @param delta_angle_x Delta angle X, radians
|
||||
* @param delta_angle_y Delta angle Y, radians
|
||||
* @param delta_angle_z Delta angle Z, radians
|
||||
* @param delta_velocity_x Delta velocity X, m/s
|
||||
* @param delta_velocity_y Delta velocity Y, m/s
|
||||
* @param delta_velocity_z Delta velocity Z, m/s
|
||||
* @param joint_yaw Joint yaw, radians
|
||||
* @param joint_roll Joint roll, radians
|
||||
* @param joint_pitch Joint pitch, radians
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t counter,float delta_angle_x,float delta_angle_y,float delta_angle_z,float delta_velocity_x,float delta_velocity_y,float delta_velocity_z,float joint_yaw,float joint_roll,float joint_pitch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_REPORT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, counter);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_yaw);
|
||||
_mav_put_float(buf, 32, joint_roll);
|
||||
_mav_put_float(buf, 36, joint_pitch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#else
|
||||
mavlink_gimbal_report_t packet;
|
||||
packet.counter = counter;
|
||||
packet.delta_angle_x = delta_angle_x;
|
||||
packet.delta_angle_y = delta_angle_y;
|
||||
packet.delta_angle_z = delta_angle_z;
|
||||
packet.delta_velocity_x = delta_velocity_x;
|
||||
packet.delta_velocity_y = delta_velocity_y;
|
||||
packet.delta_velocity_z = delta_velocity_z;
|
||||
packet.joint_yaw = joint_yaw;
|
||||
packet.joint_roll = joint_roll;
|
||||
packet.joint_pitch = joint_pitch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_REPORT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_report 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 gimbal_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
return mavlink_msg_gimbal_report_pack(system_id, component_id, msg, gimbal_report->counter, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_yaw, gimbal_report->joint_roll, gimbal_report->joint_pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_report 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 gimbal_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
return mavlink_msg_gimbal_report_pack_chan(system_id, component_id, chan, msg, gimbal_report->counter, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_yaw, gimbal_report->joint_roll, gimbal_report->joint_pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param counter Report counter
|
||||
* @param delta_angle_x Delta angle X, radians
|
||||
* @param delta_angle_y Delta angle Y, radians
|
||||
* @param delta_angle_z Delta angle Z, radians
|
||||
* @param delta_velocity_x Delta velocity X, m/s
|
||||
* @param delta_velocity_y Delta velocity Y, m/s
|
||||
* @param delta_velocity_z Delta velocity Z, m/s
|
||||
* @param joint_yaw Joint yaw, radians
|
||||
* @param joint_roll Joint roll, radians
|
||||
* @param joint_pitch Joint pitch, radians
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gimbal_report_send(mavlink_channel_t chan, uint32_t counter, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_yaw, float joint_roll, float joint_pitch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_REPORT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, counter);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_yaw);
|
||||
_mav_put_float(buf, 32, joint_roll);
|
||||
_mav_put_float(buf, 36, joint_pitch);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_gimbal_report_t packet;
|
||||
packet.counter = counter;
|
||||
packet.delta_angle_x = delta_angle_x;
|
||||
packet.delta_angle_y = delta_angle_y;
|
||||
packet.delta_angle_z = delta_angle_z;
|
||||
packet.delta_velocity_x = delta_velocity_x;
|
||||
packet.delta_velocity_y = delta_velocity_y;
|
||||
packet.delta_velocity_z = delta_velocity_z;
|
||||
packet.joint_yaw = joint_yaw;
|
||||
packet.joint_roll = joint_roll;
|
||||
packet.joint_pitch = joint_pitch;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GIMBAL_REPORT_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_gimbal_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t counter, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_yaw, float joint_roll, float joint_pitch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, counter);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_yaw);
|
||||
_mav_put_float(buf, 32, joint_roll);
|
||||
_mav_put_float(buf, 36, joint_pitch);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_gimbal_report_t *packet = (mavlink_gimbal_report_t *)msgbuf;
|
||||
packet->counter = counter;
|
||||
packet->delta_angle_x = delta_angle_x;
|
||||
packet->delta_angle_y = delta_angle_y;
|
||||
packet->delta_angle_z = delta_angle_z;
|
||||
packet->delta_velocity_x = delta_velocity_x;
|
||||
packet->delta_velocity_y = delta_velocity_y;
|
||||
packet->delta_velocity_z = delta_velocity_z;
|
||||
packet->joint_yaw = joint_yaw;
|
||||
packet->joint_roll = joint_roll;
|
||||
packet->joint_pitch = joint_pitch;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GIMBAL_REPORT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field counter from gimbal_report message
|
||||
*
|
||||
* @return Report counter
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gimbal_report_get_counter(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_angle_x from gimbal_report message
|
||||
*
|
||||
* @return Delta angle X, radians
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_angle_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_angle_y from gimbal_report message
|
||||
*
|
||||
* @return Delta angle Y, radians
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_angle_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_angle_z from gimbal_report message
|
||||
*
|
||||
* @return Delta angle Z, radians
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_angle_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_velocity_x from gimbal_report message
|
||||
*
|
||||
* @return Delta velocity X, m/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_velocity_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_velocity_y from gimbal_report message
|
||||
*
|
||||
* @return Delta velocity Y, m/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_velocity_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_velocity_z from gimbal_report message
|
||||
*
|
||||
* @return Delta velocity Z, m/s
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_velocity_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field joint_yaw from gimbal_report message
|
||||
*
|
||||
* @return Joint yaw, radians
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_joint_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field joint_roll from gimbal_report message
|
||||
*
|
||||
* @return Joint roll, radians
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_joint_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field joint_pitch from gimbal_report message
|
||||
*
|
||||
* @return Joint pitch, radians
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_joint_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gimbal_report message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gimbal_report C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_report_decode(const mavlink_message_t* msg, mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
gimbal_report->counter = mavlink_msg_gimbal_report_get_counter(msg);
|
||||
gimbal_report->delta_angle_x = mavlink_msg_gimbal_report_get_delta_angle_x(msg);
|
||||
gimbal_report->delta_angle_y = mavlink_msg_gimbal_report_get_delta_angle_y(msg);
|
||||
gimbal_report->delta_angle_z = mavlink_msg_gimbal_report_get_delta_angle_z(msg);
|
||||
gimbal_report->delta_velocity_x = mavlink_msg_gimbal_report_get_delta_velocity_x(msg);
|
||||
gimbal_report->delta_velocity_y = mavlink_msg_gimbal_report_get_delta_velocity_y(msg);
|
||||
gimbal_report->delta_velocity_z = mavlink_msg_gimbal_report_get_delta_velocity_z(msg);
|
||||
gimbal_report->joint_yaw = mavlink_msg_gimbal_report_get_joint_yaw(msg);
|
||||
gimbal_report->joint_roll = mavlink_msg_gimbal_report_get_joint_roll(msg);
|
||||
gimbal_report->joint_pitch = mavlink_msg_gimbal_report_get_joint_pitch(msg);
|
||||
#else
|
||||
memcpy(gimbal_report, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
}
|
|
@ -1568,6 +1568,108 @@ static void mavlink_test_ahrs3(uint8_t system_id, uint8_t component_id, mavlink_
|
|||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_gimbal_report(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_gimbal_report_t packet_in = {
|
||||
963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0
|
||||
};
|
||||
mavlink_gimbal_report_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.counter = packet_in.counter;
|
||||
packet1.delta_angle_x = packet_in.delta_angle_x;
|
||||
packet1.delta_angle_y = packet_in.delta_angle_y;
|
||||
packet1.delta_angle_z = packet_in.delta_angle_z;
|
||||
packet1.delta_velocity_x = packet_in.delta_velocity_x;
|
||||
packet1.delta_velocity_y = packet_in.delta_velocity_y;
|
||||
packet1.delta_velocity_z = packet_in.delta_velocity_z;
|
||||
packet1.joint_yaw = packet_in.joint_yaw;
|
||||
packet1.joint_roll = packet_in.joint_roll;
|
||||
packet1.joint_pitch = packet_in.joint_pitch;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_report_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_gimbal_report_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_report_pack(system_id, component_id, &msg , packet1.counter , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_yaw , packet1.joint_roll , packet1.joint_pitch );
|
||||
mavlink_msg_gimbal_report_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.counter , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_yaw , packet1.joint_roll , packet1.joint_pitch );
|
||||
mavlink_msg_gimbal_report_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_gimbal_report_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_report_send(MAVLINK_COMM_1 , packet1.counter , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_yaw , packet1.joint_roll , packet1.joint_pitch );
|
||||
mavlink_msg_gimbal_report_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_gimbal_control(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_gimbal_control_t packet_in = {
|
||||
17.0,45.0,73.0,101.0,129.0,157.0,77,144
|
||||
};
|
||||
mavlink_gimbal_control_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.demanded_rate_x = packet_in.demanded_rate_x;
|
||||
packet1.demanded_rate_y = packet_in.demanded_rate_y;
|
||||
packet1.demanded_rate_z = packet_in.demanded_rate_z;
|
||||
packet1.gyro_bias_x = packet_in.gyro_bias_x;
|
||||
packet1.gyro_bias_y = packet_in.gyro_bias_y;
|
||||
packet1.gyro_bias_z = packet_in.gyro_bias_z;
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_control_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_gimbal_control_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z , packet1.gyro_bias_x , packet1.gyro_bias_y , packet1.gyro_bias_z );
|
||||
mavlink_msg_gimbal_control_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z , packet1.gyro_bias_x , packet1.gyro_bias_y , packet1.gyro_bias_z );
|
||||
mavlink_msg_gimbal_control_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_gimbal_control_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_gimbal_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z , packet1.gyro_bias_x , packet1.gyro_bias_y , packet1.gyro_bias_z );
|
||||
mavlink_msg_gimbal_control_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_test_sensor_offsets(system_id, component_id, last_msg);
|
||||
|
@ -1602,6 +1704,8 @@ static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id,
|
|||
mavlink_test_camera_feedback(system_id, component_id, last_msg);
|
||||
mavlink_test_battery2(system_id, component_id, last_msg);
|
||||
mavlink_test_ahrs3(system_id, component_id, last_msg);
|
||||
mavlink_test_gimbal_report(system_id, component_id, last_msg);
|
||||
mavlink_test_gimbal_control(system_id, component_id, last_msg);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Thu Jan 22 15:19:58 2015"
|
||||
#define MAVLINK_BUILD_DATE "Wed Jan 28 14:29:27 2015"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ typedef enum MAV_TYPE
|
|||
MAV_TYPE_ONBOARD_CONTROLLER=18, /* Onboard companion controller | */
|
||||
MAV_TYPE_VTOL_DUOROTOR=19, /* Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. | */
|
||||
MAV_TYPE_VTOL_QUADROTOR=20, /* Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. | */
|
||||
MAV_TYPE_ENUM_END=21, /* | */
|
||||
MAV_TYPE_GIMBAL=26, /* Onboard gimbal | */
|
||||
MAV_TYPE_ENUM_END=27, /* | */
|
||||
} MAV_TYPE;
|
||||
#endif
|
||||
|
||||
|
@ -197,6 +198,7 @@ typedef enum MAV_COMPONENT
|
|||
MAV_COMP_ID_SERVO12=151, /* | */
|
||||
MAV_COMP_ID_SERVO13=152, /* | */
|
||||
MAV_COMP_ID_SERVO14=153, /* | */
|
||||
MAV_COMP_ID_GIMBAL=154, /* | */
|
||||
MAV_COMP_ID_MAPPER=180, /* | */
|
||||
MAV_COMP_ID_MISSIONPLANNER=190, /* | */
|
||||
MAV_COMP_ID_PATHPLANNER=195, /* | */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Thu Jan 22 15:20:01 2015"
|
||||
#define MAVLINK_BUILD_DATE "Wed Jan 28 14:29:32 2015"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
|
Loading…
Reference in New Issue