update mavlink headers, headers generated with message definitions from the externalsetpoints branch of mavlink

This commit is contained in:
Thomas Gubler 2014-06-23 10:18:16 +02:00
parent a43918de8d
commit 9f3758582f
24 changed files with 2923 additions and 176 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,401 @@
// MESSAGE CAMERA_EVENT PACKING
#define MAVLINK_MSG_ID_CAMERA_EVENT 179
typedef struct __mavlink_camera_event_t
{
uint64_t time_usec; ///< Image timestamp (microseconds since UNIX epoch, according to camera clock)
float p1; ///< Parameter 1 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
float p2; ///< Parameter 2 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
float p3; ///< Parameter 3 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
float p4; ///< Parameter 4 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
uint16_t img_idx; ///< Image index
uint8_t target_system; ///< System ID
uint8_t cam_idx; ///< Camera ID
uint8_t event_id; ///< See CAMERA_EVENT_TYPES enum for definition of the bitmask
} mavlink_camera_event_t;
#define MAVLINK_MSG_ID_CAMERA_EVENT_LEN 29
#define MAVLINK_MSG_ID_179_LEN 29
#define MAVLINK_MSG_ID_CAMERA_EVENT_CRC 206
#define MAVLINK_MSG_ID_179_CRC 206
#define MAVLINK_MESSAGE_INFO_CAMERA_EVENT { \
"CAMERA_EVENT", \
9, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_event_t, time_usec) }, \
{ "p1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_event_t, p1) }, \
{ "p2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_event_t, p2) }, \
{ "p3", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_event_t, p3) }, \
{ "p4", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_event_t, p4) }, \
{ "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_event_t, img_idx) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_camera_event_t, target_system) }, \
{ "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_camera_event_t, cam_idx) }, \
{ "event_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_event_t, event_id) }, \
} \
}
/**
* @brief Pack a camera_event 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 time_usec Image timestamp (microseconds since UNIX epoch, according to camera clock)
* @param target_system System ID
* @param cam_idx Camera ID
* @param img_idx Image index
* @param event_id See CAMERA_EVENT_TYPES enum for definition of the bitmask
* @param p1 Parameter 1 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p2 Parameter 2 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p3 Parameter 3 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p4 Parameter 4 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_camera_event_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAMERA_EVENT_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, p1);
_mav_put_float(buf, 12, p2);
_mav_put_float(buf, 16, p3);
_mav_put_float(buf, 20, p4);
_mav_put_uint16_t(buf, 24, img_idx);
_mav_put_uint8_t(buf, 26, target_system);
_mav_put_uint8_t(buf, 27, cam_idx);
_mav_put_uint8_t(buf, 28, event_id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#else
mavlink_camera_event_t packet;
packet.time_usec = time_usec;
packet.p1 = p1;
packet.p2 = p2;
packet.p3 = p3;
packet.p4 = p4;
packet.img_idx = img_idx;
packet.target_system = target_system;
packet.cam_idx = cam_idx;
packet.event_id = event_id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_CAMERA_EVENT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_EVENT_LEN, MAVLINK_MSG_ID_CAMERA_EVENT_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
}
/**
* @brief Pack a camera_event 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 time_usec Image timestamp (microseconds since UNIX epoch, according to camera clock)
* @param target_system System ID
* @param cam_idx Camera ID
* @param img_idx Image index
* @param event_id See CAMERA_EVENT_TYPES enum for definition of the bitmask
* @param p1 Parameter 1 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p2 Parameter 2 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p3 Parameter 3 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p4 Parameter 4 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_camera_event_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,uint8_t target_system,uint8_t cam_idx,uint16_t img_idx,uint8_t event_id,float p1,float p2,float p3,float p4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAMERA_EVENT_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, p1);
_mav_put_float(buf, 12, p2);
_mav_put_float(buf, 16, p3);
_mav_put_float(buf, 20, p4);
_mav_put_uint16_t(buf, 24, img_idx);
_mav_put_uint8_t(buf, 26, target_system);
_mav_put_uint8_t(buf, 27, cam_idx);
_mav_put_uint8_t(buf, 28, event_id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#else
mavlink_camera_event_t packet;
packet.time_usec = time_usec;
packet.p1 = p1;
packet.p2 = p2;
packet.p3 = p3;
packet.p4 = p4;
packet.img_idx = img_idx;
packet.target_system = target_system;
packet.cam_idx = cam_idx;
packet.event_id = event_id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_CAMERA_EVENT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_EVENT_LEN, MAVLINK_MSG_ID_CAMERA_EVENT_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
}
/**
* @brief Encode a camera_event 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 camera_event C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_camera_event_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_event_t* camera_event)
{
return mavlink_msg_camera_event_pack(system_id, component_id, msg, camera_event->time_usec, camera_event->target_system, camera_event->cam_idx, camera_event->img_idx, camera_event->event_id, camera_event->p1, camera_event->p2, camera_event->p3, camera_event->p4);
}
/**
* @brief Encode a camera_event 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 camera_event C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_camera_event_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_event_t* camera_event)
{
return mavlink_msg_camera_event_pack_chan(system_id, component_id, chan, msg, camera_event->time_usec, camera_event->target_system, camera_event->cam_idx, camera_event->img_idx, camera_event->event_id, camera_event->p1, camera_event->p2, camera_event->p3, camera_event->p4);
}
/**
* @brief Send a camera_event message
* @param chan MAVLink channel to send the message
*
* @param time_usec Image timestamp (microseconds since UNIX epoch, according to camera clock)
* @param target_system System ID
* @param cam_idx Camera ID
* @param img_idx Image index
* @param event_id See CAMERA_EVENT_TYPES enum for definition of the bitmask
* @param p1 Parameter 1 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p2 Parameter 2 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p3 Parameter 3 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
* @param p4 Parameter 4 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_camera_event_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAMERA_EVENT_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, p1);
_mav_put_float(buf, 12, p2);
_mav_put_float(buf, 16, p3);
_mav_put_float(buf, 20, p4);
_mav_put_uint16_t(buf, 24, img_idx);
_mav_put_uint8_t(buf, 26, target_system);
_mav_put_uint8_t(buf, 27, cam_idx);
_mav_put_uint8_t(buf, 28, event_id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, buf, MAVLINK_MSG_ID_CAMERA_EVENT_LEN, MAVLINK_MSG_ID_CAMERA_EVENT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, buf, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
#else
mavlink_camera_event_t packet;
packet.time_usec = time_usec;
packet.p1 = p1;
packet.p2 = p2;
packet.p3 = p3;
packet.p4 = p4;
packet.img_idx = img_idx;
packet.target_system = target_system;
packet.cam_idx = cam_idx;
packet.event_id = event_id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_EVENT_LEN, MAVLINK_MSG_ID_CAMERA_EVENT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_CAMERA_EVENT_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_camera_event_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, p1);
_mav_put_float(buf, 12, p2);
_mav_put_float(buf, 16, p3);
_mav_put_float(buf, 20, p4);
_mav_put_uint16_t(buf, 24, img_idx);
_mav_put_uint8_t(buf, 26, target_system);
_mav_put_uint8_t(buf, 27, cam_idx);
_mav_put_uint8_t(buf, 28, event_id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, buf, MAVLINK_MSG_ID_CAMERA_EVENT_LEN, MAVLINK_MSG_ID_CAMERA_EVENT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, buf, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
#else
mavlink_camera_event_t *packet = (mavlink_camera_event_t *)msgbuf;
packet->time_usec = time_usec;
packet->p1 = p1;
packet->p2 = p2;
packet->p3 = p3;
packet->p4 = p4;
packet->img_idx = img_idx;
packet->target_system = target_system;
packet->cam_idx = cam_idx;
packet->event_id = event_id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, (const char *)packet, MAVLINK_MSG_ID_CAMERA_EVENT_LEN, MAVLINK_MSG_ID_CAMERA_EVENT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_EVENT, (const char *)packet, MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE CAMERA_EVENT UNPACKING
/**
* @brief Get field time_usec from camera_event message
*
* @return Image timestamp (microseconds since UNIX epoch, according to camera clock)
*/
static inline uint64_t mavlink_msg_camera_event_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field target_system from camera_event message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_camera_event_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 26);
}
/**
* @brief Get field cam_idx from camera_event message
*
* @return Camera ID
*/
static inline uint8_t mavlink_msg_camera_event_get_cam_idx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 27);
}
/**
* @brief Get field img_idx from camera_event message
*
* @return Image index
*/
static inline uint16_t mavlink_msg_camera_event_get_img_idx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field event_id from camera_event message
*
* @return See CAMERA_EVENT_TYPES enum for definition of the bitmask
*/
static inline uint8_t mavlink_msg_camera_event_get_event_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 28);
}
/**
* @brief Get field p1 from camera_event message
*
* @return Parameter 1 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
*/
static inline float mavlink_msg_camera_event_get_p1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field p2 from camera_event message
*
* @return Parameter 2 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
*/
static inline float mavlink_msg_camera_event_get_p2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field p3 from camera_event message
*
* @return Parameter 3 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
*/
static inline float mavlink_msg_camera_event_get_p3(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field p4 from camera_event message
*
* @return Parameter 4 (meaning depends on event, see CAMERA_EVENT_TYPES enum)
*/
static inline float mavlink_msg_camera_event_get_p4(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a camera_event message into a struct
*
* @param msg The message to decode
* @param camera_event C-struct to decode the message contents into
*/
static inline void mavlink_msg_camera_event_decode(const mavlink_message_t* msg, mavlink_camera_event_t* camera_event)
{
#if MAVLINK_NEED_BYTE_SWAP
camera_event->time_usec = mavlink_msg_camera_event_get_time_usec(msg);
camera_event->p1 = mavlink_msg_camera_event_get_p1(msg);
camera_event->p2 = mavlink_msg_camera_event_get_p2(msg);
camera_event->p3 = mavlink_msg_camera_event_get_p3(msg);
camera_event->p4 = mavlink_msg_camera_event_get_p4(msg);
camera_event->img_idx = mavlink_msg_camera_event_get_img_idx(msg);
camera_event->target_system = mavlink_msg_camera_event_get_target_system(msg);
camera_event->cam_idx = mavlink_msg_camera_event_get_cam_idx(msg);
camera_event->event_id = mavlink_msg_camera_event_get_event_id(msg);
#else
memcpy(camera_event, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CAMERA_EVENT_LEN);
#endif
}

View File

@ -0,0 +1,473 @@
// MESSAGE CAMERA_FEEDBACK PACKING
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK 180
typedef struct __mavlink_camera_feedback_t
{
uint64_t time_usec; ///< Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_EVENT message
int32_t lat; ///< Latitude in (deg * 1E7)
int32_t lng; ///< Longitude in (deg * 1E7)
float alt; ///< Altitude (meters, AMSL)
float roll; ///< Vehicle Roll angle (degrees, +-180)
float pitch; ///< Vehicle Pitch angle (degrees, +-180)
float yaw; ///< Vehicle Heading (degrees, 0-360, true)
float foc_len; ///< Focal Length (mm)
uint16_t img_idx; ///< Image index
uint8_t target_system; ///< System ID
uint8_t cam_idx; ///< Camera ID
uint8_t flags; ///< See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
} mavlink_camera_feedback_t;
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN 41
#define MAVLINK_MSG_ID_180_LEN 41
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC 151
#define MAVLINK_MSG_ID_180_CRC 151
#define MAVLINK_MESSAGE_INFO_CAMERA_FEEDBACK { \
"CAMERA_FEEDBACK", \
12, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_feedback_t, time_usec) }, \
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_feedback_t, lat) }, \
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_feedback_t, lng) }, \
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_feedback_t, alt) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_feedback_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_camera_feedback_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_camera_feedback_t, yaw) }, \
{ "foc_len", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_camera_feedback_t, foc_len) }, \
{ "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_camera_feedback_t, img_idx) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_camera_feedback_t, target_system) }, \
{ "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_camera_feedback_t, cam_idx) }, \
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_camera_feedback_t, flags) }, \
} \
}
/**
* @brief Pack a camera_feedback 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 time_usec Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_EVENT message
* @param target_system System ID
* @param cam_idx Camera ID
* @param img_idx Image index
* @param lat Latitude in (deg * 1E7)
* @param lng Longitude in (deg * 1E7)
* @param alt Altitude (meters, AMSL)
* @param roll Vehicle Roll angle (degrees, +-180)
* @param pitch Vehicle Pitch angle (degrees, +-180)
* @param yaw Vehicle Heading (degrees, 0-360, true)
* @param foc_len Focal Length (mm)
* @param flags See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_camera_feedback_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, int32_t lat, int32_t lng, float alt, float roll, float pitch, float yaw, float foc_len, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_int32_t(buf, 8, lat);
_mav_put_int32_t(buf, 12, lng);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_put_float(buf, 32, foc_len);
_mav_put_uint16_t(buf, 36, img_idx);
_mav_put_uint8_t(buf, 38, target_system);
_mav_put_uint8_t(buf, 39, cam_idx);
_mav_put_uint8_t(buf, 40, flags);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#else
mavlink_camera_feedback_t packet;
packet.time_usec = time_usec;
packet.lat = lat;
packet.lng = lng;
packet.alt = alt;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.foc_len = foc_len;
packet.img_idx = img_idx;
packet.target_system = target_system;
packet.cam_idx = cam_idx;
packet.flags = flags;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
}
/**
* @brief Pack a camera_feedback 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 time_usec Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_EVENT message
* @param target_system System ID
* @param cam_idx Camera ID
* @param img_idx Image index
* @param lat Latitude in (deg * 1E7)
* @param lng Longitude in (deg * 1E7)
* @param alt Altitude (meters, AMSL)
* @param roll Vehicle Roll angle (degrees, +-180)
* @param pitch Vehicle Pitch angle (degrees, +-180)
* @param yaw Vehicle Heading (degrees, 0-360, true)
* @param foc_len Focal Length (mm)
* @param flags See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_camera_feedback_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,uint8_t target_system,uint8_t cam_idx,uint16_t img_idx,int32_t lat,int32_t lng,float alt,float roll,float pitch,float yaw,float foc_len,uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_int32_t(buf, 8, lat);
_mav_put_int32_t(buf, 12, lng);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_put_float(buf, 32, foc_len);
_mav_put_uint16_t(buf, 36, img_idx);
_mav_put_uint8_t(buf, 38, target_system);
_mav_put_uint8_t(buf, 39, cam_idx);
_mav_put_uint8_t(buf, 40, flags);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#else
mavlink_camera_feedback_t packet;
packet.time_usec = time_usec;
packet.lat = lat;
packet.lng = lng;
packet.alt = alt;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.foc_len = foc_len;
packet.img_idx = img_idx;
packet.target_system = target_system;
packet.cam_idx = cam_idx;
packet.flags = flags;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
}
/**
* @brief Encode a camera_feedback 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 camera_feedback C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_camera_feedback_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_feedback_t* camera_feedback)
{
return mavlink_msg_camera_feedback_pack(system_id, component_id, msg, camera_feedback->time_usec, camera_feedback->target_system, camera_feedback->cam_idx, camera_feedback->img_idx, camera_feedback->lat, camera_feedback->lng, camera_feedback->alt, camera_feedback->roll, camera_feedback->pitch, camera_feedback->yaw, camera_feedback->foc_len, camera_feedback->flags);
}
/**
* @brief Encode a camera_feedback 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 camera_feedback C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_camera_feedback_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_feedback_t* camera_feedback)
{
return mavlink_msg_camera_feedback_pack_chan(system_id, component_id, chan, msg, camera_feedback->time_usec, camera_feedback->target_system, camera_feedback->cam_idx, camera_feedback->img_idx, camera_feedback->lat, camera_feedback->lng, camera_feedback->alt, camera_feedback->roll, camera_feedback->pitch, camera_feedback->yaw, camera_feedback->foc_len, camera_feedback->flags);
}
/**
* @brief Send a camera_feedback message
* @param chan MAVLink channel to send the message
*
* @param time_usec Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_EVENT message
* @param target_system System ID
* @param cam_idx Camera ID
* @param img_idx Image index
* @param lat Latitude in (deg * 1E7)
* @param lng Longitude in (deg * 1E7)
* @param alt Altitude (meters, AMSL)
* @param roll Vehicle Roll angle (degrees, +-180)
* @param pitch Vehicle Pitch angle (degrees, +-180)
* @param yaw Vehicle Heading (degrees, 0-360, true)
* @param foc_len Focal Length (mm)
* @param flags See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_camera_feedback_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, int32_t lat, int32_t lng, float alt, float roll, float pitch, float yaw, float foc_len, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_int32_t(buf, 8, lat);
_mav_put_int32_t(buf, 12, lng);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_put_float(buf, 32, foc_len);
_mav_put_uint16_t(buf, 36, img_idx);
_mav_put_uint8_t(buf, 38, target_system);
_mav_put_uint8_t(buf, 39, cam_idx);
_mav_put_uint8_t(buf, 40, flags);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
#else
mavlink_camera_feedback_t packet;
packet.time_usec = time_usec;
packet.lat = lat;
packet.lng = lng;
packet.alt = alt;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.foc_len = foc_len;
packet.img_idx = img_idx;
packet.target_system = target_system;
packet.cam_idx = cam_idx;
packet.flags = flags;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_CAMERA_FEEDBACK_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_camera_feedback_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, int32_t lat, int32_t lng, float alt, float roll, float pitch, float yaw, float foc_len, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_int32_t(buf, 8, lat);
_mav_put_int32_t(buf, 12, lng);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_put_float(buf, 32, foc_len);
_mav_put_uint16_t(buf, 36, img_idx);
_mav_put_uint8_t(buf, 38, target_system);
_mav_put_uint8_t(buf, 39, cam_idx);
_mav_put_uint8_t(buf, 40, flags);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
#else
mavlink_camera_feedback_t *packet = (mavlink_camera_feedback_t *)msgbuf;
packet->time_usec = time_usec;
packet->lat = lat;
packet->lng = lng;
packet->alt = alt;
packet->roll = roll;
packet->pitch = pitch;
packet->yaw = yaw;
packet->foc_len = foc_len;
packet->img_idx = img_idx;
packet->target_system = target_system;
packet->cam_idx = cam_idx;
packet->flags = flags;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE CAMERA_FEEDBACK UNPACKING
/**
* @brief Get field time_usec from camera_feedback message
*
* @return Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_EVENT message
*/
static inline uint64_t mavlink_msg_camera_feedback_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field target_system from camera_feedback message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_camera_feedback_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 38);
}
/**
* @brief Get field cam_idx from camera_feedback message
*
* @return Camera ID
*/
static inline uint8_t mavlink_msg_camera_feedback_get_cam_idx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 39);
}
/**
* @brief Get field img_idx from camera_feedback message
*
* @return Image index
*/
static inline uint16_t mavlink_msg_camera_feedback_get_img_idx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 36);
}
/**
* @brief Get field lat from camera_feedback message
*
* @return Latitude in (deg * 1E7)
*/
static inline int32_t mavlink_msg_camera_feedback_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 8);
}
/**
* @brief Get field lng from camera_feedback message
*
* @return Longitude in (deg * 1E7)
*/
static inline int32_t mavlink_msg_camera_feedback_get_lng(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 12);
}
/**
* @brief Get field alt from camera_feedback message
*
* @return Altitude (meters, AMSL)
*/
static inline float mavlink_msg_camera_feedback_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field roll from camera_feedback message
*
* @return Vehicle Roll angle (degrees, +-180)
*/
static inline float mavlink_msg_camera_feedback_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field pitch from camera_feedback message
*
* @return Vehicle Pitch angle (degrees, +-180)
*/
static inline float mavlink_msg_camera_feedback_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field yaw from camera_feedback message
*
* @return Vehicle Heading (degrees, 0-360, true)
*/
static inline float mavlink_msg_camera_feedback_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field foc_len from camera_feedback message
*
* @return Focal Length (mm)
*/
static inline float mavlink_msg_camera_feedback_get_foc_len(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field flags from camera_feedback message
*
* @return See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
*/
static inline uint8_t mavlink_msg_camera_feedback_get_flags(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 40);
}
/**
* @brief Decode a camera_feedback message into a struct
*
* @param msg The message to decode
* @param camera_feedback C-struct to decode the message contents into
*/
static inline void mavlink_msg_camera_feedback_decode(const mavlink_message_t* msg, mavlink_camera_feedback_t* camera_feedback)
{
#if MAVLINK_NEED_BYTE_SWAP
camera_feedback->time_usec = mavlink_msg_camera_feedback_get_time_usec(msg);
camera_feedback->lat = mavlink_msg_camera_feedback_get_lat(msg);
camera_feedback->lng = mavlink_msg_camera_feedback_get_lng(msg);
camera_feedback->alt = mavlink_msg_camera_feedback_get_alt(msg);
camera_feedback->roll = mavlink_msg_camera_feedback_get_roll(msg);
camera_feedback->pitch = mavlink_msg_camera_feedback_get_pitch(msg);
camera_feedback->yaw = mavlink_msg_camera_feedback_get_yaw(msg);
camera_feedback->foc_len = mavlink_msg_camera_feedback_get_foc_len(msg);
camera_feedback->img_idx = mavlink_msg_camera_feedback_get_img_idx(msg);
camera_feedback->target_system = mavlink_msg_camera_feedback_get_target_system(msg);
camera_feedback->cam_idx = mavlink_msg_camera_feedback_get_cam_idx(msg);
camera_feedback->flags = mavlink_msg_camera_feedback_get_flags(msg);
#else
memcpy(camera_feedback, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
#endif
}

View File

@ -1504,6 +1504,130 @@ static void mavlink_test_ahrs2(uint8_t system_id, uint8_t component_id, mavlink_
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_camera_event(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_camera_event_t packet_in = {
93372036854775807ULL,
}73.0,
}101.0,
}129.0,
}157.0,
}18483,
}211,
}22,
}89,
};
mavlink_camera_event_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.p1 = packet_in.p1;
packet1.p2 = packet_in.p2;
packet1.p3 = packet_in.p3;
packet1.p4 = packet_in.p4;
packet1.img_idx = packet_in.img_idx;
packet1.target_system = packet_in.target_system;
packet1.cam_idx = packet_in.cam_idx;
packet1.event_id = packet_in.event_id;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_event_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_camera_event_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_event_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
mavlink_msg_camera_event_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_event_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
mavlink_msg_camera_event_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_camera_event_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_event_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
mavlink_msg_camera_event_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_camera_feedback(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_camera_feedback_t packet_in = {
93372036854775807ULL,
}963497880,
}963498088,
}129.0,
}157.0,
}185.0,
}213.0,
}241.0,
}19107,
}247,
}58,
}125,
};
mavlink_camera_feedback_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.lat = packet_in.lat;
packet1.lng = packet_in.lng;
packet1.alt = packet_in.alt;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.foc_len = packet_in.foc_len;
packet1.img_idx = packet_in.img_idx;
packet1.target_system = packet_in.target_system;
packet1.cam_idx = packet_in.cam_idx;
packet1.flags = packet_in.flags;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_feedback_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_camera_feedback_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_feedback_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
mavlink_msg_camera_feedback_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_feedback_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
mavlink_msg_camera_feedback_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_camera_feedback_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_camera_feedback_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
mavlink_msg_camera_feedback_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);
@ -1534,6 +1658,8 @@ static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id,
mavlink_test_rally_fetch_point(system_id, component_id, last_msg);
mavlink_test_compassmot_status(system_id, component_id, last_msg);
mavlink_test_ahrs2(system_id, component_id, last_msg);
mavlink_test_camera_event(system_id, component_id, last_msg);
mavlink_test_camera_feedback(system_id, component_id, last_msg);
}
#ifdef __cplusplus

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Apr 13 09:37:48 2014"
#define MAVLINK_BUILD_DATE "Mon Jun 23 10:13:03 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Apr 13 09:38:19 2014"
#define MAVLINK_BUILD_DATE "Mon Jun 23 10:13:13 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255

