Commit ce112d3a authored by lm's avatar lm

Prepping merge

parent b303e674
// MESSAGE ATTITUDE_CONTROLLER_OUTPUT PACKING
#define MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT 60
#define MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT_LEN 5
#define MAVLINK_MSG_60_LEN 5
typedef struct __mavlink_attitude_controller_output_t
{
uint8_t enabled; ///< 1: enabled, 0: disabled
int8_t roll; ///< Attitude roll: -128: -100%, 127: +100%
int8_t pitch; ///< Attitude pitch: -128: -100%, 127: +100%
int8_t yaw; ///< Attitude yaw: -128: -100%, 127: +100%
int8_t thrust; ///< Attitude thrust: -128: -100%, 127: +100%
} mavlink_attitude_controller_output_t;
/**
* @brief Pack a attitude_controller_output 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 enabled 1: enabled, 0: disabled
* @param roll Attitude roll: -128: -100%, 127: +100%
* @param pitch Attitude pitch: -128: -100%, 127: +100%
* @param yaw Attitude yaw: -128: -100%, 127: +100%
* @param thrust Attitude thrust: -128: -100%, 127: +100%
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t enabled, int8_t roll, int8_t pitch, int8_t yaw, int8_t thrust)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT;
p->enabled = enabled; // uint8_t:1: enabled, 0: disabled
p->roll = roll; // int8_t:Attitude roll: -128: -100%, 127: +100%
p->pitch = pitch; // int8_t:Attitude pitch: -128: -100%, 127: +100%
p->yaw = yaw; // int8_t:Attitude yaw: -128: -100%, 127: +100%
p->thrust = thrust; // int8_t:Attitude thrust: -128: -100%, 127: +100%
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT_LEN);
}
/**
* @brief Pack a attitude_controller_output message
* @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 was sent over
* @param msg The MAVLink message to compress the data into
* @param enabled 1: enabled, 0: disabled
* @param roll Attitude roll: -128: -100%, 127: +100%
* @param pitch Attitude pitch: -128: -100%, 127: +100%
* @param yaw Attitude yaw: -128: -100%, 127: +100%
* @param thrust Attitude thrust: -128: -100%, 127: +100%
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t enabled, int8_t roll, int8_t pitch, int8_t yaw, int8_t thrust)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT;
p->enabled = enabled; // uint8_t:1: enabled, 0: disabled
p->roll = roll; // int8_t:Attitude roll: -128: -100%, 127: +100%
p->pitch = pitch; // int8_t:Attitude pitch: -128: -100%, 127: +100%
p->yaw = yaw; // int8_t:Attitude yaw: -128: -100%, 127: +100%
p->thrust = thrust; // int8_t:Attitude thrust: -128: -100%, 127: +100%
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT_LEN);
}
/**
* @brief Encode a attitude_controller_output struct into a 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 attitude_controller_output C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_attitude_controller_output_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_controller_output_t* attitude_controller_output)
{
return mavlink_msg_attitude_controller_output_pack(system_id, component_id, msg, attitude_controller_output->enabled, attitude_controller_output->roll, attitude_controller_output->pitch, attitude_controller_output->yaw, attitude_controller_output->thrust);
}
/**
* @brief Send a attitude_controller_output message
* @param chan MAVLink channel to send the message
*
* @param enabled 1: enabled, 0: disabled
* @param roll Attitude roll: -128: -100%, 127: +100%
* @param pitch Attitude pitch: -128: -100%, 127: +100%
* @param yaw Attitude yaw: -128: -100%, 127: +100%
* @param thrust Attitude thrust: -128: -100%, 127: +100%
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_attitude_controller_output_send(mavlink_channel_t chan, uint8_t enabled, int8_t roll, int8_t pitch, int8_t yaw, int8_t thrust)
{
mavlink_header_t hdr;
mavlink_attitude_controller_output_t payload;
uint16_t checksum;
mavlink_attitude_controller_output_t *p = &payload;
p->enabled = enabled; // uint8_t:1: enabled, 0: disabled
p->roll = roll; // int8_t:Attitude roll: -128: -100%, 127: +100%
p->pitch = pitch; // int8_t:Attitude pitch: -128: -100%, 127: +100%
p->yaw = yaw; // int8_t:Attitude yaw: -128: -100%, 127: +100%
p->thrust = thrust; // int8_t:Attitude thrust: -128: -100%, 127: +100%
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT_LEN;
hdr.msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROLLER_OUTPUT;
hdr.sysid = mavlink_system.sysid;
hdr.compid = mavlink_system.compid;
hdr.seq = mavlink_get_channel_status(chan)->current_tx_seq;
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
}
#endif
// MESSAGE ATTITUDE_CONTROLLER_OUTPUT UNPACKING
/**
* @brief Get field enabled from attitude_controller_output message
*
* @return 1: enabled, 0: disabled
*/
static inline uint8_t mavlink_msg_attitude_controller_output_get_enabled(const mavlink_message_t* msg)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
return (uint8_t)(p->enabled);
}
/**
* @brief Get field roll from attitude_controller_output message
*
* @return Attitude roll: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_attitude_controller_output_get_roll(const mavlink_message_t* msg)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
return (int8_t)(p->roll);
}
/**
* @brief Get field pitch from attitude_controller_output message
*
* @return Attitude pitch: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_attitude_controller_output_get_pitch(const mavlink_message_t* msg)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
return (int8_t)(p->pitch);
}
/**
* @brief Get field yaw from attitude_controller_output message
*
* @return Attitude yaw: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_attitude_controller_output_get_yaw(const mavlink_message_t* msg)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
return (int8_t)(p->yaw);
}
/**
* @brief Get field thrust from attitude_controller_output message
*
* @return Attitude thrust: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_attitude_controller_output_get_thrust(const mavlink_message_t* msg)
{
mavlink_attitude_controller_output_t *p = (mavlink_attitude_controller_output_t *)&msg->payload[0];
return (int8_t)(p->thrust);
}
/**
* @brief Decode a attitude_controller_output message into a struct
*
* @param msg The message to decode
* @param attitude_controller_output C-struct to decode the message contents into
*/
static inline void mavlink_msg_attitude_controller_output_decode(const mavlink_message_t* msg, mavlink_attitude_controller_output_t* attitude_controller_output)
{
memcpy( attitude_controller_output, msg->payload, sizeof(mavlink_attitude_controller_output_t));
}
// MESSAGE CMD_ACK PACKING
#define MAVLINK_MSG_ID_CMD_ACK 9
#define MAVLINK_MSG_ID_CMD_ACK_LEN 2
#define MAVLINK_MSG_9_LEN 2
#define MAVLINK_MSG_ID_CMD_ACK_KEY 0x90
#define MAVLINK_MSG_9_KEY 0x90
typedef struct __mavlink_cmd_ack_t
{
uint8_t cmd; ///< The MAV_CMD ID
uint8_t result; ///< 0: Action DENIED, 1: Action executed
} mavlink_cmd_ack_t;
/**
* @brief Pack a cmd_ack 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 cmd The MAV_CMD ID
* @param result 0: Action DENIED, 1: Action executed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cmd_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t cmd, uint8_t result)
{
mavlink_cmd_ack_t *p = (mavlink_cmd_ack_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_CMD_ACK;
p->cmd = cmd; // uint8_t:The MAV_CMD ID
p->result = result; // uint8_t:0: Action DENIED, 1: Action executed
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CMD_ACK_LEN);
}
/**
* @brief Pack a cmd_ack message
* @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 was sent over
* @param msg The MAVLink message to compress the data into
* @param cmd The MAV_CMD ID
* @param result 0: Action DENIED, 1: Action executed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cmd_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t cmd, uint8_t result)
{
mavlink_cmd_ack_t *p = (mavlink_cmd_ack_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_CMD_ACK;
p->cmd = cmd; // uint8_t:The MAV_CMD ID
p->result = result; // uint8_t:0: Action DENIED, 1: Action executed
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CMD_ACK_LEN);
}
/**
* @brief Encode a cmd_ack struct into a 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 cmd_ack C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_cmd_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cmd_ack_t* cmd_ack)
{
return mavlink_msg_cmd_ack_pack(system_id, component_id, msg, cmd_ack->cmd, cmd_ack->result);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a cmd_ack message
* @param chan MAVLink channel to send the message
*
* @param cmd The MAV_CMD ID
* @param result 0: Action DENIED, 1: Action executed
*/
static inline void mavlink_msg_cmd_ack_send(mavlink_channel_t chan, uint8_t cmd, uint8_t result)
{
mavlink_header_t hdr;
mavlink_cmd_ack_t payload;
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_CMD_ACK_LEN )
payload.cmd = cmd; // uint8_t:The MAV_CMD ID
payload.result = result; // uint8_t:0: Action DENIED, 1: Action executed
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_CMD_ACK_LEN;
hdr.msgid = MAVLINK_MSG_ID_CMD_ACK;
hdr.sysid = mavlink_system.sysid;
hdr.compid = mavlink_system.compid;
hdr.seq = mavlink_get_channel_status(chan)->current_tx_seq;
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
mavlink_send_mem(chan, (uint8_t *)&payload, sizeof(payload) );
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x90, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
// MESSAGE CMD_ACK UNPACKING
/**
* @brief Get field cmd from cmd_ack message
*
* @return The MAV_CMD ID
*/
static inline uint8_t mavlink_msg_cmd_ack_get_cmd(const mavlink_message_t* msg)
{
mavlink_cmd_ack_t *p = (mavlink_cmd_ack_t *)&msg->payload[0];
return (uint8_t)(p->cmd);
}
/**
* @brief Get field result from cmd_ack message
*
* @return 0: Action DENIED, 1: Action executed
*/
static inline uint8_t mavlink_msg_cmd_ack_get_result(const mavlink_message_t* msg)
{
mavlink_cmd_ack_t *p = (mavlink_cmd_ack_t *)&msg->payload[0];
return (uint8_t)(p->result);
}
/**
* @brief Decode a cmd_ack message into a struct
*
* @param msg The message to decode
* @param cmd_ack C-struct to decode the message contents into
*/
static inline void mavlink_msg_cmd_ack_decode(const mavlink_message_t* msg, mavlink_cmd_ack_t* cmd_ack)
{
memcpy( cmd_ack, msg->payload, sizeof(mavlink_cmd_ack_t));
}
// MESSAGE POSITION_CONTROLLER_OUTPUT PACKING
#define MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT 61
#define MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT_LEN 5
#define MAVLINK_MSG_61_LEN 5
typedef struct __mavlink_position_controller_output_t
{
uint8_t enabled; ///< 1: enabled, 0: disabled
int8_t x; ///< Position x: -128: -100%, 127: +100%
int8_t y; ///< Position y: -128: -100%, 127: +100%
int8_t z; ///< Position z: -128: -100%, 127: +100%
int8_t yaw; ///< Position yaw: -128: -100%, 127: +100%
} mavlink_position_controller_output_t;
/**
* @brief Pack a position_controller_output 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 enabled 1: enabled, 0: disabled
* @param x Position x: -128: -100%, 127: +100%
* @param y Position y: -128: -100%, 127: +100%
* @param z Position z: -128: -100%, 127: +100%
* @param yaw Position yaw: -128: -100%, 127: +100%
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t enabled, int8_t x, int8_t y, int8_t z, int8_t yaw)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT;
p->enabled = enabled; // uint8_t:1: enabled, 0: disabled
p->x = x; // int8_t:Position x: -128: -100%, 127: +100%
p->y = y; // int8_t:Position y: -128: -100%, 127: +100%
p->z = z; // int8_t:Position z: -128: -100%, 127: +100%
p->yaw = yaw; // int8_t:Position yaw: -128: -100%, 127: +100%
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT_LEN);
}
/**
* @brief Pack a position_controller_output message
* @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 was sent over
* @param msg The MAVLink message to compress the data into
* @param enabled 1: enabled, 0: disabled
* @param x Position x: -128: -100%, 127: +100%
* @param y Position y: -128: -100%, 127: +100%
* @param z Position z: -128: -100%, 127: +100%
* @param yaw Position yaw: -128: -100%, 127: +100%
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t enabled, int8_t x, int8_t y, int8_t z, int8_t yaw)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT;
p->enabled = enabled; // uint8_t:1: enabled, 0: disabled
p->x = x; // int8_t:Position x: -128: -100%, 127: +100%
p->y = y; // int8_t:Position y: -128: -100%, 127: +100%
p->z = z; // int8_t:Position z: -128: -100%, 127: +100%
p->yaw = yaw; // int8_t:Position yaw: -128: -100%, 127: +100%
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT_LEN);
}
/**
* @brief Encode a position_controller_output struct into a 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 position_controller_output C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_position_controller_output_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_controller_output_t* position_controller_output)
{
return mavlink_msg_position_controller_output_pack(system_id, component_id, msg, position_controller_output->enabled, position_controller_output->x, position_controller_output->y, position_controller_output->z, position_controller_output->yaw);
}
/**
* @brief Send a position_controller_output message
* @param chan MAVLink channel to send the message
*
* @param enabled 1: enabled, 0: disabled
* @param x Position x: -128: -100%, 127: +100%
* @param y Position y: -128: -100%, 127: +100%
* @param z Position z: -128: -100%, 127: +100%
* @param yaw Position yaw: -128: -100%, 127: +100%
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_controller_output_send(mavlink_channel_t chan, uint8_t enabled, int8_t x, int8_t y, int8_t z, int8_t yaw)
{
mavlink_header_t hdr;
mavlink_position_controller_output_t payload;
uint16_t checksum;
mavlink_position_controller_output_t *p = &payload;
p->enabled = enabled; // uint8_t:1: enabled, 0: disabled
p->x = x; // int8_t:Position x: -128: -100%, 127: +100%
p->y = y; // int8_t:Position y: -128: -100%, 127: +100%
p->z = z; // int8_t:Position z: -128: -100%, 127: +100%
p->yaw = yaw; // int8_t:Position yaw: -128: -100%, 127: +100%
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT_LEN;
hdr.msgid = MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT;
hdr.sysid = mavlink_system.sysid;
hdr.compid = mavlink_system.compid;
hdr.seq = mavlink_get_channel_status(chan)->current_tx_seq;
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
}
#endif
// MESSAGE POSITION_CONTROLLER_OUTPUT UNPACKING
/**
* @brief Get field enabled from position_controller_output message
*
* @return 1: enabled, 0: disabled
*/
static inline uint8_t mavlink_msg_position_controller_output_get_enabled(const mavlink_message_t* msg)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
return (uint8_t)(p->enabled);
}
/**
* @brief Get field x from position_controller_output message
*
* @return Position x: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_position_controller_output_get_x(const mavlink_message_t* msg)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
return (int8_t)(p->x);
}
/**
* @brief Get field y from position_controller_output message
*
* @return Position y: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_position_controller_output_get_y(const mavlink_message_t* msg)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
return (int8_t)(p->y);
}
/**
* @brief Get field z from position_controller_output message
*
* @return Position z: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_position_controller_output_get_z(const mavlink_message_t* msg)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
return (int8_t)(p->z);
}
/**
* @brief Get field yaw from position_controller_output message
*
* @return Position yaw: -128: -100%, 127: +100%
*/
static inline int8_t mavlink_msg_position_controller_output_get_yaw(const mavlink_message_t* msg)
{
mavlink_position_controller_output_t *p = (mavlink_position_controller_output_t *)&msg->payload[0];
return (int8_t)(p->yaw);
}
/**
* @brief Decode a position_controller_output message into a struct
*
* @param msg The message to decode
* @param position_controller_output C-struct to decode the message contents into
*/
static inline void mavlink_msg_position_controller_output_decode(const mavlink_message_t* msg, mavlink_position_controller_output_t* position_controller_output)
{
memcpy( position_controller_output, msg->payload, sizeof(mavlink_position_controller_output_t));
}
// MESSAGE ROLL_PITCH_YAW_SETPOINT PACKING
#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT 57
#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT_LEN 16
#define MAVLINK_MSG_57_LEN 16
typedef struct __mavlink_roll_pitch_yaw_setpoint_t
{
uint32_t time_ms; ///< Timestamp in milliseconds since system boot
float roll; ///< Desired roll angle in radians
float pitch; ///< Desired pitch angle in radians
float yaw; ///< Desired yaw angle in radians
} mavlink_roll_pitch_yaw_setpoint_t;
/**
* @brief Pack a roll_pitch_yaw_setpoint 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_ms Timestamp in milliseconds since system boot
* @param roll Desired roll angle in radians
* @param pitch Desired pitch angle in radians
* @param yaw Desired yaw angle in radians
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_roll_pitch_yaw_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint32_t time_ms, float roll, float pitch, float yaw)
{
mavlink_roll_pitch_yaw_setpoint_t *p = (mavlink_roll_pitch_yaw_setpoint_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT;
p->time_ms = time_ms; // uint32_t:Timestamp in milliseconds since system boot
p->roll = roll; // float:Desired roll angle in radians
p->pitch = pitch; // float:Desired pitch angle in radians
p->yaw = yaw; // float:Desired yaw angle in radians
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT_LEN);
}
/**
* @brief Pack a roll_pitch_yaw_setpoint message
* @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 was sent over
* @param msg The MAVLink message to compress the data into
* @param time_ms Timestamp in milliseconds since system boot
* @param roll Desired roll angle in radians
* @param pitch Desired pitch angle in radians
* @param yaw Desired yaw angle in radians
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_roll_pitch_yaw_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint32_t time_ms, float roll, float pitch, float yaw)
{
mavlink_roll_pitch_yaw_setpoint_t *p = (mavlink_roll_pitch_yaw_setpoint_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT;
p->time_ms = time_ms; // uint32_t:Timestamp in milliseconds since system boot
p->roll = roll; // float:Desired roll angle in radians
p->pitch = pitch; // float:Desired pitch angle in radians
p->yaw = yaw; // float:Desired yaw angle in radians
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT_LEN);
}
/**
* @brief Encode a roll_pitch_yaw_setpoint struct into a 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 roll_pitch_yaw_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_roll_pitch_yaw_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_setpoint_t* roll_pitch_yaw_setpoint)
{
return mavlink_msg_roll_pitch_yaw_setpoint_pack(system_id, component_id, msg, roll_pitch_yaw_setpoint->time_ms, roll_pitch_yaw_setpoint->roll, roll_pitch_yaw_setpoint->pitch, roll_pitch_yaw_setpoint->yaw);
}
/**
* @brief Send a roll_pitch_yaw_setpoint message
* @param chan MAVLink channel to send the message
*
* @param time_ms Timestamp in milliseconds since system boot
* @param roll Desired roll angle in radians
* @param pitch Desired pitch angle in radians
* @param yaw Desired yaw angle in radians
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_roll_pitch_yaw_setpoint_send(mavlink_channel_t chan, uint32_t time_ms, float roll, float pitch, float yaw)
{
mavlink_header_t hdr;
mavlink_roll_pitch_yaw_setpoint_t payload;
uint16_t checksum;
mavlink_roll_pitch_yaw_setpoint_t *p = &payload;
p->time_ms = time_ms; // uint32_t:Timestamp in milliseconds since system boot
p->roll = roll; // float:Desired roll angle in radians
p->pitch = pitch; // float:Desired pitch angle in radians
p->yaw = yaw; // float:Desired yaw angle in radians
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT_LEN;
hdr.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SETPOINT;
hdr.sysid = mavlink_system.sysid;
hdr.compid = mavlink_system.compid;
hdr.seq = mavlink_get_channel_status(chan)->current_tx_seq;
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
}
#endif
// MESSAGE ROLL_PITCH_YAW_SETPOINT UNPACKING
/**
* @brief Get field time_ms from roll_pitch_yaw_setpoint message
*
* @return Timestamp in milliseconds since system boot
*/
static inline uint32_t mavlink_msg_roll_pitch_yaw_setpoint_get_time_ms(const mavlink_message_t* msg)
{
mavlink_roll_pitch_yaw_setpoint_t *p = (mavlink_roll_pitch_yaw_setpoint_t *)&msg->payload[0];
return (uint32_t)(p->time_ms);
}
/**
* @brief Get field roll from roll_pitch_yaw_setpoint message
*
* @return Desired roll angle in radians
*/
static inline float mavlink_msg_roll_pitch_yaw_setpoint_get_roll(const mavlink_message_t* msg)
{
mavlink_roll_pitch_yaw_setpoint_t *p = (mavlink_roll_pitch_yaw_setpoint_t *)&msg->payload[0];
return (float)(p->roll);
}