GCS_MAVLink: re-generate headers
This commit is contained in:
parent
b227f8463f
commit
fdcd5ca1a1
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Wed Feb 11 19:12:58 2015"
|
||||
#define MAVLINK_BUILD_DATE "Wed Feb 11 20:13:37 2015"
|
||||
#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
@ -0,0 +1,249 @@
|
||||
// MESSAGE ACTUATOR_CONTROL_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140
|
||||
|
||||
typedef struct __mavlink_actuator_control_target_t
|
||||
{
|
||||
uint64_t time_usec; ///< Timestamp (micros since boot or Unix epoch)
|
||||
float controls[8]; ///< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
uint8_t group_mlx; ///< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
} mavlink_actuator_control_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41
|
||||
#define MAVLINK_MSG_ID_140_LEN 41
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 181
|
||||
#define MAVLINK_MSG_ID_140_CRC 181
|
||||
|
||||
#define MAVLINK_MSG_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
|
||||
"ACTUATOR_CONTROL_TARGET", \
|
||||
3, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
|
||||
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a actuator_control_target 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 Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a actuator_control_target 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 Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t group_mlx,const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a actuator_control_target 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 actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a actuator_control_target 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 actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a actuator_control_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_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_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ACTUATOR_CONTROL_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from actuator_control_target message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field group_mlx from actuator_control_target message
|
||||
*
|
||||
* @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field controls from actuator_control_target message
|
||||
*
|
||||
* @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, controls, 8, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a actuator_control_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param actuator_control_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
actuator_control_target->time_usec = mavlink_msg_actuator_control_target_get_time_usec(msg);
|
||||
mavlink_msg_actuator_control_target_get_controls(msg, actuator_control_target->controls);
|
||||
actuator_control_target->group_mlx = mavlink_msg_actuator_control_target_get_group_mlx(msg);
|
||||
#else
|
||||
memcpy(actuator_control_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
}
|
@ -0,0 +1,297 @@
|
||||
// MESSAGE ATT_POS_MOCAP PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP 138
|
||||
|
||||
typedef struct __mavlink_att_pos_mocap_t
|
||||
{
|
||||
uint64_t time_usec; ///< Timestamp (micros since boot or Unix epoch)
|
||||
float q[4]; ///< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
float x; ///< X position in meters (NED)
|
||||
float y; ///< Y position in meters (NED)
|
||||
float z; ///< Z position in meters (NED)
|
||||
} mavlink_att_pos_mocap_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN 36
|
||||
#define MAVLINK_MSG_ID_138_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC 109
|
||||
#define MAVLINK_MSG_ID_138_CRC 109
|
||||
|
||||
#define MAVLINK_MSG_ATT_POS_MOCAP_FIELD_Q_LEN 4
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
|
||||
"ATT_POS_MOCAP", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a att_pos_mocap 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 Timestamp (micros since boot or Unix epoch)
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x X position in meters (NED)
|
||||
* @param y Y position in meters (NED)
|
||||
* @param z Z position in meters (NED)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *q, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a att_pos_mocap 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 Timestamp (micros since boot or Unix epoch)
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x X position in meters (NED)
|
||||
* @param y Y position in meters (NED)
|
||||
* @param z Z position in meters (NED)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *q,float x,float y,float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a att_pos_mocap 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 att_pos_mocap C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
return mavlink_msg_att_pos_mocap_pack(system_id, component_id, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a att_pos_mocap 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 att_pos_mocap C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
return mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, chan, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a att_pos_mocap message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x X position in meters (NED)
|
||||
* @param y Y position in meters (NED)
|
||||
* @param z Z position in meters (NED)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_att_pos_mocap_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATT_POS_MOCAP_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_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_att_pos_mocap_t *packet = (mavlink_att_pos_mocap_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATT_POS_MOCAP UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from att_pos_mocap message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from att_pos_mocap message
|
||||
*
|
||||
* @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from att_pos_mocap message
|
||||
*
|
||||
* @return X position in meters (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from att_pos_mocap message
|
||||
*
|
||||
* @return Y position in meters (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from att_pos_mocap message
|
||||
*
|
||||
* @return Z position in meters (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a att_pos_mocap message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param att_pos_mocap C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_decode(const mavlink_message_t* msg, mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
att_pos_mocap->time_usec = mavlink_msg_att_pos_mocap_get_time_usec(msg);
|
||||
mavlink_msg_att_pos_mocap_get_q(msg, att_pos_mocap->q);
|
||||
att_pos_mocap->x = mavlink_msg_att_pos_mocap_get_x(msg);
|
||||
att_pos_mocap->y = mavlink_msg_att_pos_mocap_get_y(msg);
|
||||
att_pos_mocap->z = mavlink_msg_att_pos_mocap_get_z(msg);
|
||||
#else
|
||||
memcpy(att_pos_mocap, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
}
|
@ -4,13 +4,13 @@
|
||||
|
||||
typedef struct __mavlink_radio_status_t
|
||||
{
|
||||
uint16_t rxerrors; ///< receive errors
|
||||
uint16_t fixed; ///< count of error corrected packets
|
||||
uint8_t rssi; ///< local signal strength
|
||||
uint8_t remrssi; ///< remote signal strength
|
||||
uint8_t txbuf; ///< how full the tx buffer is as a percentage
|
||||
uint8_t noise; ///< background noise level
|
||||
uint8_t remnoise; ///< remote background noise level
|
||||
uint16_t rxerrors; ///< Receive errors
|
||||
uint16_t fixed; ///< Count of error corrected packets
|
||||
uint8_t rssi; ///< Local signal strength
|
||||
uint8_t remrssi; ///< Remote signal strength
|
||||
uint8_t txbuf; ///< Remaining free buffer space in percent.
|
||||
uint8_t noise; ///< Background noise level
|
||||
uint8_t remnoise; ///< Remote background noise level
|
||||
} mavlink_radio_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO_STATUS_LEN 9
|
||||
@ -41,13 +41,13 @@ typedef struct __mavlink_radio_status_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @param rssi Local signal strength
|
||||
* @param remrssi Remote signal strength
|
||||
* @param txbuf Remaining free buffer space in percent.
|
||||
* @param noise Background noise level
|
||||
* @param remnoise Remote background noise level
|
||||
* @param rxerrors Receive errors
|
||||
* @param fixed Count of error corrected packets
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@ -91,13 +91,13 @@ static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t
|
||||
* @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 rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @param rssi Local signal strength
|
||||
* @param remrssi Remote signal strength
|
||||
* @param txbuf Remaining free buffer space in percent.
|
||||
* @param noise Background noise level
|
||||
* @param remnoise Remote background noise level
|
||||
* @param rxerrors Receive errors
|
||||
* @param fixed Count of error corrected packets
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@ -167,13 +167,13 @@ static inline uint16_t mavlink_msg_radio_status_encode_chan(uint8_t system_id, u
|
||||
* @brief Send a radio_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @param rssi Local signal strength
|
||||
* @param remrssi Remote signal strength
|
||||
* @param txbuf Remaining free buffer space in percent.
|
||||
* @param noise Background noise level
|
||||
* @param remnoise Remote background noise level
|
||||
* @param rxerrors Receive errors
|
||||
* @param fixed Count of error corrected packets
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@ -264,7 +264,7 @@ static inline void mavlink_msg_radio_status_send_buf(mavlink_message_t *msgbuf,
|
||||
/**
|
||||
* @brief Get field rssi from radio_status message
|
||||
*
|
||||
* @return local signal strength
|
||||
* @return Local signal strength
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* msg)
|
||||
{
|
||||
@ -274,7 +274,7 @@ static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t*
|
||||
/**
|
||||
* @brief Get field remrssi from radio_status message
|
||||
*
|
||||
* @return remote signal strength
|
||||
* @return Remote signal strength
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message_t* msg)
|
||||
{
|
||||
@ -284,7 +284,7 @@ static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message
|
||||
/**
|
||||
* @brief Get field txbuf from radio_status message
|
||||
*
|
||||
* @return how full the tx buffer is as a percentage
|
||||
* @return Remaining free buffer space in percent.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t* msg)
|
||||
{
|
||||
@ -294,7 +294,7 @@ static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t
|
||||
/**
|
||||
* @brief Get field noise from radio_status message
|
||||
*
|
||||
* @return background noise level
|
||||
* @return Background noise level
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t* msg)
|
||||
{
|
||||
@ -304,7 +304,7 @@ static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t
|
||||
/**
|
||||
* @brief Get field remnoise from radio_status message
|
||||
*
|
||||
* @return remote background noise level
|
||||
* @return Remote background noise level
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_message_t* msg)
|
||||
{
|
||||
@ -314,7 +314,7 @@ static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_messag
|
||||
/**
|
||||
* @brief Get field rxerrors from radio_status message
|
||||
*
|
||||
* @return receive errors
|
||||
* @return Receive errors
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_message_t* msg)
|
||||
{
|
||||
@ -324,7 +324,7 @@ static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_messa
|
||||
/**
|
||||
* @brief Get field fixed from radio_status message
|
||||
*
|
||||
* @return count of error corrected packets
|
||||
* @return Count of error corrected packets
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_status_get_fixed(const mavlink_message_t* msg)
|
||||
{
|
||||
|
@ -0,0 +1,297 @@
|
||||
// MESSAGE SET_ACTUATOR_CONTROL_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET 139
|
||||
|
||||
typedef struct __mavlink_set_actuator_control_target_t
|
||||
{
|
||||
uint64_t time_usec; ///< Timestamp (micros since boot or Unix epoch)
|
||||
float controls[8]; ///< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
uint8_t group_mlx; ///< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
} mavlink_set_actuator_control_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN 43
|
||||
#define MAVLINK_MSG_ID_139_LEN 43
|
||||
|
||||
#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC 168
|
||||
#define MAVLINK_MSG_ID_139_CRC 168
|
||||
|
||||
#define MAVLINK_MSG_SET_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET { \
|
||||
"SET_ACTUATOR_CONTROL_TARGET", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \
|
||||
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a set_actuator_control_target 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 Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_uint8_t(buf, 41, target_system);
|
||||
_mav_put_uint8_t(buf, 42, target_component);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_set_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a set_actuator_control_target 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 Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t group_mlx,uint8_t target_system,uint8_t target_component,const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_uint8_t(buf, 41, target_system);
|
||||
_mav_put_uint8_t(buf, 42, target_component);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_set_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a set_actuator_control_target 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 set_actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_set_actuator_control_target_pack(system_id, component_id, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a set_actuator_control_target 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 set_actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, chan, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a set_actuator_control_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_set_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_uint8_t(buf, 41, target_system);
|
||||
_mav_put_uint8_t(buf, 42, target_component);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_set_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_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_set_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_uint8_t(buf, 41, target_system);
|
||||
_mav_put_uint8_t(buf, 42, target_component);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_set_actuator_control_target_t *packet = (mavlink_set_actuator_control_target_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->group_mlx = group_mlx;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SET_ACTUATOR_CONTROL_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from set_actuator_control_target message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field group_mlx from set_actuator_control_target message
|
||||
*
|
||||
* @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from set_actuator_control_target message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 41);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from set_actuator_control_target message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field controls from set_actuator_control_target message
|
||||
*
|
||||
* @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, controls, 8, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a set_actuator_control_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param set_actuator_control_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_set_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_set_actuator_control_target_t* set_actuator_control_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
set_actuator_control_target->time_usec = mavlink_msg_set_actuator_control_target_get_time_usec(msg);
|
||||
mavlink_msg_set_actuator_control_target_get_controls(msg, set_actuator_control_target->controls);
|
||||
set_actuator_control_target->group_mlx = mavlink_msg_set_actuator_control_target_get_group_mlx(msg);
|
||||
set_actuator_control_target->target_system = mavlink_msg_set_actuator_control_target_get_target_system(msg);
|
||||
set_actuator_control_target->target_component = mavlink_msg_set_actuator_control_target_get_target_component(msg);
|
||||
#else
|
||||
memcpy(set_actuator_control_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
}
|
@ -5069,6 +5069,145 @@ static void mavlink_test_scaled_pressure2(uint8_t system_id, uint8_t component_i
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_att_pos_mocap(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_att_pos_mocap_t packet_in = {
|
||||
93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0
|
||||
};
|
||||
mavlink_att_pos_mocap_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.time_usec = packet_in.time_usec;
|
||||
packet1.x = packet_in.x;
|
||||
packet1.y = packet_in.y;
|
||||
packet1.z = packet_in.z;
|
||||
|
||||
mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
|
||||
mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
|
||||
mavlink_msg_att_pos_mocap_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_att_pos_mocap_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_att_pos_mocap_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
|
||||
mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_set_actuator_control_target(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_set_actuator_control_target_t packet_in = {
|
||||
93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3
|
||||
};
|
||||
mavlink_set_actuator_control_target_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.time_usec = packet_in.time_usec;
|
||||
packet1.group_mlx = packet_in.group_mlx;
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
|
||||
mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
|
||||
mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
|
||||
mavlink_msg_set_actuator_control_target_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_set_actuator_control_target_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_set_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
|
||||
mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_actuator_control_target(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_actuator_control_target_t packet_in = {
|
||||
93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125
|
||||
};
|
||||
mavlink_actuator_control_target_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.time_usec = packet_in.time_usec;
|
||||
packet1.group_mlx = packet_in.group_mlx;
|
||||
|
||||
mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_actuator_control_target_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
|
||||
mavlink_msg_actuator_control_target_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
|
||||
mavlink_msg_actuator_control_target_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_actuator_control_target_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.controls );
|
||||
mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
@ -5596,6 +5735,9 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
|
||||
mavlink_test_terrain_check(system_id, component_id, last_msg);
|
||||
mavlink_test_terrain_report(system_id, component_id, last_msg);
|
||||
mavlink_test_scaled_pressure2(system_id, component_id, last_msg);
|
||||
mavlink_test_att_pos_mocap(system_id, component_id, last_msg);
|
||||
mavlink_test_set_actuator_control_target(system_id, component_id, last_msg);
|
||||
mavlink_test_actuator_control_target(system_id, component_id, last_msg);
|
||||
mavlink_test_battery_status(system_id, component_id, last_msg);
|
||||
mavlink_test_autopilot_version(system_id, component_id, last_msg);
|
||||
mavlink_test_v2_extension(system_id, component_id, last_msg);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Wed Feb 11 19:13:01 2015"
|
||||
#define MAVLINK_BUILD_DATE "Wed Feb 11 20:13:39 2015"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user