View File

@ -73,7 +73,7 @@ static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length)
* @param data new bytes to hash
* @param crcAccum the already accumulated checksum
**/
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint8_t length)
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length)
{
const uint8_t *p = (const uint8_t *)pBuffer;
while (length--) {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,393 @@
// MESSAGE ATTITUDE_SETPOINT_EXTERNAL PACKING
#define MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL 82
typedef struct __mavlink_attitude_setpoint_external_t
{
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
float q[4]; ///< Quaternion
float body_roll_rate; ///< Body roll rate in radians per second
float body_pitch_rate; ///< Body roll rate in radians per second
float body_yaw_rate; ///< Body roll rate in radians per second
float thrust; ///< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t ignore_mask; ///< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: roll, bit 2: pitch, bit 3: yaw, bit 4: roll rate, bit 5: pitch rate, bit 6: yaw rate, bit 7: thrust
} mavlink_attitude_setpoint_external_t;
#define MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN 39
#define MAVLINK_MSG_ID_82_LEN 39
#define MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC 212
#define MAVLINK_MSG_ID_82_CRC 212
#define MAVLINK_MSG_ATTITUDE_SETPOINT_EXTERNAL_FIELD_Q_LEN 4
#define MAVLINK_MESSAGE_INFO_ATTITUDE_SETPOINT_EXTERNAL { \
"ATTITUDE_SETPOINT_EXTERNAL", \
9, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_setpoint_external_t, time_boot_ms) }, \
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_setpoint_external_t, q) }, \
{ "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_setpoint_external_t, body_roll_rate) }, \
{ "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_setpoint_external_t, body_pitch_rate) }, \
{ "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_setpoint_external_t, body_yaw_rate) }, \
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_setpoint_external_t, thrust) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_setpoint_external_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_attitude_setpoint_external_t, target_component) }, \
{ "ignore_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_attitude_setpoint_external_t, ignore_mask) }, \
} \
}
/**
* @brief Pack a attitude_setpoint_external 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 time_boot_ms Timestamp in milliseconds since system boot
* @param target_system System ID
* @param target_component Component ID
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: roll, bit 2: pitch, bit 3: yaw, bit 4: roll rate, bit 5: pitch rate, bit 6: yaw rate, bit 7: thrust
* @param q Quaternion
* @param body_roll_rate Body roll rate in radians per second
* @param body_pitch_rate Body roll rate in radians per second
* @param body_yaw_rate Body roll rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_setpoint_external_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t ignore_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 20, body_roll_rate);
_mav_put_float(buf, 24, body_pitch_rate);
_mav_put_float(buf, 28, body_yaw_rate);
_mav_put_float(buf, 32, thrust);
_mav_put_uint8_t(buf, 36, target_system);
_mav_put_uint8_t(buf, 37, target_component);
_mav_put_uint8_t(buf, 38, ignore_mask);
_mav_put_float_array(buf, 4, q, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#else
mavlink_attitude_setpoint_external_t packet;
packet.time_boot_ms = time_boot_ms;
packet.body_roll_rate = body_roll_rate;
packet.body_pitch_rate = body_pitch_rate;
packet.body_yaw_rate = body_yaw_rate;
packet.thrust = thrust;
packet.target_system = target_system;
packet.target_component = target_component;
packet.ignore_mask = ignore_mask;
mav_array_memcpy(packet.q, q, sizeof(float)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
}
/**
* @brief Pack a attitude_setpoint_external 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 time_boot_ms Timestamp in milliseconds since system boot
* @param target_system System ID
* @param target_component Component ID
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: roll, bit 2: pitch, bit 3: yaw, bit 4: roll rate, bit 5: pitch rate, bit 6: yaw rate, bit 7: thrust
* @param q Quaternion
* @param body_roll_rate Body roll rate in radians per second
* @param body_pitch_rate Body roll rate in radians per second
* @param body_yaw_rate Body roll rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_setpoint_external_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t ignore_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 20, body_roll_rate);
_mav_put_float(buf, 24, body_pitch_rate);
_mav_put_float(buf, 28, body_yaw_rate);
_mav_put_float(buf, 32, thrust);
_mav_put_uint8_t(buf, 36, target_system);
_mav_put_uint8_t(buf, 37, target_component);
_mav_put_uint8_t(buf, 38, ignore_mask);
_mav_put_float_array(buf, 4, q, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#else
mavlink_attitude_setpoint_external_t packet;
packet.time_boot_ms = time_boot_ms;
packet.body_roll_rate = body_roll_rate;
packet.body_pitch_rate = body_pitch_rate;
packet.body_yaw_rate = body_yaw_rate;
packet.thrust = thrust;
packet.target_system = target_system;
packet.target_component = target_component;
packet.ignore_mask = ignore_mask;
mav_array_memcpy(packet.q, q, sizeof(float)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
}
/**
* @brief Encode a attitude_setpoint_external 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 attitude_setpoint_external C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_attitude_setpoint_external_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_setpoint_external_t* attitude_setpoint_external)
{
return mavlink_msg_attitude_setpoint_external_pack(system_id, component_id, msg, attitude_setpoint_external->time_boot_ms, attitude_setpoint_external->target_system, attitude_setpoint_external->target_component, attitude_setpoint_external->ignore_mask, attitude_setpoint_external->q, attitude_setpoint_external->body_roll_rate, attitude_setpoint_external->body_pitch_rate, attitude_setpoint_external->body_yaw_rate, attitude_setpoint_external->thrust);
}
/**
* @brief Encode a attitude_setpoint_external 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 attitude_setpoint_external C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_attitude_setpoint_external_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_setpoint_external_t* attitude_setpoint_external)
{
return mavlink_msg_attitude_setpoint_external_pack_chan(system_id, component_id, chan, msg, attitude_setpoint_external->time_boot_ms, attitude_setpoint_external->target_system, attitude_setpoint_external->target_component, attitude_setpoint_external->ignore_mask, attitude_setpoint_external->q, attitude_setpoint_external->body_roll_rate, attitude_setpoint_external->body_pitch_rate, attitude_setpoint_external->body_yaw_rate, attitude_setpoint_external->thrust);
}
/**
* @brief Send a attitude_setpoint_external message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp in milliseconds since system boot
* @param target_system System ID
* @param target_component Component ID
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: roll, bit 2: pitch, bit 3: yaw, bit 4: roll rate, bit 5: pitch rate, bit 6: yaw rate, bit 7: thrust
* @param q Quaternion
* @param body_roll_rate Body roll rate in radians per second
* @param body_pitch_rate Body roll rate in radians per second
* @param body_yaw_rate Body roll rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_attitude_setpoint_external_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t ignore_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 20, body_roll_rate);
_mav_put_float(buf, 24, body_pitch_rate);
_mav_put_float(buf, 28, body_yaw_rate);
_mav_put_float(buf, 32, thrust);
_mav_put_uint8_t(buf, 36, target_system);
_mav_put_uint8_t(buf, 37, target_component);
_mav_put_uint8_t(buf, 38, ignore_mask);
_mav_put_float_array(buf, 4, q, 4);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
#else
mavlink_attitude_setpoint_external_t packet;
packet.time_boot_ms = time_boot_ms;
packet.body_roll_rate = body_roll_rate;
packet.body_pitch_rate = body_pitch_rate;
packet.body_yaw_rate = body_yaw_rate;
packet.thrust = thrust;
packet.target_system = target_system;
packet.target_component = target_component;
packet.ignore_mask = ignore_mask;
mav_array_memcpy(packet.q, q, sizeof(float)*4);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_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_attitude_setpoint_external_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t ignore_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 20, body_roll_rate);
_mav_put_float(buf, 24, body_pitch_rate);
_mav_put_float(buf, 28, body_yaw_rate);
_mav_put_float(buf, 32, thrust);
_mav_put_uint8_t(buf, 36, target_system);
_mav_put_uint8_t(buf, 37, target_component);
_mav_put_uint8_t(buf, 38, ignore_mask);
_mav_put_float_array(buf, 4, q, 4);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
#else
mavlink_attitude_setpoint_external_t *packet = (mavlink_attitude_setpoint_external_t *)msgbuf;
packet->time_boot_ms = time_boot_ms;
packet->body_roll_rate = body_roll_rate;
packet->body_pitch_rate = body_pitch_rate;
packet->body_yaw_rate = body_yaw_rate;
packet->thrust = thrust;
packet->target_system = target_system;
packet->target_component = target_component;
packet->ignore_mask = ignore_mask;
mav_array_memcpy(packet->q, q, sizeof(float)*4);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE ATTITUDE_SETPOINT_EXTERNAL UNPACKING
/**
* @brief Get field time_boot_ms from attitude_setpoint_external message
*
* @return Timestamp in milliseconds since system boot
*/
static inline uint32_t mavlink_msg_attitude_setpoint_external_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field target_system from attitude_setpoint_external message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_attitude_setpoint_external_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 36);
}
/**
* @brief Get field target_component from attitude_setpoint_external message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_attitude_setpoint_external_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 37);
}
/**
* @brief Get field ignore_mask from attitude_setpoint_external message
*
* @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: roll, bit 2: pitch, bit 3: yaw, bit 4: roll rate, bit 5: pitch rate, bit 6: yaw rate, bit 7: thrust
*/
static inline uint8_t mavlink_msg_attitude_setpoint_external_get_ignore_mask(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 38);
}
/**
* @brief Get field q from attitude_setpoint_external message
*
* @return Quaternion
*/
static inline uint16_t mavlink_msg_attitude_setpoint_external_get_q(const mavlink_message_t* msg, float *q)
{
return _MAV_RETURN_float_array(msg, q, 4, 4);
}
/**
* @brief Get field body_roll_rate from attitude_setpoint_external message
*
* @return Body roll rate in radians per second
*/
static inline float mavlink_msg_attitude_setpoint_external_get_body_roll_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field body_pitch_rate from attitude_setpoint_external message
*
* @return Body roll rate in radians per second
*/
static inline float mavlink_msg_attitude_setpoint_external_get_body_pitch_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field body_yaw_rate from attitude_setpoint_external message
*
* @return Body roll rate in radians per second
*/
static inline float mavlink_msg_attitude_setpoint_external_get_body_yaw_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field thrust from attitude_setpoint_external message
*
* @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
*/
static inline float mavlink_msg_attitude_setpoint_external_get_thrust(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Decode a attitude_setpoint_external message into a struct
*
* @param msg The message to decode
* @param attitude_setpoint_external C-struct to decode the message contents into
*/
static inline void mavlink_msg_attitude_setpoint_external_decode(const mavlink_message_t* msg, mavlink_attitude_setpoint_external_t* attitude_setpoint_external)
{
#if MAVLINK_NEED_BYTE_SWAP
attitude_setpoint_external->time_boot_ms = mavlink_msg_attitude_setpoint_external_get_time_boot_ms(msg);
mavlink_msg_attitude_setpoint_external_get_q(msg, attitude_setpoint_external->q);
attitude_setpoint_external->body_roll_rate = mavlink_msg_attitude_setpoint_external_get_body_roll_rate(msg);
attitude_setpoint_external->body_pitch_rate = mavlink_msg_attitude_setpoint_external_get_body_pitch_rate(msg);
attitude_setpoint_external->body_yaw_rate = mavlink_msg_attitude_setpoint_external_get_body_yaw_rate(msg);
attitude_setpoint_external->thrust = mavlink_msg_attitude_setpoint_external_get_thrust(msg);
attitude_setpoint_external->target_system = mavlink_msg_attitude_setpoint_external_get_target_system(msg);
attitude_setpoint_external->target_component = mavlink_msg_attitude_setpoint_external_get_target_component(msg);
attitude_setpoint_external->ignore_mask = mavlink_msg_attitude_setpoint_external_get_ignore_mask(msg);
#else
memcpy(attitude_setpoint_external, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN);
#endif
}

View File

@ -44,17 +44,17 @@ typedef struct __mavlink_distance_sensor_t
* @param msg The MAVLink message to compress the data into
*
* @param time_boot_ms Time since system boot
* @param type Type from MAV_DISTANCE_SENSOR enum.
* @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces from FIXME enum.
* @param min_distance Minimum distance the sensor can measure in centimeters
* @param max_distance Maximum distance the sensor can measure in centimeters
* @param current_distance Current distance reading
* @param type Type from MAV_DISTANCE_SENSOR enum.
* @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces from FIXME enum.
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint8_t type, uint8_t id, uint8_t orientation, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t covariance)
uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
@ -97,18 +97,18 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param time_boot_ms Time since system boot
* @param type Type from MAV_DISTANCE_SENSOR enum.
* @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces from FIXME enum.
* @param min_distance Minimum distance the sensor can measure in centimeters
* @param max_distance Maximum distance the sensor can measure in centimeters
* @param current_distance Current distance reading
* @param type Type from MAV_DISTANCE_SENSOR enum.
* @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces from FIXME enum.
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,uint8_t type,uint8_t id,uint8_t orientation,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t covariance)
uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
@ -154,7 +154,7 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id,
*/
static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
{
return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->covariance);
return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
}
/**
@ -168,7 +168,7 @@ static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uin
*/
static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
{
return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->covariance);
return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
}
/**
@ -176,17 +176,17 @@ static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Time since system boot
* @param type Type from MAV_DISTANCE_SENSOR enum.
* @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces from FIXME enum.
* @param min_distance Minimum distance the sensor can measure in centimeters
* @param max_distance Maximum distance the sensor can measure in centimeters
* @param current_distance Current distance reading
* @param type Type from MAV_DISTANCE_SENSOR enum.
* @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces from FIXME enum.
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type, uint8_t id, uint8_t orientation, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t covariance)
static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
@ -231,7 +231,7 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint
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_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type, uint8_t id, uint8_t orientation, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t covariance)
static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
@ -284,36 +284,6 @@ static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlin
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field type from distance_sensor message
*
* @return Type from MAV_DISTANCE_SENSOR enum.
*/
static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field id from distance_sensor message
*
* @return Onboard ID of the sensor
*/
static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 11);
}
/**
* @brief Get field orientation from distance_sensor message
*
* @return Direction the sensor faces from FIXME enum.
*/
static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 12);
}
/**
* @brief Get field min_distance from distance_sensor message
*
@ -344,6 +314,36 @@ static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const ma
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field type from distance_sensor message
*
* @return Type from MAV_DISTANCE_SENSOR enum.
*/
static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field id from distance_sensor message
*
* @return Onboard ID of the sensor
*/
static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 11);
}
/**
* @brief Get field orientation from distance_sensor message
*
* @return Direction the sensor faces from FIXME enum.
*/
static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 12);
}
/**
* @brief Get field covariance from distance_sensor message
*

View File

@ -0,0 +1,497 @@
// MESSAGE GLOBAL_POSITION_SETPOINT_EXTERNAL_INT PACKING
#define MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT 84
typedef struct __mavlink_global_position_setpoint_external_int_t
{
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
int32_t lat_int; ///< X Position in WGS84 frame in 1e7 * meters
int32_t lon_int; ///< Y Position in WGS84 frame in 1e7 * meters
float alt; ///< Altitude in WGS84, not AMSL
float vx; ///< X velocity in NED frame in meter / s
float vy; ///< Y velocity in NED frame in meter / s
float vz; ///< Z velocity in NED frame in meter / s
float ax; ///< X acceleration in NED frame in meter / s^2
float ay; ///< Y acceleration in NED frame in meter / s^2
float az; ///< Z acceleration in NED frame in meter / s^2
uint16_t ignore_mask; ///< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: lat, bit 2: lon, bit 3: alt, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_global_position_setpoint_external_int_t;
#define MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN 44
#define MAVLINK_MSG_ID_84_LEN 44
#define MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC 172
#define MAVLINK_MSG_ID_84_CRC 172
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT { \
"GLOBAL_POSITION_SETPOINT_EXTERNAL_INT", \
13, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_setpoint_external_int_t, time_boot_ms) }, \
{ "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_setpoint_external_int_t, lat_int) }, \
{ "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_setpoint_external_int_t, lon_int) }, \
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_position_setpoint_external_int_t, alt) }, \
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_position_setpoint_external_int_t, vx) }, \
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_position_setpoint_external_int_t, vy) }, \
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_setpoint_external_int_t, vz) }, \
{ "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_setpoint_external_int_t, ax) }, \
{ "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_setpoint_external_int_t, ay) }, \
{ "az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_global_position_setpoint_external_int_t, az) }, \
{ "ignore_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_global_position_setpoint_external_int_t, ignore_mask) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_global_position_setpoint_external_int_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_global_position_setpoint_external_int_t, target_component) }, \
} \
}
/**
* @brief Pack a global_position_setpoint_external_int 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 time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
* @param target_system System ID
* @param target_component Component ID
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: lat, bit 2: lon, bit 3: alt, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in WGS84, not AMSL
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
* @param ax X acceleration in NED frame in meter / s^2
* @param ay Y acceleration in NED frame in meter / s^2
* @param az Z acceleration in NED frame in meter / s^2
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_global_position_setpoint_external_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint16_t ignore_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float ax, float ay, float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat_int);
_mav_put_int32_t(buf, 8, lon_int);
_mav_put_float(buf, 12, alt);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#else
mavlink_global_position_setpoint_external_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.lat_int = lat_int;
packet.lon_int = lon_int;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.ax = ax;
packet.ay = ay;
packet.az = az;
packet.ignore_mask = ignore_mask;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
}
/**
* @brief Pack a global_position_setpoint_external_int 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 time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
* @param target_system System ID
* @param target_component Component ID
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: lat, bit 2: lon, bit 3: alt, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in WGS84, not AMSL
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
* @param ax X acceleration in NED frame in meter / s^2
* @param ay Y acceleration in NED frame in meter / s^2
* @param az Z acceleration in NED frame in meter / s^2
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_global_position_setpoint_external_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint16_t ignore_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float ax,float ay,float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat_int);
_mav_put_int32_t(buf, 8, lon_int);
_mav_put_float(buf, 12, alt);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#else
mavlink_global_position_setpoint_external_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.lat_int = lat_int;
packet.lon_int = lon_int;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.ax = ax;
packet.ay = ay;
packet.az = az;
packet.ignore_mask = ignore_mask;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
}
/**
* @brief Encode a global_position_setpoint_external_int 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 global_position_setpoint_external_int C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_global_position_setpoint_external_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_setpoint_external_int_t* global_position_setpoint_external_int)
{
return mavlink_msg_global_position_setpoint_external_int_pack(system_id, component_id, msg, global_position_setpoint_external_int->time_boot_ms, global_position_setpoint_external_int->target_system, global_position_setpoint_external_int->target_component, global_position_setpoint_external_int->ignore_mask, global_position_setpoint_external_int->lat_int, global_position_setpoint_external_int->lon_int, global_position_setpoint_external_int->alt, global_position_setpoint_external_int->vx, global_position_setpoint_external_int->vy, global_position_setpoint_external_int->vz, global_position_setpoint_external_int->ax, global_position_setpoint_external_int->ay, global_position_setpoint_external_int->az);
}
/**
* @brief Encode a global_position_setpoint_external_int 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 global_position_setpoint_external_int C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_global_position_setpoint_external_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_setpoint_external_int_t* global_position_setpoint_external_int)
{
return mavlink_msg_global_position_setpoint_external_int_pack_chan(system_id, component_id, chan, msg, global_position_setpoint_external_int->time_boot_ms, global_position_setpoint_external_int->target_system, global_position_setpoint_external_int->target_component, global_position_setpoint_external_int->ignore_mask, global_position_setpoint_external_int->lat_int, global_position_setpoint_external_int->lon_int, global_position_setpoint_external_int->alt, global_position_setpoint_external_int->vx, global_position_setpoint_external_int->vy, global_position_setpoint_external_int->vz, global_position_setpoint_external_int->ax, global_position_setpoint_external_int->ay, global_position_setpoint_external_int->az);
}
/**
* @brief Send a global_position_setpoint_external_int message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
* @param target_system System ID
* @param target_component Component ID
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: lat, bit 2: lon, bit 3: alt, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in WGS84, not AMSL
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
* @param ax X acceleration in NED frame in meter / s^2
* @param ay Y acceleration in NED frame in meter / s^2
* @param az Z acceleration in NED frame in meter / s^2
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_global_position_setpoint_external_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint16_t ignore_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float ax, float ay, float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat_int);
_mav_put_int32_t(buf, 8, lon_int);
_mav_put_float(buf, 12, alt);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
#else
mavlink_global_position_setpoint_external_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.lat_int = lat_int;
packet.lon_int = lon_int;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.ax = ax;
packet.ay = ay;
packet.az = az;
packet.ignore_mask = ignore_mask;
packet.target_system = target_system;
packet.target_component = target_component;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_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_global_position_setpoint_external_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint16_t ignore_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float ax, float ay, float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat_int);
_mav_put_int32_t(buf, 8, lon_int);
_mav_put_float(buf, 12, alt);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
#else
mavlink_global_position_setpoint_external_int_t *packet = (mavlink_global_position_setpoint_external_int_t *)msgbuf;
packet->time_boot_ms = time_boot_ms;
packet->lat_int = lat_int;
packet->lon_int = lon_int;
packet->alt = alt;
packet->vx = vx;
packet->vy = vy;
packet->vz = vz;
packet->ax = ax;
packet->ay = ay;
packet->az = az;
packet->ignore_mask = ignore_mask;
packet->target_system = target_system;
packet->target_component = target_component;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE GLOBAL_POSITION_SETPOINT_EXTERNAL_INT UNPACKING
/**
* @brief Get field time_boot_ms from global_position_setpoint_external_int message
*
* @return Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
*/
static inline uint32_t mavlink_msg_global_position_setpoint_external_int_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field target_system from global_position_setpoint_external_int message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_global_position_setpoint_external_int_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 42);
}
/**
* @brief Get field target_component from global_position_setpoint_external_int message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_global_position_setpoint_external_int_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 43);
}
/**
* @brief Get field ignore_mask from global_position_setpoint_external_int message
*
* @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: lat, bit 2: lon, bit 3: alt, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
*/
static inline uint16_t mavlink_msg_global_position_setpoint_external_int_get_ignore_mask(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 40);
}
/**
* @brief Get field lat_int from global_position_setpoint_external_int message
*
* @return X Position in WGS84 frame in 1e7 * meters
*/
static inline int32_t mavlink_msg_global_position_setpoint_external_int_get_lat_int(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 4);
}
/**
* @brief Get field lon_int from global_position_setpoint_external_int message
*
* @return Y Position in WGS84 frame in 1e7 * meters
*/
static inline int32_t mavlink_msg_global_position_setpoint_external_int_get_lon_int(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 8);
}
/**
* @brief Get field alt from global_position_setpoint_external_int message
*
* @return Altitude in WGS84, not AMSL
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field vx from global_position_setpoint_external_int message
*
* @return X velocity in NED frame in meter / s
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_vx(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field vy from global_position_setpoint_external_int message
*
* @return Y velocity in NED frame in meter / s
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_vy(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field vz from global_position_setpoint_external_int message
*
* @return Z velocity in NED frame in meter / s
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_vz(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field ax from global_position_setpoint_external_int message
*
* @return X acceleration in NED frame in meter / s^2
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_ax(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field ay from global_position_setpoint_external_int message
*
* @return Y acceleration in NED frame in meter / s^2
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_ay(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field az from global_position_setpoint_external_int message
*
* @return Z acceleration in NED frame in meter / s^2
*/
static inline float mavlink_msg_global_position_setpoint_external_int_get_az(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 36);
}
/**
* @brief Decode a global_position_setpoint_external_int message into a struct
*
* @param msg The message to decode
* @param global_position_setpoint_external_int C-struct to decode the message contents into
*/
static inline void mavlink_msg_global_position_setpoint_external_int_decode(const mavlink_message_t* msg, mavlink_global_position_setpoint_external_int_t* global_position_setpoint_external_int)
{
#if MAVLINK_NEED_BYTE_SWAP
global_position_setpoint_external_int->time_boot_ms = mavlink_msg_global_position_setpoint_external_int_get_time_boot_ms(msg);
global_position_setpoint_external_int->lat_int = mavlink_msg_global_position_setpoint_external_int_get_lat_int(msg);
global_position_setpoint_external_int->lon_int = mavlink_msg_global_position_setpoint_external_int_get_lon_int(msg);
global_position_setpoint_external_int->alt = mavlink_msg_global_position_setpoint_external_int_get_alt(msg);
global_position_setpoint_external_int->vx = mavlink_msg_global_position_setpoint_external_int_get_vx(msg);
global_position_setpoint_external_int->vy = mavlink_msg_global_position_setpoint_external_int_get_vy(msg);
global_position_setpoint_external_int->vz = mavlink_msg_global_position_setpoint_external_int_get_vz(msg);
global_position_setpoint_external_int->ax = mavlink_msg_global_position_setpoint_external_int_get_ax(msg);
global_position_setpoint_external_int->ay = mavlink_msg_global_position_setpoint_external_int_get_ay(msg);
global_position_setpoint_external_int->az = mavlink_msg_global_position_setpoint_external_int_get_az(msg);
global_position_setpoint_external_int->ignore_mask = mavlink_msg_global_position_setpoint_external_int_get_ignore_mask(msg);
global_position_setpoint_external_int->target_system = mavlink_msg_global_position_setpoint_external_int_get_target_system(msg);
global_position_setpoint_external_int->target_component = mavlink_msg_global_position_setpoint_external_int_get_target_component(msg);
#else
memcpy(global_position_setpoint_external_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN);
#endif
}

View File

@ -7,7 +7,7 @@ typedef struct __mavlink_heartbeat_t
uint32_t custom_mode; ///< A bitfield for use for autopilot-specific flags.
uint8_t type; ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
uint8_t autopilot; ///< Autopilot type / class. defined in MAV_AUTOPILOT ENUM
uint8_t base_mode; ///< System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
uint8_t base_mode; ///< System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
uint8_t system_status; ///< System status flag, see MAV_STATE ENUM
uint8_t mavlink_version; ///< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
} mavlink_heartbeat_t;
@ -41,7 +41,7 @@ typedef struct __mavlink_heartbeat_t
*
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
* @param custom_mode A bitfield for use for autopilot-specific flags.
* @param system_status System status flag, see MAV_STATE ENUM
* @return length of the message in bytes (excluding serial stream start sign)
@ -87,7 +87,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
* @param msg The MAVLink message to compress the data into
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
* @param custom_mode A bitfield for use for autopilot-specific flags.
* @param system_status System status flag, see MAV_STATE ENUM
* @return length of the message in bytes (excluding serial stream start sign)
@ -159,7 +159,7 @@ static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint
*
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
* @param custom_mode A bitfield for use for autopilot-specific flags.
* @param system_status System status flag, see MAV_STATE ENUM
*/
@ -268,7 +268,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_
/**
* @brief Get field base_mode from heartbeat message
*
* @return System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @return System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
*/
static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg)
{

View File

@ -0,0 +1,521 @@
// MESSAGE LOCAL_NED_POSITION_SETPOINT_EXTERNAL PACKING
#define MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL 83
typedef struct __mavlink_local_ned_position_setpoint_external_t
{
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
float x; ///< X Position in NED frame in meters
float y; ///< Y Position in NED frame in meters
float z; ///< Z Position in NED frame in meters (note, altitude is negative in NED)
float vx; ///< X velocity in NED frame in meter / s
float vy; ///< Y velocity in NED frame in meter / s
float vz; ///< Z velocity in NED frame in meter / s
float ax; ///< X acceleration in NED frame in meter / s^2
float ay; ///< Y acceleration in NED frame in meter / s^2
float az; ///< Z acceleration in NED frame in meter / s^2
uint16_t ignore_mask; ///< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t coordinate_frame; ///< Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7
} mavlink_local_ned_position_setpoint_external_t;
#define MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN 45
#define MAVLINK_MSG_ID_83_LEN 45
#define MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC 121
#define MAVLINK_MSG_ID_83_CRC 121
#define MAVLINK_MESSAGE_INFO_LOCAL_NED_POSITION_SETPOINT_EXTERNAL { \
"LOCAL_NED_POSITION_SETPOINT_EXTERNAL", \
14, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_ned_position_setpoint_external_t, time_boot_ms) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_ned_position_setpoint_external_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_ned_position_setpoint_external_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_ned_position_setpoint_external_t, z) }, \
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_ned_position_setpoint_external_t, vx) }, \
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_ned_position_setpoint_external_t, vy) }, \
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_ned_position_setpoint_external_t, vz) }, \
{ "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_ned_position_setpoint_external_t, ax) }, \
{ "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_ned_position_setpoint_external_t, ay) }, \
{ "az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_ned_position_setpoint_external_t, az) }, \
{ "ignore_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_local_ned_position_setpoint_external_t, ignore_mask) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_local_ned_position_setpoint_external_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_local_ned_position_setpoint_external_t, target_component) }, \
{ "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_local_ned_position_setpoint_external_t, coordinate_frame) }, \
} \
}
/**
* @brief Pack a local_ned_position_setpoint_external 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 time_boot_ms Timestamp in milliseconds since system boot
* @param target_system System ID
* @param target_component Component ID
* @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
* @param x X Position in NED frame in meters
* @param y Y Position in NED frame in meters
* @param z Z Position in NED frame in meters (note, altitude is negative in NED)
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
* @param ax X acceleration in NED frame in meter / s^2
* @param ay Y acceleration in NED frame in meter / s^2
* @param az Z acceleration in NED frame in meter / s^2
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_local_ned_position_setpoint_external_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t ignore_mask, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
_mav_put_uint8_t(buf, 44, coordinate_frame);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#else
mavlink_local_ned_position_setpoint_external_t packet;
packet.time_boot_ms = time_boot_ms;
packet.x = x;
packet.y = y;
packet.z = z;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.ax = ax;
packet.ay = ay;
packet.az = az;
packet.ignore_mask = ignore_mask;
packet.target_system = target_system;
packet.target_component = target_component;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
}
/**
* @brief Pack a local_ned_position_setpoint_external 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 time_boot_ms Timestamp in milliseconds since system boot
* @param target_system System ID
* @param target_component Component ID
* @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
* @param x X Position in NED frame in meters
* @param y Y Position in NED frame in meters
* @param z Z Position in NED frame in meters (note, altitude is negative in NED)
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
* @param ax X acceleration in NED frame in meter / s^2
* @param ay Y acceleration in NED frame in meter / s^2
* @param az Z acceleration in NED frame in meter / s^2
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_local_ned_position_setpoint_external_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t ignore_mask,float x,float y,float z,float vx,float vy,float vz,float ax,float ay,float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
_mav_put_uint8_t(buf, 44, coordinate_frame);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#else
mavlink_local_ned_position_setpoint_external_t packet;
packet.time_boot_ms = time_boot_ms;
packet.x = x;
packet.y = y;
packet.z = z;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.ax = ax;
packet.ay = ay;
packet.az = az;
packet.ignore_mask = ignore_mask;
packet.target_system = target_system;
packet.target_component = target_component;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
}
/**
* @brief Encode a local_ned_position_setpoint_external 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 local_ned_position_setpoint_external C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_local_ned_position_setpoint_external_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_ned_position_setpoint_external_t* local_ned_position_setpoint_external)
{
return mavlink_msg_local_ned_position_setpoint_external_pack(system_id, component_id, msg, local_ned_position_setpoint_external->time_boot_ms, local_ned_position_setpoint_external->target_system, local_ned_position_setpoint_external->target_component, local_ned_position_setpoint_external->coordinate_frame, local_ned_position_setpoint_external->ignore_mask, local_ned_position_setpoint_external->x, local_ned_position_setpoint_external->y, local_ned_position_setpoint_external->z, local_ned_position_setpoint_external->vx, local_ned_position_setpoint_external->vy, local_ned_position_setpoint_external->vz, local_ned_position_setpoint_external->ax, local_ned_position_setpoint_external->ay, local_ned_position_setpoint_external->az);
}
/**
* @brief Encode a local_ned_position_setpoint_external 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 local_ned_position_setpoint_external C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_local_ned_position_setpoint_external_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_ned_position_setpoint_external_t* local_ned_position_setpoint_external)
{
return mavlink_msg_local_ned_position_setpoint_external_pack_chan(system_id, component_id, chan, msg, local_ned_position_setpoint_external->time_boot_ms, local_ned_position_setpoint_external->target_system, local_ned_position_setpoint_external->target_component, local_ned_position_setpoint_external->coordinate_frame, local_ned_position_setpoint_external->ignore_mask, local_ned_position_setpoint_external->x, local_ned_position_setpoint_external->y, local_ned_position_setpoint_external->z, local_ned_position_setpoint_external->vx, local_ned_position_setpoint_external->vy, local_ned_position_setpoint_external->vz, local_ned_position_setpoint_external->ax, local_ned_position_setpoint_external->ay, local_ned_position_setpoint_external->az);
}
/**
* @brief Send a local_ned_position_setpoint_external message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp in milliseconds since system boot
* @param target_system System ID
* @param target_component Component ID
* @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7
* @param ignore_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
* @param x X Position in NED frame in meters
* @param y Y Position in NED frame in meters
* @param z Z Position in NED frame in meters (note, altitude is negative in NED)
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
* @param ax X acceleration in NED frame in meter / s^2
* @param ay Y acceleration in NED frame in meter / s^2
* @param az Z acceleration in NED frame in meter / s^2
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_local_ned_position_setpoint_external_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t ignore_mask, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
_mav_put_uint8_t(buf, 44, coordinate_frame);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
#else
mavlink_local_ned_position_setpoint_external_t packet;
packet.time_boot_ms = time_boot_ms;
packet.x = x;
packet.y = y;
packet.z = z;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.ax = ax;
packet.ay = ay;
packet.az = az;
packet.ignore_mask = ignore_mask;
packet.target_system = target_system;
packet.target_component = target_component;
packet.coordinate_frame = coordinate_frame;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_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_local_ned_position_setpoint_external_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t ignore_mask, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, vx);
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
_mav_put_float(buf, 28, ax);
_mav_put_float(buf, 32, ay);
_mav_put_float(buf, 36, az);
_mav_put_uint16_t(buf, 40, ignore_mask);
_mav_put_uint8_t(buf, 42, target_system);
_mav_put_uint8_t(buf, 43, target_component);
_mav_put_uint8_t(buf, 44, coordinate_frame);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, buf, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
#else
mavlink_local_ned_position_setpoint_external_t *packet = (mavlink_local_ned_position_setpoint_external_t *)msgbuf;
packet->time_boot_ms = time_boot_ms;
packet->x = x;
packet->y = y;
packet->z = z;
packet->vx = vx;
packet->vy = vy;
packet->vz = vz;
packet->ax = ax;
packet->ay = ay;
packet->az = az;
packet->ignore_mask = ignore_mask;
packet->target_system = target_system;
packet->target_component = target_component;
packet->coordinate_frame = coordinate_frame;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, (const char *)packet, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL, (const char *)packet, MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE LOCAL_NED_POSITION_SETPOINT_EXTERNAL UNPACKING
/**
* @brief Get field time_boot_ms from local_ned_position_setpoint_external message
*
* @return Timestamp in milliseconds since system boot
*/
static inline uint32_t mavlink_msg_local_ned_position_setpoint_external_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field target_system from local_ned_position_setpoint_external message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_local_ned_position_setpoint_external_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 42);
}
/**
* @brief Get field target_component from local_ned_position_setpoint_external message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_local_ned_position_setpoint_external_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 43);
}
/**
* @brief Get field coordinate_frame from local_ned_position_setpoint_external message
*
* @return Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7
*/
static inline uint8_t mavlink_msg_local_ned_position_setpoint_external_get_coordinate_frame(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 44);
}
/**
* @brief Get field ignore_mask from local_ned_position_setpoint_external message
*
* @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates it should follow the commanded attitude and rate and none of the setpoint dimensions should be ignored. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az
*/
static inline uint16_t mavlink_msg_local_ned_position_setpoint_external_get_ignore_mask(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 40);
}
/**
* @brief Get field x from local_ned_position_setpoint_external message
*
* @return X Position in NED frame in meters
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field y from local_ned_position_setpoint_external message
*
* @return Y Position in NED frame in meters
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field z from local_ned_position_setpoint_external message
*
* @return Z Position in NED frame in meters (note, altitude is negative in NED)
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field vx from local_ned_position_setpoint_external message
*
* @return X velocity in NED frame in meter / s
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_vx(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field vy from local_ned_position_setpoint_external message
*
* @return Y velocity in NED frame in meter / s
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_vy(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field vz from local_ned_position_setpoint_external message
*
* @return Z velocity in NED frame in meter / s
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_vz(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field ax from local_ned_position_setpoint_external message
*
* @return X acceleration in NED frame in meter / s^2
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_ax(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field ay from local_ned_position_setpoint_external message
*
* @return Y acceleration in NED frame in meter / s^2
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_ay(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field az from local_ned_position_setpoint_external message
*
* @return Z acceleration in NED frame in meter / s^2
*/
static inline float mavlink_msg_local_ned_position_setpoint_external_get_az(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 36);
}
/**
* @brief Decode a local_ned_position_setpoint_external message into a struct
*
* @param msg The message to decode
* @param local_ned_position_setpoint_external C-struct to decode the message contents into
*/
static inline void mavlink_msg_local_ned_position_setpoint_external_decode(const mavlink_message_t* msg, mavlink_local_ned_position_setpoint_external_t* local_ned_position_setpoint_external)
{
#if MAVLINK_NEED_BYTE_SWAP
local_ned_position_setpoint_external->time_boot_ms = mavlink_msg_local_ned_position_setpoint_external_get_time_boot_ms(msg);
local_ned_position_setpoint_external->x = mavlink_msg_local_ned_position_setpoint_external_get_x(msg);
local_ned_position_setpoint_external->y = mavlink_msg_local_ned_position_setpoint_external_get_y(msg);
local_ned_position_setpoint_external->z = mavlink_msg_local_ned_position_setpoint_external_get_z(msg);
local_ned_position_setpoint_external->vx = mavlink_msg_local_ned_position_setpoint_external_get_vx(msg);
local_ned_position_setpoint_external->vy = mavlink_msg_local_ned_position_setpoint_external_get_vy(msg);
local_ned_position_setpoint_external->vz = mavlink_msg_local_ned_position_setpoint_external_get_vz(msg);
local_ned_position_setpoint_external->ax = mavlink_msg_local_ned_position_setpoint_external_get_ax(msg);
local_ned_position_setpoint_external->ay = mavlink_msg_local_ned_position_setpoint_external_get_ay(msg);
local_ned_position_setpoint_external->az = mavlink_msg_local_ned_position_setpoint_external_get_az(msg);
local_ned_position_setpoint_external->ignore_mask = mavlink_msg_local_ned_position_setpoint_external_get_ignore_mask(msg);
local_ned_position_setpoint_external->target_system = mavlink_msg_local_ned_position_setpoint_external_get_target_system(msg);
local_ned_position_setpoint_external->target_component = mavlink_msg_local_ned_position_setpoint_external_get_target_component(msg);
local_ned_position_setpoint_external->coordinate_frame = mavlink_msg_local_ned_position_setpoint_external_get_coordinate_frame(msg);
#else
memcpy(local_ned_position_setpoint_external, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN);
#endif
}

View File

@ -3367,6 +3367,201 @@ static void mavlink_test_manual_setpoint(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_attitude_setpoint_external(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_attitude_setpoint_external_t packet_in = {
963497464,
}{ 45.0, 46.0, 47.0, 48.0 },
}157.0,
}185.0,
}213.0,
}241.0,
}113,
}180,
}247,
};
mavlink_attitude_setpoint_external_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.body_roll_rate = packet_in.body_roll_rate;
packet1.body_pitch_rate = packet_in.body_pitch_rate;
packet1.body_yaw_rate = packet_in.body_yaw_rate;
packet1.thrust = packet_in.thrust;
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
packet1.ignore_mask = packet_in.ignore_mask;
mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_setpoint_external_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_attitude_setpoint_external_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_setpoint_external_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.ignore_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
mavlink_msg_attitude_setpoint_external_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_setpoint_external_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.ignore_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
mavlink_msg_attitude_setpoint_external_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_attitude_setpoint_external_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_setpoint_external_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.ignore_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
mavlink_msg_attitude_setpoint_external_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_local_ned_position_setpoint_external(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_local_ned_position_setpoint_external_t packet_in = {
963497464,
}45.0,
}73.0,
}101.0,
}129.0,
}157.0,
}185.0,
}213.0,
}241.0,
}269.0,
}19315,
}3,
}70,
}137,
};
mavlink_local_ned_position_setpoint_external_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.vx = packet_in.vx;
packet1.vy = packet_in.vy;
packet1.vz = packet_in.vz;
packet1.ax = packet_in.ax;
packet1.ay = packet_in.ay;
packet1.az = packet_in.az;
packet1.ignore_mask = packet_in.ignore_mask;
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
packet1.coordinate_frame = packet_in.coordinate_frame;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_ned_position_setpoint_external_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_local_ned_position_setpoint_external_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_ned_position_setpoint_external_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.ignore_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az );
mavlink_msg_local_ned_position_setpoint_external_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_ned_position_setpoint_external_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.ignore_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az );
mavlink_msg_local_ned_position_setpoint_external_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_local_ned_position_setpoint_external_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_ned_position_setpoint_external_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.ignore_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az );
mavlink_msg_local_ned_position_setpoint_external_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_global_position_setpoint_external_int(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_global_position_setpoint_external_int_t packet_in = {
963497464,
}963497672,
}963497880,
}101.0,
}129.0,
}157.0,
}185.0,
}213.0,
}241.0,
}269.0,
}19315,
}3,
}70,
};
mavlink_global_position_setpoint_external_int_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.lat_int = packet_in.lat_int;
packet1.lon_int = packet_in.lon_int;
packet1.alt = packet_in.alt;
packet1.vx = packet_in.vx;
packet1.vy = packet_in.vy;
packet1.vz = packet_in.vz;
packet1.ax = packet_in.ax;
packet1.ay = packet_in.ay;
packet1.az = packet_in.az;
packet1.ignore_mask = packet_in.ignore_mask;
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_position_setpoint_external_int_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_global_position_setpoint_external_int_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_position_setpoint_external_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.ignore_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az );
mavlink_msg_global_position_setpoint_external_int_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_position_setpoint_external_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.ignore_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az );
mavlink_msg_global_position_setpoint_external_int_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_global_position_setpoint_external_int_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_position_setpoint_external_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.ignore_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az );
mavlink_msg_global_position_setpoint_external_int_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
@ -5270,12 +5465,12 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type , packet1.id , packet1.orientation , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.covariance );
mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
mavlink_msg_distance_sensor_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type , packet1.id , packet1.orientation , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.covariance );
mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
mavlink_msg_distance_sensor_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@ -5288,7 +5483,7 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.type , packet1.id , packet1.orientation , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.covariance );
mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
mavlink_msg_distance_sensor_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
@ -5821,6 +6016,9 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_command_ack(system_id, component_id, last_msg);
mavlink_test_roll_pitch_yaw_rates_thrust_setpoint(system_id, component_id, last_msg);
mavlink_test_manual_setpoint(system_id, component_id, last_msg);
mavlink_test_attitude_setpoint_external(system_id, component_id, last_msg);
mavlink_test_local_ned_position_setpoint_external(system_id, component_id, last_msg);
mavlink_test_global_position_setpoint_external_int(system_id, component_id, last_msg);
mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
mavlink_test_hil_state(system_id, component_id, last_msg);
mavlink_test_hil_controls(system_id, component_id, last_msg);

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Apr 13 09:39:04 2014"
#define MAVLINK_BUILD_DATE "Mon Jun 23 10:14:06 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Apr 13 09:38:32 2014"
#define MAVLINK_BUILD_DATE "Mon Jun 23 10:13:29 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255

View File

@ -73,7 +73,6 @@ MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, ui
#endif
{
// This code part is the same for all messages;
uint16_t checksum;
msg->magic = MAVLINK_STX;
msg->len = length;
msg->sysid = system_id;
@ -81,12 +80,13 @@ MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, ui
// One sequence number per component
msg->seq = mavlink_get_channel_status(chan)->current_tx_seq;
mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1;
checksum = crc_calculate((uint8_t*)&msg->len, length + MAVLINK_CORE_HEADER_LEN);
msg->checksum = crc_calculate(((const uint8_t*)(msg)) + 3, MAVLINK_CORE_HEADER_LEN);
crc_accumulate_buffer(&msg->checksum, _MAV_PAYLOAD(msg), msg->len);
#if MAVLINK_CRC_EXTRA
crc_accumulate(crc_extra, &checksum);
crc_accumulate(crc_extra, &msg->checksum);
#endif
mavlink_ck_a(msg) = (uint8_t)(checksum & 0xFF);
mavlink_ck_b(msg) = (uint8_t)(checksum >> 8);
mavlink_ck_a(msg) = (uint8_t)(msg->checksum & 0xFF);
mavlink_ck_b(msg) = (uint8_t)(msg->checksum >> 8);
return length + MAVLINK_NUM_NON_PAYLOAD_BYTES;
}
@ -133,7 +133,7 @@ MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint
buf[4] = mavlink_system.compid;
buf[5] = msgid;
status->current_tx_seq++;
checksum = crc_calculate((uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate((const uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN);
crc_accumulate_buffer(&checksum, packet, length);
#if MAVLINK_CRC_EXTRA
crc_accumulate(crc_extra, &checksum);
@ -158,6 +158,7 @@ MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_m
ck[0] = (uint8_t)(msg->checksum & 0xFF);
ck[1] = (uint8_t)(msg->checksum >> 8);
// XXX use the right sequence here
MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + msg->len);
_mavlink_send_uart(chan, (const char *)&msg->magic, MAVLINK_NUM_HEADER_BYTES);
@ -172,7 +173,13 @@ MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_m
*/
MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg)
{
memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len);
memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len);
uint8_t *ck = buffer + (MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len);
ck[0] = (uint8_t)(msg->checksum & 0xFF);
ck[1] = (uint8_t)(msg->checksum >> 8);
return MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len;
}

View File

@ -28,6 +28,7 @@
#define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES)
#pragma pack(push, 1)
typedef struct param_union {
union {
float param_float;
@ -62,13 +63,12 @@ typedef struct __mavlink_message {
uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
} mavlink_message_t;
typedef struct __mavlink_extended_message {
mavlink_message_t base_msg;
int32_t extended_payload_len; ///< Length of extended payload if any
uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN];
} mavlink_extended_message_t;
#pragma pack(pop)
typedef enum {
MAVLINK_TYPE_CHAR = 0,

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Apr 13 09:38:46 2014"
#define MAVLINK_BUILD_DATE "Mon Jun 23 10:13:53 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Apr 13 09:39:00 2014"
#define MAVLINK_BUILD_DATE "Mon Jun 23 10:13:41 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255