updated to latest mavlink 1.0 messages

This commit is contained in:
Andrew Tridgell 2011-10-24 09:47:13 +11:00
parent 2c4c00ece8
commit 0c672d6885
78 changed files with 14966 additions and 927 deletions

View File

@ -12,15 +12,15 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 208, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 208, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"

View File

@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sun Oct 16 13:23:43 2011"
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:38 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101

View File

@ -12,15 +12,15 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"
@ -51,8 +51,8 @@ enum MAV_AUTOPILOT
MAV_AUTOPILOT_SLUGS=2, /* SLUGS autopilot, http://slugsuav.soe.ucsc.edu | */
MAV_AUTOPILOT_ARDUPILOTMEGA=3, /* ArduPilotMega / ArduCopter, http://diydrones.com | */
MAV_AUTOPILOT_OPENPILOT=4, /* OpenPilot, http://openpilot.org | */
MAV_AUTOPILOT_GENERIC_MISSION_MISSIONS_ONLY=5, /* Generic autopilot only supporting simple MISSIONs | */
MAV_AUTOPILOT_GENERIC_MISSION_NAVIGATION_ONLY=6, /* Generic autopilot supporting MISSIONs and other simple navigation commands | */
MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY=5, /* Generic autopilot only supporting simple waypoints | */
MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY=6, /* Generic autopilot supporting waypoints and other simple navigation commands | */
MAV_AUTOPILOT_GENERIC_MISSION_FULL=7, /* Generic autopilot supporting the full mission command set | */
MAV_AUTOPILOT_INVALID=8, /* No valid autopilot, e.g. a GCS or other MAVLink component | */
MAV_AUTOPILOT_PPZ=9, /* PPZ UAV - http://nongnu.org/paparazzi | */
@ -89,6 +89,16 @@ enum MAV_MODE_FLAG_DECODE_POSITION
MAV_MODE_FLAG_DECODE_POSITION_ENUM_END=129, /* | */
};
/** @brief Override command, pauses current mission execution and moves immediately to a position */
enum MAV_GOTO
{
MAV_GOTO_DO_HOLD=0, /* Hold at the current position. | */
MAV_GOTO_DO_CONTINUE=1, /* Continue with the mission execution. | */
MAV_GOTO_HOLD_AT_CURRENT_POSITION=2, /* Hold at the current position of the system | */
MAV_GOTO_HOLD_AT_SPECIFIED_POSITION=3, /* Hold at the position specified in the parameters of the DO_HOLD action | */
MAV_GOTO_ENUM_END=4, /* | */
};
/** @brief These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it
simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. */
enum MAV_MODE
@ -147,6 +157,7 @@ enum MAV_TYPE
/** @brief */
enum MAV_COMPONENT
{
MAV_COMP_ID_ALL=0, /* | */
MAV_COMP_ID_GPS=220, /* | */
MAV_COMP_ID_MISSIONPLANNER=190, /* | */
MAV_COMP_ID_PATHPLANNER=195, /* | */
@ -200,12 +211,12 @@ enum MAVLINK_DATA_STREAM_TYPE
/** @brief Commands to be executed by the MAV. They can be executed on user request,
or as part of a mission script. If the action is used in a mission, the parameter mapping
to the MISSION/mission message is as follows:
to the waypoint/mission message is as follows:
Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what
ARINC 424 is for commercial aircraft: A data format how to interpret MISSION/mission data. */
ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. */
enum MAV_CMD
{
MAV_CMD_NAV_MISSION=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
@ -237,7 +248,9 @@ enum MAV_CMD
MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Empty| Empty| Empty| */
MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */
MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| Reserved| Empty| Empty| Empty| */
MAV_CMD_ENUM_END=246, /* | */
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */
MAV_CMD_OVERRIDE_GOTO=252, /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */
MAV_CMD_ENUM_END=253, /* | */
};
/** @brief Data stream IDs. A data stream is not a fixed set of messages, but rather a
@ -348,6 +361,10 @@ enum MAV_CMD_ACK
#include "./mavlink_msg_hil_controls.h"
#include "./mavlink_msg_hil_rc_inputs_raw.h"
#include "./mavlink_msg_optical_flow.h"
#include "./mavlink_msg_global_vision_position_estimate.h"
#include "./mavlink_msg_vision_position_estimate.h"
#include "./mavlink_msg_vision_speed_estimate.h"
#include "./mavlink_msg_vicon_position_estimate.h"
#include "./mavlink_msg_memory_vect.h"
#include "./mavlink_msg_debug_vect.h"
#include "./mavlink_msg_named_value_float.h"

View File

@ -4,20 +4,20 @@
typedef struct __mavlink_command_ack_t
{
float command; ///< Current airspeed in m/s
float result; ///< 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
uint16_t command; ///< Command ID, as defined by MAV_CMD enum.
uint8_t result; ///< 1: Command ACCEPTED and EXECUTED, 1: Command TEMPORARY REJECTED/DENIED, 2: Command PERMANENTLY DENIED, 3: Command UNKNOWN/UNSUPPORTED, 4: Command executed, but failed
} mavlink_command_ack_t;
#define MAVLINK_MSG_ID_COMMAND_ACK_LEN 8
#define MAVLINK_MSG_ID_77_LEN 8
#define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3
#define MAVLINK_MSG_ID_77_LEN 3
#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
"COMMAND_ACK", \
2, \
{ { "command", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
{ "result", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_ack_t, result) }, \
{ { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
} \
}
@ -28,29 +28,29 @@ typedef struct __mavlink_command_ack_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param command Current airspeed in m/s
* @param result 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
* @param command Command ID, as defined by MAV_CMD enum.
* @param result 1: Command ACCEPTED and EXECUTED, 1: Command TEMPORARY REJECTED/DENIED, 2: Command PERMANENTLY DENIED, 3: Command UNKNOWN/UNSUPPORTED, 4: Command executed, but failed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float command, float result)
uint16_t command, uint8_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_float(buf, 0, command);
_mav_put_float(buf, 4, result);
char buf[3];
_mav_put_uint16_t(buf, 0, command);
_mav_put_uint8_t(buf, 2, result);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
return mavlink_finalize_message(msg, system_id, component_id, 8, 8);
return mavlink_finalize_message(msg, system_id, component_id, 3, 143);
}
/**
@ -59,30 +59,30 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c
* @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 command Current airspeed in m/s
* @param result 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
* @param command Command ID, as defined by MAV_CMD enum.
* @param result 1: Command ACCEPTED and EXECUTED, 1: Command TEMPORARY REJECTED/DENIED, 2: Command PERMANENTLY DENIED, 3: Command UNKNOWN/UNSUPPORTED, 4: Command executed, but failed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float command,float result)
uint16_t command,uint8_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_float(buf, 0, command);
_mav_put_float(buf, 4, result);
char buf[3];
_mav_put_uint16_t(buf, 0, command);
_mav_put_uint8_t(buf, 2, result);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 8);
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 143);
}
/**
@ -102,25 +102,25 @@ static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t
* @brief Send a command_ack message
* @param chan MAVLink channel to send the message
*
* @param command Current airspeed in m/s
* @param result 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
* @param command Command ID, as defined by MAV_CMD enum.
* @param result 1: Command ACCEPTED and EXECUTED, 1: Command TEMPORARY REJECTED/DENIED, 2: Command PERMANENTLY DENIED, 3: Command UNKNOWN/UNSUPPORTED, 4: Command executed, but failed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, float command, float result)
static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_float(buf, 0, command);
_mav_put_float(buf, 4, result);
char buf[3];
_mav_put_uint16_t(buf, 0, command);
_mav_put_uint8_t(buf, 2, result);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, 8, 8);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, 3, 143);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, 8, 8);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, 3, 143);
#endif
}
@ -132,21 +132,21 @@ static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, float co
/**
* @brief Get field command from command_ack message
*
* @return Current airspeed in m/s
* @return Command ID, as defined by MAV_CMD enum.
*/
static inline float mavlink_msg_command_ack_get_command(const mavlink_message_t* msg)
static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field result from command_ack message
*
* @return 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
* @return 1: Command ACCEPTED and EXECUTED, 1: Command TEMPORARY REJECTED/DENIED, 2: Command PERMANENTLY DENIED, 3: Command UNKNOWN/UNSUPPORTED, 4: Command executed, but failed
*/
static inline float mavlink_msg_command_ack_get_result(const mavlink_message_t* msg)
static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
@ -161,6 +161,6 @@ static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg,
command_ack->command = mavlink_msg_command_ack_get_command(msg);
command_ack->result = mavlink_msg_command_ack_get_result(msg);
#else
memcpy(command_ack, _MAV_PAYLOAD(msg), 8);
memcpy(command_ack, _MAV_PAYLOAD(msg), 3);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE PACKING
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101
typedef struct __mavlink_global_vision_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_global_vision_position_estimate_t;
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_ID_101_LEN 32
#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
"GLOBAL_VISION_POSITION_ESTIMATE", \
7, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
} \
}
/**
* @brief Pack a global_vision_position_estimate 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 usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_global_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 32, 102);
}
/**
* @brief Pack a global_vision_position_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_global_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 102);
}
/**
* @brief Encode a global_vision_position_estimate 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 global_vision_position_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
{
return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
}
/**
* @brief Send a global_vision_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, 32, 102);
#else
mavlink_global_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, 32, 102);
#endif
}
#endif
// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE UNPACKING
/**
* @brief Get field usec from global_vision_position_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from global_vision_position_estimate message
*
* @return Global X position
*/
static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from global_vision_position_estimate message
*
* @return Global Y position
*/
static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from global_vision_position_estimate message
*
* @return Global Z position
*/
static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field roll from global_vision_position_estimate message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field pitch from global_vision_position_estimate message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field yaw from global_vision_position_estimate message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a global_vision_position_estimate message into a struct
*
* @param msg The message to decode
* @param global_vision_position_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_global_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg);
global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg);
global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg);
global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg);
global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg);
global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg);
global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg);
#else
memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), 32);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE VICON_POSITION_ESTIMATE PACKING
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 104
typedef struct __mavlink_vicon_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_vicon_position_estimate_t;
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_ID_104_LEN 32
#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \
"VICON_POSITION_ESTIMATE", \
7, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) }, \
} \
}
/**
* @brief Pack a vicon_position_estimate 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 usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 32, 56);
}
/**
* @brief Pack a vicon_position_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 56);
}
/**
* @brief Encode a vicon_position_estimate 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 vicon_position_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
{
return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw);
}
/**
* @brief Send a vicon_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, 32, 56);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, 32, 56);
#endif
}
#endif
// MESSAGE VICON_POSITION_ESTIMATE UNPACKING
/**
* @brief Get field usec from vicon_position_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from vicon_position_estimate message
*
* @return Global X position
*/
static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from vicon_position_estimate message
*
* @return Global Y position
*/
static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from vicon_position_estimate message
*
* @return Global Z position
*/
static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field roll from vicon_position_estimate message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field pitch from vicon_position_estimate message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field yaw from vicon_position_estimate message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a vicon_position_estimate message into a struct
*
* @param msg The message to decode
* @param vicon_position_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_vicon_position_estimate_decode(const mavlink_message_t* msg, mavlink_vicon_position_estimate_t* vicon_position_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
vicon_position_estimate->usec = mavlink_msg_vicon_position_estimate_get_usec(msg);
vicon_position_estimate->x = mavlink_msg_vicon_position_estimate_get_x(msg);
vicon_position_estimate->y = mavlink_msg_vicon_position_estimate_get_y(msg);
vicon_position_estimate->z = mavlink_msg_vicon_position_estimate_get_z(msg);
vicon_position_estimate->roll = mavlink_msg_vicon_position_estimate_get_roll(msg);
vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg);
vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg);
#else
memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), 32);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE VISION_POSITION_ESTIMATE PACKING
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 102
typedef struct __mavlink_vision_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_vision_position_estimate_t;
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_ID_102_LEN 32
#define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \
"VISION_POSITION_ESTIMATE", \
7, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
} \
}
/**
* @brief Pack a vision_position_estimate 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 usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 32, 158);
}
/**
* @brief Pack a vision_position_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 158);
}
/**
* @brief Encode a vision_position_estimate 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 vision_position_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
{
return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw);
}
/**
* @brief Send a vision_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, 32, 158);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, 32, 158);
#endif
}
#endif
// MESSAGE VISION_POSITION_ESTIMATE UNPACKING
/**
* @brief Get field usec from vision_position_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from vision_position_estimate message
*
* @return Global X position
*/
static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from vision_position_estimate message
*
* @return Global Y position
*/
static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from vision_position_estimate message
*
* @return Global Z position
*/
static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field roll from vision_position_estimate message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field pitch from vision_position_estimate message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field yaw from vision_position_estimate message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a vision_position_estimate message into a struct
*
* @param msg The message to decode
* @param vision_position_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_vision_position_estimate_t* vision_position_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
vision_position_estimate->usec = mavlink_msg_vision_position_estimate_get_usec(msg);
vision_position_estimate->x = mavlink_msg_vision_position_estimate_get_x(msg);
vision_position_estimate->y = mavlink_msg_vision_position_estimate_get_y(msg);
vision_position_estimate->z = mavlink_msg_vision_position_estimate_get_z(msg);
vision_position_estimate->roll = mavlink_msg_vision_position_estimate_get_roll(msg);
vision_position_estimate->pitch = mavlink_msg_vision_position_estimate_get_pitch(msg);
vision_position_estimate->yaw = mavlink_msg_vision_position_estimate_get_yaw(msg);
#else
memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), 32);
#endif
}

View File

@ -0,0 +1,210 @@
// MESSAGE VISION_SPEED_ESTIMATE PACKING
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103
typedef struct __mavlink_vision_speed_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X speed
float y; ///< Global Y speed
float z; ///< Global Z speed
} mavlink_vision_speed_estimate_t;
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20
#define MAVLINK_MSG_ID_103_LEN 20
#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
"VISION_SPEED_ESTIMATE", \
4, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \
} \
}
/**
* @brief Pack a vision_speed_estimate 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 usec Timestamp (milliseconds)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 20, 208);
}
/**
* @brief Pack a vision_speed_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 208);
}
/**
* @brief Encode a vision_speed_estimate 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 vision_speed_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
{
return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z);
}
/**
* @brief Send a vision_speed_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, 20, 208);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, 20, 208);
#endif
}
#endif
// MESSAGE VISION_SPEED_ESTIMATE UNPACKING
/**
* @brief Get field usec from vision_speed_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from vision_speed_estimate message
*
* @return Global X speed
*/
static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from vision_speed_estimate message
*
* @return Global Y speed
*/
static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from vision_speed_estimate message
*
* @return Global Z speed
*/
static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Decode a vision_speed_estimate message into a struct
*
* @param msg The message to decode
* @param vision_speed_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_message_t* msg, mavlink_vision_speed_estimate_t* vision_speed_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
vision_speed_estimate->usec = mavlink_msg_vision_speed_estimate_get_usec(msg);
vision_speed_estimate->x = mavlink_msg_vision_speed_estimate_get_x(msg);
vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg);
vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg);
#else
memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), 20);
#endif
}

View File

@ -2941,8 +2941,8 @@ static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, ma
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_command_ack_t packet_in = {
17.0,
45.0,
17235,
139,
};
mavlink_command_ack_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
@ -3238,6 +3238,220 @@ static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, m
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_global_vision_position_estimate(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_vision_position_estimate_t packet_in = {
93372036854775807ULL,
73.0,
101.0,
129.0,
157.0,
185.0,
213.0,
};
mavlink_global_vision_position_estimate_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.usec = packet_in.usec;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_global_vision_position_estimate_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_vision_position_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_vision_position_estimate(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_vision_position_estimate_t packet_in = {
93372036854775807ULL,
73.0,
101.0,
129.0,
157.0,
185.0,
213.0,
};
mavlink_vision_position_estimate_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.usec = packet_in.usec;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_vision_position_estimate_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_vision_position_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_vision_speed_estimate(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_vision_speed_estimate_t packet_in = {
93372036854775807ULL,
73.0,
101.0,
129.0,
};
mavlink_vision_speed_estimate_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.usec = packet_in.usec;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
mavlink_msg_vision_speed_estimate_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_vision_speed_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z );
mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_vicon_position_estimate(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_vicon_position_estimate_t packet_in = {
93372036854775807ULL,
73.0,
101.0,
129.0,
157.0,
185.0,
213.0,
};
mavlink_vicon_position_estimate_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.usec = packet_in.usec;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_vicon_position_estimate_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_vicon_position_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
@ -3633,6 +3847,10 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_hil_controls(system_id, component_id, last_msg);
mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
mavlink_test_optical_flow(system_id, component_id, last_msg);
mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
mavlink_test_memory_vect(system_id, component_id, last_msg);
mavlink_test_debug_vect(system_id, component_id, last_msg);
mavlink_test_named_value_float(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 Oct 16 13:23:44 2011"
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:40 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101

View File

@ -214,7 +214,13 @@ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messa
break;
case MAVLINK_PARSE_STATE_GOT_STX:
if (status->msg_received || c > MAVLINK_MAX_PAYLOAD_LEN)
if (status->msg_received
/* Support shorter buffers than the
default maximum packet size */
#if (MAVLINK_MAX_PAYLOAD_LEN < 255)
|| c > MAVLINK_MAX_PAYLOAD_LEN
#endif
)
{
status->buffer_overrun++;
status->parse_error++;

View File

@ -0,0 +1,27 @@
/** @file
* @brief MAVLink comm protocol built from minimal.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "minimal.h"
#endif // MAVLINK_H

View File

@ -0,0 +1,251 @@
// MESSAGE HEARTBEAT PACKING
#define MAVLINK_MSG_ID_HEARTBEAT 0
typedef struct __mavlink_heartbeat_t
{
uint32_t custom_mode; ///< Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
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_CLASS ENUM
uint8_t base_mode; ///< System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
uint8_t system_status; ///< System status flag, see MAV_STATUS ENUM
uint8_t mavlink_version; ///< MAVLink version
} mavlink_heartbeat_t;
#define MAVLINK_MSG_ID_HEARTBEAT_LEN 9
#define MAVLINK_MSG_ID_0_LEN 9
#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
"HEARTBEAT", \
6, \
{ { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
{ "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
{ "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
{ "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
{ "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
} \
}
/**
* @brief Pack a heartbeat 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 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_CLASS ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @param system_status System status flag, see MAV_STATUS ENUM
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint32_t(buf, 0, custom_mode);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 5, autopilot);
_mav_put_uint8_t(buf, 6, base_mode);
_mav_put_uint8_t(buf, 7, system_status);
_mav_put_uint8_t(buf, 8, 2);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
#else
mavlink_heartbeat_t packet;
packet.custom_mode = custom_mode;
packet.type = type;
packet.autopilot = autopilot;
packet.base_mode = base_mode;
packet.system_status = system_status;
packet.mavlink_version = 2;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
return mavlink_finalize_message(msg, system_id, component_id, 9, 50);
}
/**
* @brief Pack a heartbeat 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 was sent over
* @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_CLASS ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @param system_status System status flag, see MAV_STATUS ENUM
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint32_t(buf, 0, custom_mode);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 5, autopilot);
_mav_put_uint8_t(buf, 6, base_mode);
_mav_put_uint8_t(buf, 7, system_status);
_mav_put_uint8_t(buf, 8, 2);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
#else
mavlink_heartbeat_t packet;
packet.custom_mode = custom_mode;
packet.type = type;
packet.autopilot = autopilot;
packet.base_mode = base_mode;
packet.system_status = system_status;
packet.mavlink_version = 2;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 50);
}
/**
* @brief Encode a heartbeat 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 heartbeat C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
{
return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
}
/**
* @brief Send a heartbeat message
* @param chan MAVLink channel to send the message
*
* @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_CLASS ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @param system_status System status flag, see MAV_STATUS ENUM
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint32_t(buf, 0, custom_mode);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 5, autopilot);
_mav_put_uint8_t(buf, 6, base_mode);
_mav_put_uint8_t(buf, 7, system_status);
_mav_put_uint8_t(buf, 8, 2);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, 9, 50);
#else
mavlink_heartbeat_t packet;
packet.custom_mode = custom_mode;
packet.type = type;
packet.autopilot = autopilot;
packet.base_mode = base_mode;
packet.system_status = system_status;
packet.mavlink_version = 2;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, 9, 50);
#endif
}
#endif
// MESSAGE HEARTBEAT UNPACKING
/**
* @brief Get field type from heartbeat message
*
* @return Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
*/
static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field autopilot from heartbeat message
*
* @return Autopilot type / class. defined in MAV_CLASS ENUM
*/
static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Get field base_mode from heartbeat message
*
* @return System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
*/
static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 6);
}
/**
* @brief Get field custom_mode from heartbeat message
*
* @return Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
*/
static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field system_status from heartbeat message
*
* @return System status flag, see MAV_STATUS ENUM
*/
static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 7);
}
/**
* @brief Get field mavlink_version from heartbeat message
*
* @return MAVLink version
*/
static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Decode a heartbeat message into a struct
*
* @param msg The message to decode
* @param heartbeat C-struct to decode the message contents into
*/
static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat)
{
#if MAVLINK_NEED_BYTE_SWAP
heartbeat->custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg);
heartbeat->type = mavlink_msg_heartbeat_get_type(msg);
heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg);
heartbeat->base_mode = mavlink_msg_heartbeat_get_base_mode(msg);
heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg);
heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg);
#else
memcpy(heartbeat, _MAV_PAYLOAD(msg), 9);
#endif
}

View File

@ -0,0 +1,53 @@
/** @file
* @brief MAVLink comm protocol generated from minimal.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef MINIMAL_H
#define MINIMAL_H
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_MINIMAL
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
// ENUM DEFINITIONS
// MESSAGE DEFINITIONS
#include "./mavlink_msg_heartbeat.h"
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // MINIMAL_H

View File

@ -0,0 +1,88 @@
/** @file
* @brief MAVLink comm protocol testsuite generated from minimal.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef MINIMAL_TESTSUITE_H
#define MINIMAL_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_minimal(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_minimal(system_id, component_id, last_msg);
}
#endif
static void mavlink_test_heartbeat(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_heartbeat_t packet_in = {
963497464,
17,
84,
151,
218,
2,
};
mavlink_heartbeat_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.custom_mode = packet_in.custom_mode;
packet1.type = packet_in.type;
packet1.autopilot = packet_in.autopilot;
packet1.base_mode = packet_in.base_mode;
packet1.system_status = packet_in.system_status;
packet1.mavlink_version = packet_in.mavlink_version;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_heartbeat_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_heartbeat_pack(system_id, component_id, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
mavlink_msg_heartbeat_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
mavlink_msg_heartbeat_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_heartbeat_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_heartbeat_send(MAVLINK_COMM_1 , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
mavlink_msg_heartbeat_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_minimal(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_heartbeat(system_id, component_id, last_msg);
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // MINIMAL_TESTSUITE_H

View File

@ -0,0 +1,12 @@
/** @file
* @brief MAVLink comm protocol built from minimal.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:39 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 9
#endif // MAVLINK_VERSION_H

View File

@ -0,0 +1,27 @@
/** @file
* @brief MAVLink comm protocol built from pixhawk.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "pixhawk.h"
#endif // MAVLINK_H

View File

@ -0,0 +1,320 @@
// MESSAGE ATTITUDE_CONTROL PACKING
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL 200
typedef struct __mavlink_attitude_control_t
{
float roll; ///< roll
float pitch; ///< pitch
float yaw; ///< yaw
float thrust; ///< thrust
uint8_t target; ///< The system to be controlled
uint8_t roll_manual; ///< roll control enabled auto:0, manual:1
uint8_t pitch_manual; ///< pitch auto:0, manual:1
uint8_t yaw_manual; ///< yaw auto:0, manual:1
uint8_t thrust_manual; ///< thrust auto:0, manual:1
} mavlink_attitude_control_t;
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN 21
#define MAVLINK_MSG_ID_200_LEN 21
#define MAVLINK_MESSAGE_INFO_ATTITUDE_CONTROL { \
"ATTITUDE_CONTROL", \
9, \
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_attitude_control_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_control_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_control_t, yaw) }, \
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_control_t, thrust) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_attitude_control_t, target) }, \
{ "roll_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_attitude_control_t, roll_manual) }, \
{ "pitch_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_attitude_control_t, pitch_manual) }, \
{ "yaw_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_attitude_control_t, yaw_manual) }, \
{ "thrust_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_attitude_control_t, thrust_manual) }, \
} \
}
/**
* @brief Pack a attitude_control message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
memcpy(_MAV_PAYLOAD(msg), buf, 21);
#else
mavlink_attitude_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROL;
return mavlink_finalize_message(msg, system_id, component_id, 21, 254);
}
/**
* @brief Pack a attitude_control message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,float roll,float pitch,float yaw,float thrust,uint8_t roll_manual,uint8_t pitch_manual,uint8_t yaw_manual,uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
memcpy(_MAV_PAYLOAD(msg), buf, 21);
#else
mavlink_attitude_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROL;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21, 254);
}
/**
* @brief Encode a attitude_control 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_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_attitude_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_control_t* attitude_control)
{
return mavlink_msg_attitude_control_pack(system_id, component_id, msg, attitude_control->target, attitude_control->roll, attitude_control->pitch, attitude_control->yaw, attitude_control->thrust, attitude_control->roll_manual, attitude_control->pitch_manual, attitude_control->yaw_manual, attitude_control->thrust_manual);
}
/**
* @brief Send a attitude_control message
* @param chan MAVLink channel to send the message
*
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_attitude_control_send(mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, buf, 21, 254);
#else
mavlink_attitude_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, (const char *)&packet, 21, 254);
#endif
}
#endif
// MESSAGE ATTITUDE_CONTROL UNPACKING
/**
* @brief Get field target from attitude_control message
*
* @return The system to be controlled
*/
static inline uint8_t mavlink_msg_attitude_control_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field roll from attitude_control message
*
* @return roll
*/
static inline float mavlink_msg_attitude_control_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field pitch from attitude_control message
*
* @return pitch
*/
static inline float mavlink_msg_attitude_control_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field yaw from attitude_control message
*
* @return yaw
*/
static inline float mavlink_msg_attitude_control_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field thrust from attitude_control message
*
* @return thrust
*/
static inline float mavlink_msg_attitude_control_get_thrust(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field roll_manual from attitude_control message
*
* @return roll control enabled auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_roll_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
* @brief Get field pitch_manual from attitude_control message
*
* @return pitch auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_pitch_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 18);
}
/**
* @brief Get field yaw_manual from attitude_control message
*
* @return yaw auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_yaw_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 19);
}
/**
* @brief Get field thrust_manual from attitude_control message
*
* @return thrust auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_thrust_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 20);
}
/**
* @brief Decode a attitude_control message into a struct
*
* @param msg The message to decode
* @param attitude_control C-struct to decode the message contents into
*/
static inline void mavlink_msg_attitude_control_decode(const mavlink_message_t* msg, mavlink_attitude_control_t* attitude_control)
{
#if MAVLINK_NEED_BYTE_SWAP
attitude_control->roll = mavlink_msg_attitude_control_get_roll(msg);
attitude_control->pitch = mavlink_msg_attitude_control_get_pitch(msg);
attitude_control->yaw = mavlink_msg_attitude_control_get_yaw(msg);
attitude_control->thrust = mavlink_msg_attitude_control_get_thrust(msg);
attitude_control->target = mavlink_msg_attitude_control_get_target(msg);
attitude_control->roll_manual = mavlink_msg_attitude_control_get_roll_manual(msg);
attitude_control->pitch_manual = mavlink_msg_attitude_control_get_pitch_manual(msg);
attitude_control->yaw_manual = mavlink_msg_attitude_control_get_yaw_manual(msg);
attitude_control->thrust_manual = mavlink_msg_attitude_control_get_thrust_manual(msg);
#else
memcpy(attitude_control, _MAV_PAYLOAD(msg), 21);
#endif
}

View File

@ -0,0 +1,292 @@
// MESSAGE BRIEF_FEATURE PACKING
#define MAVLINK_MSG_ID_BRIEF_FEATURE 195
typedef struct __mavlink_brief_feature_t
{
float x; ///< x position in m
float y; ///< y position in m
float z; ///< z position in m
float response; ///< Harris operator response at this location
uint16_t size; ///< Size in pixels
uint16_t orientation; ///< Orientation
uint8_t orientation_assignment; ///< Orientation assignment 0: false, 1:true
uint8_t descriptor[32]; ///< Descriptor
} mavlink_brief_feature_t;
#define MAVLINK_MSG_ID_BRIEF_FEATURE_LEN 53
#define MAVLINK_MSG_ID_195_LEN 53
#define MAVLINK_MSG_BRIEF_FEATURE_FIELD_DESCRIPTOR_LEN 32
#define MAVLINK_MESSAGE_INFO_BRIEF_FEATURE { \
"BRIEF_FEATURE", \
8, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_brief_feature_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_brief_feature_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_brief_feature_t, z) }, \
{ "response", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_brief_feature_t, response) }, \
{ "size", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_brief_feature_t, size) }, \
{ "orientation", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_brief_feature_t, orientation) }, \
{ "orientation_assignment", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_brief_feature_t, orientation_assignment) }, \
{ "descriptor", NULL, MAVLINK_TYPE_UINT8_T, 32, 21, offsetof(mavlink_brief_feature_t, descriptor) }, \
} \
}
/**
* @brief Pack a brief_feature 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 x x position in m
* @param y y position in m
* @param z z position in m
* @param orientation_assignment Orientation assignment 0: false, 1:true
* @param size Size in pixels
* @param orientation Orientation
* @param descriptor Descriptor
* @param response Harris operator response at this location
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_brief_feature_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[53];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 53);
#else
mavlink_brief_feature_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.response = response;
packet.size = size;
packet.orientation = orientation;
packet.orientation_assignment = orientation_assignment;
memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 53);
#endif
msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
return mavlink_finalize_message(msg, system_id, component_id, 53, 88);
}
/**
* @brief Pack a brief_feature 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param x x position in m
* @param y y position in m
* @param z z position in m
* @param orientation_assignment Orientation assignment 0: false, 1:true
* @param size Size in pixels
* @param orientation Orientation
* @param descriptor Descriptor
* @param response Harris operator response at this location
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_brief_feature_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float x,float y,float z,uint8_t orientation_assignment,uint16_t size,uint16_t orientation,const uint8_t *descriptor,float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[53];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 53);
#else
mavlink_brief_feature_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.response = response;
packet.size = size;
packet.orientation = orientation;
packet.orientation_assignment = orientation_assignment;
memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 53);
#endif
msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 53, 88);
}
/**
* @brief Encode a brief_feature 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 brief_feature C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_brief_feature_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_brief_feature_t* brief_feature)
{
return mavlink_msg_brief_feature_pack(system_id, component_id, msg, brief_feature->x, brief_feature->y, brief_feature->z, brief_feature->orientation_assignment, brief_feature->size, brief_feature->orientation, brief_feature->descriptor, brief_feature->response);
}
/**
* @brief Send a brief_feature message
* @param chan MAVLink channel to send the message
*
* @param x x position in m
* @param y y position in m
* @param z z position in m
* @param orientation_assignment Orientation assignment 0: false, 1:true
* @param size Size in pixels
* @param orientation Orientation
* @param descriptor Descriptor
* @param response Harris operator response at this location
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_brief_feature_send(mavlink_channel_t chan, float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[53];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, 53, 88);
#else
mavlink_brief_feature_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.response = response;
packet.size = size;
packet.orientation = orientation;
packet.orientation_assignment = orientation_assignment;
memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)&packet, 53, 88);
#endif
}
#endif
// MESSAGE BRIEF_FEATURE UNPACKING
/**
* @brief Get field x from brief_feature message
*
* @return x position in m
*/
static inline float mavlink_msg_brief_feature_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from brief_feature message
*
* @return y position in m
*/
static inline float mavlink_msg_brief_feature_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from brief_feature message
*
* @return z position in m
*/
static inline float mavlink_msg_brief_feature_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field orientation_assignment from brief_feature message
*
* @return Orientation assignment 0: false, 1:true
*/
static inline uint8_t mavlink_msg_brief_feature_get_orientation_assignment(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 20);
}
/**
* @brief Get field size from brief_feature message
*
* @return Size in pixels
*/
static inline uint16_t mavlink_msg_brief_feature_get_size(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
}
/**
* @brief Get field orientation from brief_feature message
*
* @return Orientation
*/
static inline uint16_t mavlink_msg_brief_feature_get_orientation(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 18);
}
/**
* @brief Get field descriptor from brief_feature message
*
* @return Descriptor
*/
static inline uint16_t mavlink_msg_brief_feature_get_descriptor(const mavlink_message_t* msg, uint8_t *descriptor)
{
return _MAV_RETURN_uint8_t_array(msg, descriptor, 32, 21);
}
/**
* @brief Get field response from brief_feature message
*
* @return Harris operator response at this location
*/
static inline float mavlink_msg_brief_feature_get_response(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a brief_feature message into a struct
*
* @param msg The message to decode
* @param brief_feature C-struct to decode the message contents into
*/
static inline void mavlink_msg_brief_feature_decode(const mavlink_message_t* msg, mavlink_brief_feature_t* brief_feature)
{
#if MAVLINK_NEED_BYTE_SWAP
brief_feature->x = mavlink_msg_brief_feature_get_x(msg);
brief_feature->y = mavlink_msg_brief_feature_get_y(msg);
brief_feature->z = mavlink_msg_brief_feature_get_z(msg);
brief_feature->response = mavlink_msg_brief_feature_get_response(msg);
brief_feature->size = mavlink_msg_brief_feature_get_size(msg);
brief_feature->orientation = mavlink_msg_brief_feature_get_orientation(msg);
brief_feature->orientation_assignment = mavlink_msg_brief_feature_get_orientation_assignment(msg);
mavlink_msg_brief_feature_get_descriptor(msg, brief_feature->descriptor);
#else
memcpy(brief_feature, _MAV_PAYLOAD(msg), 53);
#endif
}

View File

@ -0,0 +1,232 @@
// MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 193
typedef struct __mavlink_data_transmission_handshake_t
{
uint32_t size; ///< total data size in bytes (set on ACK only)
uint8_t type; ///< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
uint8_t packets; ///< number of packets beeing sent (set on ACK only)
uint8_t payload; ///< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
uint8_t jpg_quality; ///< JPEG quality out of [1,100]
} mavlink_data_transmission_handshake_t;
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 8
#define MAVLINK_MSG_ID_193_LEN 8
#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
"DATA_TRANSMISSION_HANDSHAKE", \
5, \
{ { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, type) }, \
{ "packets", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
{ "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
} \
}
/**
* @brief Pack a data_transmission_handshake 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 type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
* @param size total data size in bytes (set on ACK only)
* @param packets number of packets beeing sent (set on ACK only)
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
* @param jpg_quality JPEG quality out of [1,100]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, uint32_t size, uint8_t packets, uint8_t payload, uint8_t jpg_quality)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint32_t(buf, 0, size);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 5, packets);
_mav_put_uint8_t(buf, 6, payload);
_mav_put_uint8_t(buf, 7, jpg_quality);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
#else
mavlink_data_transmission_handshake_t packet;
packet.size = size;
packet.type = type;
packet.packets = packets;
packet.payload = payload;
packet.jpg_quality = jpg_quality;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
return mavlink_finalize_message(msg, system_id, component_id, 8, 148);
}
/**
* @brief Pack a data_transmission_handshake 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
* @param size total data size in bytes (set on ACK only)
* @param packets number of packets beeing sent (set on ACK only)
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
* @param jpg_quality JPEG quality out of [1,100]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,uint32_t size,uint8_t packets,uint8_t payload,uint8_t jpg_quality)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint32_t(buf, 0, size);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 5, packets);
_mav_put_uint8_t(buf, 6, payload);
_mav_put_uint8_t(buf, 7, jpg_quality);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
#else
mavlink_data_transmission_handshake_t packet;
packet.size = size;
packet.type = type;
packet.packets = packets;
packet.payload = payload;
packet.jpg_quality = jpg_quality;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 148);
}
/**
* @brief Encode a data_transmission_handshake 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 data_transmission_handshake C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
{
return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
}
/**
* @brief Send a data_transmission_handshake message
* @param chan MAVLink channel to send the message
*
* @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
* @param size total data size in bytes (set on ACK only)
* @param packets number of packets beeing sent (set on ACK only)
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
* @param jpg_quality JPEG quality out of [1,100]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint8_t packets, uint8_t payload, uint8_t jpg_quality)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint32_t(buf, 0, size);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 5, packets);
_mav_put_uint8_t(buf, 6, payload);
_mav_put_uint8_t(buf, 7, jpg_quality);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, 8, 148);
#else
mavlink_data_transmission_handshake_t packet;
packet.size = size;
packet.type = type;
packet.packets = packets;
packet.payload = payload;
packet.jpg_quality = jpg_quality;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, 8, 148);
#endif
}
#endif
// MESSAGE DATA_TRANSMISSION_HANDSHAKE UNPACKING
/**
* @brief Get field type from data_transmission_handshake message
*
* @return type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
*/
static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field size from data_transmission_handshake message
*
* @return total data size in bytes (set on ACK only)
*/
static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field packets from data_transmission_handshake message
*
* @return number of packets beeing sent (set on ACK only)
*/
static inline uint8_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Get field payload from data_transmission_handshake message
*
* @return payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
*/
static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 6);
}
/**
* @brief Get field jpg_quality from data_transmission_handshake message
*
* @return JPEG quality out of [1,100]
*/
static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 7);
}
/**
* @brief Decode a data_transmission_handshake message into a struct
*
* @param msg The message to decode
* @param data_transmission_handshake C-struct to decode the message contents into
*/
static inline void mavlink_msg_data_transmission_handshake_decode(const mavlink_message_t* msg, mavlink_data_transmission_handshake_t* data_transmission_handshake)
{
#if MAVLINK_NEED_BYTE_SWAP
data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg);
data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg);
data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg);
data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg);
data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg);
#else
memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), 8);
#endif
}

View File

@ -0,0 +1,160 @@
// MESSAGE ENCAPSULATED_DATA PACKING
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA 194
typedef struct __mavlink_encapsulated_data_t
{
uint16_t seqnr; ///< sequence number (starting with 0 on every transmission)
uint8_t data[253]; ///< image data bytes
} mavlink_encapsulated_data_t;
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255
#define MAVLINK_MSG_ID_194_LEN 255
#define MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_DATA_LEN 253
#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
"ENCAPSULATED_DATA", \
2, \
{ { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
} \
}
/**
* @brief Pack a encapsulated_data 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 seqnr sequence number (starting with 0 on every transmission)
* @param data image data bytes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t seqnr, const uint8_t *data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[255];
_mav_put_uint16_t(buf, 0, seqnr);
_mav_put_uint8_t_array(buf, 2, data, 253);
memcpy(_MAV_PAYLOAD(msg), buf, 255);
#else
mavlink_encapsulated_data_t packet;
packet.seqnr = seqnr;
memcpy(packet.data, data, sizeof(uint8_t)*253);
memcpy(_MAV_PAYLOAD(msg), &packet, 255);
#endif
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
return mavlink_finalize_message(msg, system_id, component_id, 255, 223);
}
/**
* @brief Pack a encapsulated_data 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param seqnr sequence number (starting with 0 on every transmission)
* @param data image data bytes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t seqnr,const uint8_t *data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[255];
_mav_put_uint16_t(buf, 0, seqnr);
_mav_put_uint8_t_array(buf, 2, data, 253);
memcpy(_MAV_PAYLOAD(msg), buf, 255);
#else
mavlink_encapsulated_data_t packet;
packet.seqnr = seqnr;
memcpy(packet.data, data, sizeof(uint8_t)*253);
memcpy(_MAV_PAYLOAD(msg), &packet, 255);
#endif
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 255, 223);
}
/**
* @brief Encode a encapsulated_data 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 encapsulated_data C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
{
return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data);
}
/**
* @brief Send a encapsulated_data message
* @param chan MAVLink channel to send the message
*
* @param seqnr sequence number (starting with 0 on every transmission)
* @param data image data bytes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[255];
_mav_put_uint16_t(buf, 0, seqnr);
_mav_put_uint8_t_array(buf, 2, data, 253);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, 255, 223);
#else
mavlink_encapsulated_data_t packet;
packet.seqnr = seqnr;
memcpy(packet.data, data, sizeof(uint8_t)*253);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, 255, 223);
#endif
}
#endif
// MESSAGE ENCAPSULATED_DATA UNPACKING
/**
* @brief Get field seqnr from encapsulated_data message
*
* @return sequence number (starting with 0 on every transmission)
*/
static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field data from encapsulated_data message
*
* @return image data bytes
*/
static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_message_t* msg, uint8_t *data)
{
return _MAV_RETURN_uint8_t_array(msg, data, 253, 2);
}
/**
* @brief Decode a encapsulated_data message into a struct
*
* @param msg The message to decode
* @param encapsulated_data C-struct to decode the message contents into
*/
static inline void mavlink_msg_encapsulated_data_decode(const mavlink_message_t* msg, mavlink_encapsulated_data_t* encapsulated_data)
{
#if MAVLINK_NEED_BYTE_SWAP
encapsulated_data->seqnr = mavlink_msg_encapsulated_data_get_seqnr(msg);
mavlink_msg_encapsulated_data_get_data(msg, encapsulated_data->data);
#else
memcpy(encapsulated_data, _MAV_PAYLOAD(msg), 255);
#endif
}

View File

@ -0,0 +1,628 @@
// MESSAGE IMAGE_AVAILABLE PACKING
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE 154
typedef struct __mavlink_image_available_t
{
uint64_t cam_id; ///< Camera id
uint64_t timestamp; ///< Timestamp
uint64_t valid_until; ///< Until which timestamp this buffer will stay valid
uint32_t img_seq; ///< The image sequence number
uint32_t img_buf_index; ///< Position of the image in the buffer, starts with 0
uint32_t key; ///< Shared memory area key
uint32_t exposure; ///< Exposure time, in microseconds
float gain; ///< Camera gain
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
float local_z; ///< Local frame Z coordinate (height over ground)
float lat; ///< GPS X coordinate
float lon; ///< GPS Y coordinate
float alt; ///< Global frame altitude
float ground_x; ///< Ground truth X
float ground_y; ///< Ground truth Y
float ground_z; ///< Ground truth Z
uint16_t width; ///< Image width
uint16_t height; ///< Image height
uint16_t depth; ///< Image depth
uint8_t cam_no; ///< Camera # (starts with 0)
uint8_t channels; ///< Image channels
} mavlink_image_available_t;
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN 92
#define MAVLINK_MSG_ID_154_LEN 92
#define MAVLINK_MESSAGE_INFO_IMAGE_AVAILABLE { \
"IMAGE_AVAILABLE", \
23, \
{ { "cam_id", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_image_available_t, cam_id) }, \
{ "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_image_available_t, timestamp) }, \
{ "valid_until", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_image_available_t, valid_until) }, \
{ "img_seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_image_available_t, img_seq) }, \
{ "img_buf_index", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_image_available_t, img_buf_index) }, \
{ "key", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_image_available_t, key) }, \
{ "exposure", NULL, MAVLINK_TYPE_UINT32_T, 0, 36, offsetof(mavlink_image_available_t, exposure) }, \
{ "gain", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_image_available_t, gain) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_image_available_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_image_available_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_image_available_t, yaw) }, \
{ "local_z", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_image_available_t, local_z) }, \
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_image_available_t, lat) }, \
{ "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_image_available_t, lon) }, \
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_image_available_t, alt) }, \
{ "ground_x", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_image_available_t, ground_x) }, \
{ "ground_y", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_image_available_t, ground_y) }, \
{ "ground_z", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_image_available_t, ground_z) }, \
{ "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 84, offsetof(mavlink_image_available_t, width) }, \
{ "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 86, offsetof(mavlink_image_available_t, height) }, \
{ "depth", NULL, MAVLINK_TYPE_UINT16_T, 0, 88, offsetof(mavlink_image_available_t, depth) }, \
{ "cam_no", NULL, MAVLINK_TYPE_UINT8_T, 0, 90, offsetof(mavlink_image_available_t, cam_no) }, \
{ "channels", NULL, MAVLINK_TYPE_UINT8_T, 0, 91, offsetof(mavlink_image_available_t, channels) }, \
} \
}
/**
* @brief Pack a image_available 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 cam_id Camera id
* @param cam_no Camera # (starts with 0)
* @param timestamp Timestamp
* @param valid_until Until which timestamp this buffer will stay valid
* @param img_seq The image sequence number
* @param img_buf_index Position of the image in the buffer, starts with 0
* @param width Image width
* @param height Image height
* @param depth Image depth
* @param channels Image channels
* @param key Shared memory area key
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_available_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[92];
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
memcpy(_MAV_PAYLOAD(msg), buf, 92);
#else
mavlink_image_available_t packet;
packet.cam_id = cam_id;
packet.timestamp = timestamp;
packet.valid_until = valid_until;
packet.img_seq = img_seq;
packet.img_buf_index = img_buf_index;
packet.key = key;
packet.exposure = exposure;
packet.gain = gain;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
packet.width = width;
packet.height = height;
packet.depth = depth;
packet.cam_no = cam_no;
packet.channels = channels;
memcpy(_MAV_PAYLOAD(msg), &packet, 92);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
return mavlink_finalize_message(msg, system_id, component_id, 92, 224);
}
/**
* @brief Pack a image_available 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param cam_id Camera id
* @param cam_no Camera # (starts with 0)
* @param timestamp Timestamp
* @param valid_until Until which timestamp this buffer will stay valid
* @param img_seq The image sequence number
* @param img_buf_index Position of the image in the buffer, starts with 0
* @param width Image width
* @param height Image height
* @param depth Image depth
* @param channels Image channels
* @param key Shared memory area key
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_available_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t cam_id,uint8_t cam_no,uint64_t timestamp,uint64_t valid_until,uint32_t img_seq,uint32_t img_buf_index,uint16_t width,uint16_t height,uint16_t depth,uint8_t channels,uint32_t key,uint32_t exposure,float gain,float roll,float pitch,float yaw,float local_z,float lat,float lon,float alt,float ground_x,float ground_y,float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[92];
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
memcpy(_MAV_PAYLOAD(msg), buf, 92);
#else
mavlink_image_available_t packet;
packet.cam_id = cam_id;
packet.timestamp = timestamp;
packet.valid_until = valid_until;
packet.img_seq = img_seq;
packet.img_buf_index = img_buf_index;
packet.key = key;
packet.exposure = exposure;
packet.gain = gain;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
packet.width = width;
packet.height = height;
packet.depth = depth;
packet.cam_no = cam_no;
packet.channels = channels;
memcpy(_MAV_PAYLOAD(msg), &packet, 92);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 92, 224);
}
/**
* @brief Encode a image_available 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 image_available C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_available_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_available_t* image_available)
{
return mavlink_msg_image_available_pack(system_id, component_id, msg, image_available->cam_id, image_available->cam_no, image_available->timestamp, image_available->valid_until, image_available->img_seq, image_available->img_buf_index, image_available->width, image_available->height, image_available->depth, image_available->channels, image_available->key, image_available->exposure, image_available->gain, image_available->roll, image_available->pitch, image_available->yaw, image_available->local_z, image_available->lat, image_available->lon, image_available->alt, image_available->ground_x, image_available->ground_y, image_available->ground_z);
}
/**
* @brief Send a image_available message
* @param chan MAVLink channel to send the message
*
* @param cam_id Camera id
* @param cam_no Camera # (starts with 0)
* @param timestamp Timestamp
* @param valid_until Until which timestamp this buffer will stay valid
* @param img_seq The image sequence number
* @param img_buf_index Position of the image in the buffer, starts with 0
* @param width Image width
* @param height Image height
* @param depth Image depth
* @param channels Image channels
* @param key Shared memory area key
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_available_send(mavlink_channel_t chan, uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[92];
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, buf, 92, 224);
#else
mavlink_image_available_t packet;
packet.cam_id = cam_id;
packet.timestamp = timestamp;
packet.valid_until = valid_until;
packet.img_seq = img_seq;
packet.img_buf_index = img_buf_index;
packet.key = key;
packet.exposure = exposure;
packet.gain = gain;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
packet.width = width;
packet.height = height;
packet.depth = depth;
packet.cam_no = cam_no;
packet.channels = channels;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, (const char *)&packet, 92, 224);
#endif
}
#endif
// MESSAGE IMAGE_AVAILABLE UNPACKING
/**
* @brief Get field cam_id from image_available message
*
* @return Camera id
*/
static inline uint64_t mavlink_msg_image_available_get_cam_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field cam_no from image_available message
*
* @return Camera # (starts with 0)
*/
static inline uint8_t mavlink_msg_image_available_get_cam_no(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 90);
}
/**
* @brief Get field timestamp from image_available message
*
* @return Timestamp
*/
static inline uint64_t mavlink_msg_image_available_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 8);
}
/**
* @brief Get field valid_until from image_available message
*
* @return Until which timestamp this buffer will stay valid
*/
static inline uint64_t mavlink_msg_image_available_get_valid_until(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 16);
}
/**
* @brief Get field img_seq from image_available message
*
* @return The image sequence number
*/
static inline uint32_t mavlink_msg_image_available_get_img_seq(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 24);
}
/**
* @brief Get field img_buf_index from image_available message
*
* @return Position of the image in the buffer, starts with 0
*/
static inline uint32_t mavlink_msg_image_available_get_img_buf_index(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 28);
}
/**
* @brief Get field width from image_available message
*
* @return Image width
*/
static inline uint16_t mavlink_msg_image_available_get_width(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 84);
}
/**
* @brief Get field height from image_available message
*
* @return Image height
*/
static inline uint16_t mavlink_msg_image_available_get_height(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 86);
}
/**
* @brief Get field depth from image_available message
*
* @return Image depth
*/
static inline uint16_t mavlink_msg_image_available_get_depth(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 88);
}
/**
* @brief Get field channels from image_available message
*
* @return Image channels
*/
static inline uint8_t mavlink_msg_image_available_get_channels(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 91);
}
/**
* @brief Get field key from image_available message
*
* @return Shared memory area key
*/
static inline uint32_t mavlink_msg_image_available_get_key(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 32);
}
/**
* @brief Get field exposure from image_available message
*
* @return Exposure time, in microseconds
*/
static inline uint32_t mavlink_msg_image_available_get_exposure(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 36);
}
/**
* @brief Get field gain from image_available message
*
* @return Camera gain
*/
static inline float mavlink_msg_image_available_get_gain(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 40);
}
/**
* @brief Get field roll from image_available message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_image_available_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 44);
}
/**
* @brief Get field pitch from image_available message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_image_available_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 48);
}
/**
* @brief Get field yaw from image_available message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_image_available_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 52);
}
/**
* @brief Get field local_z from image_available message
*
* @return Local frame Z coordinate (height over ground)
*/
static inline float mavlink_msg_image_available_get_local_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 56);
}
/**
* @brief Get field lat from image_available message
*
* @return GPS X coordinate
*/
static inline float mavlink_msg_image_available_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 60);
}
/**
* @brief Get field lon from image_available message
*
* @return GPS Y coordinate
*/
static inline float mavlink_msg_image_available_get_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 64);
}
/**
* @brief Get field alt from image_available message
*
* @return Global frame altitude
*/
static inline float mavlink_msg_image_available_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 68);
}
/**
* @brief Get field ground_x from image_available message
*
* @return Ground truth X
*/
static inline float mavlink_msg_image_available_get_ground_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 72);
}
/**
* @brief Get field ground_y from image_available message
*
* @return Ground truth Y
*/
static inline float mavlink_msg_image_available_get_ground_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 76);
}
/**
* @brief Get field ground_z from image_available message
*
* @return Ground truth Z
*/
static inline float mavlink_msg_image_available_get_ground_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 80);
}
/**
* @brief Decode a image_available message into a struct
*
* @param msg The message to decode
* @param image_available C-struct to decode the message contents into
*/
static inline void mavlink_msg_image_available_decode(const mavlink_message_t* msg, mavlink_image_available_t* image_available)
{
#if MAVLINK_NEED_BYTE_SWAP
image_available->cam_id = mavlink_msg_image_available_get_cam_id(msg);
image_available->timestamp = mavlink_msg_image_available_get_timestamp(msg);
image_available->valid_until = mavlink_msg_image_available_get_valid_until(msg);
image_available->img_seq = mavlink_msg_image_available_get_img_seq(msg);
image_available->img_buf_index = mavlink_msg_image_available_get_img_buf_index(msg);
image_available->key = mavlink_msg_image_available_get_key(msg);
image_available->exposure = mavlink_msg_image_available_get_exposure(msg);
image_available->gain = mavlink_msg_image_available_get_gain(msg);
image_available->roll = mavlink_msg_image_available_get_roll(msg);
image_available->pitch = mavlink_msg_image_available_get_pitch(msg);
image_available->yaw = mavlink_msg_image_available_get_yaw(msg);
image_available->local_z = mavlink_msg_image_available_get_local_z(msg);
image_available->lat = mavlink_msg_image_available_get_lat(msg);
image_available->lon = mavlink_msg_image_available_get_lon(msg);
image_available->alt = mavlink_msg_image_available_get_alt(msg);
image_available->ground_x = mavlink_msg_image_available_get_ground_x(msg);
image_available->ground_y = mavlink_msg_image_available_get_ground_y(msg);
image_available->ground_z = mavlink_msg_image_available_get_ground_z(msg);
image_available->width = mavlink_msg_image_available_get_width(msg);
image_available->height = mavlink_msg_image_available_get_height(msg);
image_available->depth = mavlink_msg_image_available_get_depth(msg);
image_available->cam_no = mavlink_msg_image_available_get_cam_no(msg);
image_available->channels = mavlink_msg_image_available_get_channels(msg);
#else
memcpy(image_available, _MAV_PAYLOAD(msg), 92);
#endif
}

View File

@ -0,0 +1,144 @@
// MESSAGE IMAGE_TRIGGER_CONTROL PACKING
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL 153
typedef struct __mavlink_image_trigger_control_t
{
uint8_t enable; ///< 0 to disable, 1 to enable
} mavlink_image_trigger_control_t;
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN 1
#define MAVLINK_MSG_ID_153_LEN 1
#define MAVLINK_MESSAGE_INFO_IMAGE_TRIGGER_CONTROL { \
"IMAGE_TRIGGER_CONTROL", \
1, \
{ { "enable", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_image_trigger_control_t, enable) }, \
} \
}
/**
* @brief Pack a image_trigger_control message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param enable 0 to disable, 1 to enable
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_trigger_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[1];
_mav_put_uint8_t(buf, 0, enable);
memcpy(_MAV_PAYLOAD(msg), buf, 1);
#else
mavlink_image_trigger_control_t packet;
packet.enable = enable;
memcpy(_MAV_PAYLOAD(msg), &packet, 1);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL;
return mavlink_finalize_message(msg, system_id, component_id, 1, 95);
}
/**
* @brief Pack a image_trigger_control message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param enable 0 to disable, 1 to enable
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_trigger_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[1];
_mav_put_uint8_t(buf, 0, enable);
memcpy(_MAV_PAYLOAD(msg), buf, 1);
#else
mavlink_image_trigger_control_t packet;
packet.enable = enable;
memcpy(_MAV_PAYLOAD(msg), &packet, 1);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 1, 95);
}
/**
* @brief Encode a image_trigger_control 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 image_trigger_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_trigger_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_trigger_control_t* image_trigger_control)
{
return mavlink_msg_image_trigger_control_pack(system_id, component_id, msg, image_trigger_control->enable);
}
/**
* @brief Send a image_trigger_control message
* @param chan MAVLink channel to send the message
*
* @param enable 0 to disable, 1 to enable
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_trigger_control_send(mavlink_channel_t chan, uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[1];
_mav_put_uint8_t(buf, 0, enable);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, buf, 1, 95);
#else
mavlink_image_trigger_control_t packet;
packet.enable = enable;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, (const char *)&packet, 1, 95);
#endif
}
#endif
// MESSAGE IMAGE_TRIGGER_CONTROL UNPACKING
/**
* @brief Get field enable from image_trigger_control message
*
* @return 0 to disable, 1 to enable
*/
static inline uint8_t mavlink_msg_image_trigger_control_get_enable(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Decode a image_trigger_control message into a struct
*
* @param msg The message to decode
* @param image_trigger_control C-struct to decode the message contents into
*/
static inline void mavlink_msg_image_trigger_control_decode(const mavlink_message_t* msg, mavlink_image_trigger_control_t* image_trigger_control)
{
#if MAVLINK_NEED_BYTE_SWAP
image_trigger_control->enable = mavlink_msg_image_trigger_control_get_enable(msg);
#else
memcpy(image_trigger_control, _MAV_PAYLOAD(msg), 1);
#endif
}

View File

@ -0,0 +1,386 @@
// MESSAGE IMAGE_TRIGGERED PACKING
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED 152
typedef struct __mavlink_image_triggered_t
{
uint64_t timestamp; ///< Timestamp
uint32_t seq; ///< IMU seq
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
float local_z; ///< Local frame Z coordinate (height over ground)
float lat; ///< GPS X coordinate
float lon; ///< GPS Y coordinate
float alt; ///< Global frame altitude
float ground_x; ///< Ground truth X
float ground_y; ///< Ground truth Y
float ground_z; ///< Ground truth Z
} mavlink_image_triggered_t;
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN 52
#define MAVLINK_MSG_ID_152_LEN 52
#define MAVLINK_MESSAGE_INFO_IMAGE_TRIGGERED { \
"IMAGE_TRIGGERED", \
12, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_image_triggered_t, timestamp) }, \
{ "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_image_triggered_t, seq) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_image_triggered_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_image_triggered_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_image_triggered_t, yaw) }, \
{ "local_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_image_triggered_t, local_z) }, \
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_image_triggered_t, lat) }, \
{ "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_image_triggered_t, lon) }, \
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_image_triggered_t, alt) }, \
{ "ground_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_image_triggered_t, ground_x) }, \
{ "ground_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_image_triggered_t, ground_y) }, \
{ "ground_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_image_triggered_t, ground_z) }, \
} \
}
/**
* @brief Pack a image_triggered message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param timestamp Timestamp
* @param seq IMU seq
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_triggered_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[52];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
memcpy(_MAV_PAYLOAD(msg), buf, 52);
#else
mavlink_image_triggered_t packet;
packet.timestamp = timestamp;
packet.seq = seq;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
memcpy(_MAV_PAYLOAD(msg), &packet, 52);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
return mavlink_finalize_message(msg, system_id, component_id, 52, 86);
}
/**
* @brief Pack a image_triggered 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param timestamp Timestamp
* @param seq IMU seq
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_triggered_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t timestamp,uint32_t seq,float roll,float pitch,float yaw,float local_z,float lat,float lon,float alt,float ground_x,float ground_y,float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[52];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
memcpy(_MAV_PAYLOAD(msg), buf, 52);
#else
mavlink_image_triggered_t packet;
packet.timestamp = timestamp;
packet.seq = seq;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
memcpy(_MAV_PAYLOAD(msg), &packet, 52);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 52, 86);
}
/**
* @brief Encode a image_triggered 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 image_triggered C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_triggered_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_triggered_t* image_triggered)
{
return mavlink_msg_image_triggered_pack(system_id, component_id, msg, image_triggered->timestamp, image_triggered->seq, image_triggered->roll, image_triggered->pitch, image_triggered->yaw, image_triggered->local_z, image_triggered->lat, image_triggered->lon, image_triggered->alt, image_triggered->ground_x, image_triggered->ground_y, image_triggered->ground_z);
}
/**
* @brief Send a image_triggered message
* @param chan MAVLink channel to send the message
*
* @param timestamp Timestamp
* @param seq IMU seq
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_triggered_send(mavlink_channel_t chan, uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[52];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, 52, 86);
#else
mavlink_image_triggered_t packet;
packet.timestamp = timestamp;
packet.seq = seq;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)&packet, 52, 86);
#endif
}
#endif
// MESSAGE IMAGE_TRIGGERED UNPACKING
/**
* @brief Get field timestamp from image_triggered message
*
* @return Timestamp
*/
static inline uint64_t mavlink_msg_image_triggered_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field seq from image_triggered message
*
* @return IMU seq
*/
static inline uint32_t mavlink_msg_image_triggered_get_seq(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 8);
}
/**
* @brief Get field roll from image_triggered message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_image_triggered_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field pitch from image_triggered message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_image_triggered_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field yaw from image_triggered message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_image_triggered_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field local_z from image_triggered message
*
* @return Local frame Z coordinate (height over ground)
*/
static inline float mavlink_msg_image_triggered_get_local_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field lat from image_triggered message
*
* @return GPS X coordinate
*/
static inline float mavlink_msg_image_triggered_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field lon from image_triggered message
*
* @return GPS Y coordinate
*/
static inline float mavlink_msg_image_triggered_get_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field alt from image_triggered message
*
* @return Global frame altitude
*/
static inline float mavlink_msg_image_triggered_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 36);
}
/**
* @brief Get field ground_x from image_triggered message
*
* @return Ground truth X
*/
static inline float mavlink_msg_image_triggered_get_ground_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 40);
}
/**
* @brief Get field ground_y from image_triggered message
*
* @return Ground truth Y
*/
static inline float mavlink_msg_image_triggered_get_ground_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 44);
}
/**
* @brief Get field ground_z from image_triggered message
*
* @return Ground truth Z
*/
static inline float mavlink_msg_image_triggered_get_ground_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 48);
}
/**
* @brief Decode a image_triggered message into a struct
*
* @param msg The message to decode
* @param image_triggered C-struct to decode the message contents into
*/
static inline void mavlink_msg_image_triggered_decode(const mavlink_message_t* msg, mavlink_image_triggered_t* image_triggered)
{
#if MAVLINK_NEED_BYTE_SWAP
image_triggered->timestamp = mavlink_msg_image_triggered_get_timestamp(msg);
image_triggered->seq = mavlink_msg_image_triggered_get_seq(msg);
image_triggered->roll = mavlink_msg_image_triggered_get_roll(msg);
image_triggered->pitch = mavlink_msg_image_triggered_get_pitch(msg);
image_triggered->yaw = mavlink_msg_image_triggered_get_yaw(msg);
image_triggered->local_z = mavlink_msg_image_triggered_get_local_z(msg);
image_triggered->lat = mavlink_msg_image_triggered_get_lat(msg);
image_triggered->lon = mavlink_msg_image_triggered_get_lon(msg);
image_triggered->alt = mavlink_msg_image_triggered_get_alt(msg);
image_triggered->ground_x = mavlink_msg_image_triggered_get_ground_x(msg);
image_triggered->ground_y = mavlink_msg_image_triggered_get_ground_y(msg);
image_triggered->ground_z = mavlink_msg_image_triggered_get_ground_z(msg);
#else
memcpy(image_triggered, _MAV_PAYLOAD(msg), 52);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE MARKER PACKING
#define MAVLINK_MSG_ID_MARKER 171
typedef struct __mavlink_marker_t
{
float x; ///< x position
float y; ///< y position
float z; ///< z position
float roll; ///< roll orientation
float pitch; ///< pitch orientation
float yaw; ///< yaw orientation
uint16_t id; ///< ID
} mavlink_marker_t;
#define MAVLINK_MSG_ID_MARKER_LEN 26
#define MAVLINK_MSG_ID_171_LEN 26
#define MAVLINK_MESSAGE_INFO_MARKER { \
"MARKER", \
7, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_marker_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_marker_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_marker_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_marker_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_marker_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_marker_t, yaw) }, \
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_marker_t, id) }, \
} \
}
/**
* @brief Pack a marker 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 id ID
* @param x x position
* @param y y position
* @param z z position
* @param roll roll orientation
* @param pitch pitch orientation
* @param yaw yaw orientation
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_marker_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t id, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[26];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
memcpy(_MAV_PAYLOAD(msg), buf, 26);
#else
mavlink_marker_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_MARKER;
return mavlink_finalize_message(msg, system_id, component_id, 26, 249);
}
/**
* @brief Pack a marker 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param id ID
* @param x x position
* @param y y position
* @param z z position
* @param roll roll orientation
* @param pitch pitch orientation
* @param yaw yaw orientation
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_marker_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t id,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[26];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
memcpy(_MAV_PAYLOAD(msg), buf, 26);
#else
mavlink_marker_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_MARKER;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 249);
}
/**
* @brief Encode a marker 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 marker C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_marker_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_marker_t* marker)
{
return mavlink_msg_marker_pack(system_id, component_id, msg, marker->id, marker->x, marker->y, marker->z, marker->roll, marker->pitch, marker->yaw);
}
/**
* @brief Send a marker message
* @param chan MAVLink channel to send the message
*
* @param id ID
* @param x x position
* @param y y position
* @param z z position
* @param roll roll orientation
* @param pitch pitch orientation
* @param yaw yaw orientation
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_marker_send(mavlink_channel_t chan, uint16_t id, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[26];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, buf, 26, 249);
#else
mavlink_marker_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.id = id;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, (const char *)&packet, 26, 249);
#endif
}
#endif
// MESSAGE MARKER UNPACKING
/**
* @brief Get field id from marker message
*
* @return ID
*/
static inline uint16_t mavlink_msg_marker_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field x from marker message
*
* @return x position
*/
static inline float mavlink_msg_marker_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from marker message
*
* @return y position
*/
static inline float mavlink_msg_marker_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from marker message
*
* @return z position
*/
static inline float mavlink_msg_marker_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field roll from marker message
*
* @return roll orientation
*/
static inline float mavlink_msg_marker_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field pitch from marker message
*
* @return pitch orientation
*/
static inline float mavlink_msg_marker_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field yaw from marker message
*
* @return yaw orientation
*/
static inline float mavlink_msg_marker_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a marker message into a struct
*
* @param msg The message to decode
* @param marker C-struct to decode the message contents into
*/
static inline void mavlink_msg_marker_decode(const mavlink_message_t* msg, mavlink_marker_t* marker)
{
#if MAVLINK_NEED_BYTE_SWAP
marker->x = mavlink_msg_marker_get_x(msg);
marker->y = mavlink_msg_marker_get_y(msg);
marker->z = mavlink_msg_marker_get_z(msg);
marker->roll = mavlink_msg_marker_get_roll(msg);
marker->pitch = mavlink_msg_marker_get_pitch(msg);
marker->yaw = mavlink_msg_marker_get_yaw(msg);
marker->id = mavlink_msg_marker_get_id(msg);
#else
memcpy(marker, _MAV_PAYLOAD(msg), 26);
#endif
}

View File

@ -0,0 +1,204 @@
// MESSAGE PATTERN_DETECTED PACKING
#define MAVLINK_MSG_ID_PATTERN_DETECTED 190
typedef struct __mavlink_pattern_detected_t
{
float confidence; ///< Confidence of detection
uint8_t type; ///< 0: Pattern, 1: Letter
char file[100]; ///< Pattern file name
uint8_t detected; ///< Accepted as true detection, 0 no, 1 yes
} mavlink_pattern_detected_t;
#define MAVLINK_MSG_ID_PATTERN_DETECTED_LEN 106
#define MAVLINK_MSG_ID_190_LEN 106
#define MAVLINK_MSG_PATTERN_DETECTED_FIELD_FILE_LEN 100
#define MAVLINK_MESSAGE_INFO_PATTERN_DETECTED { \
"PATTERN_DETECTED", \
4, \
{ { "confidence", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_pattern_detected_t, confidence) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_pattern_detected_t, type) }, \
{ "file", NULL, MAVLINK_TYPE_CHAR, 100, 5, offsetof(mavlink_pattern_detected_t, file) }, \
{ "detected", NULL, MAVLINK_TYPE_UINT8_T, 0, 105, offsetof(mavlink_pattern_detected_t, detected) }, \
} \
}
/**
* @brief Pack a pattern_detected 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 type 0: Pattern, 1: Letter
* @param confidence Confidence of detection
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_pattern_detected_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, float confidence, const char *file, uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[106];
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
memcpy(_MAV_PAYLOAD(msg), buf, 106);
#else
mavlink_pattern_detected_t packet;
packet.confidence = confidence;
packet.type = type;
packet.detected = detected;
memcpy(packet.file, file, sizeof(char)*100);
memcpy(_MAV_PAYLOAD(msg), &packet, 106);
#endif
msg->msgid = MAVLINK_MSG_ID_PATTERN_DETECTED;
return mavlink_finalize_message(msg, system_id, component_id, 106, 90);
}
/**
* @brief Pack a pattern_detected 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param type 0: Pattern, 1: Letter
* @param confidence Confidence of detection
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_pattern_detected_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,float confidence,const char *file,uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[106];
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
memcpy(_MAV_PAYLOAD(msg), buf, 106);
#else
mavlink_pattern_detected_t packet;
packet.confidence = confidence;
packet.type = type;
packet.detected = detected;
memcpy(packet.file, file, sizeof(char)*100);
memcpy(_MAV_PAYLOAD(msg), &packet, 106);
#endif
msg->msgid = MAVLINK_MSG_ID_PATTERN_DETECTED;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 106, 90);
}
/**
* @brief Encode a pattern_detected 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 pattern_detected C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_pattern_detected_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_pattern_detected_t* pattern_detected)
{
return mavlink_msg_pattern_detected_pack(system_id, component_id, msg, pattern_detected->type, pattern_detected->confidence, pattern_detected->file, pattern_detected->detected);
}
/**
* @brief Send a pattern_detected message
* @param chan MAVLink channel to send the message
*
* @param type 0: Pattern, 1: Letter
* @param confidence Confidence of detection
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_pattern_detected_send(mavlink_channel_t chan, uint8_t type, float confidence, const char *file, uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[106];
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, buf, 106, 90);
#else
mavlink_pattern_detected_t packet;
packet.confidence = confidence;
packet.type = type;
packet.detected = detected;
memcpy(packet.file, file, sizeof(char)*100);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, (const char *)&packet, 106, 90);
#endif
}
#endif
// MESSAGE PATTERN_DETECTED UNPACKING
/**
* @brief Get field type from pattern_detected message
*
* @return 0: Pattern, 1: Letter
*/
static inline uint8_t mavlink_msg_pattern_detected_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field confidence from pattern_detected message
*
* @return Confidence of detection
*/
static inline float mavlink_msg_pattern_detected_get_confidence(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field file from pattern_detected message
*
* @return Pattern file name
*/
static inline uint16_t mavlink_msg_pattern_detected_get_file(const mavlink_message_t* msg, char *file)
{
return _MAV_RETURN_char_array(msg, file, 100, 5);
}
/**
* @brief Get field detected from pattern_detected message
*
* @return Accepted as true detection, 0 no, 1 yes
*/
static inline uint8_t mavlink_msg_pattern_detected_get_detected(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 105);
}
/**
* @brief Decode a pattern_detected message into a struct
*
* @param msg The message to decode
* @param pattern_detected C-struct to decode the message contents into
*/
static inline void mavlink_msg_pattern_detected_decode(const mavlink_message_t* msg, mavlink_pattern_detected_t* pattern_detected)
{
#if MAVLINK_NEED_BYTE_SWAP
pattern_detected->confidence = mavlink_msg_pattern_detected_get_confidence(msg);
pattern_detected->type = mavlink_msg_pattern_detected_get_type(msg);
mavlink_msg_pattern_detected_get_file(msg, pattern_detected->file);
pattern_detected->detected = mavlink_msg_pattern_detected_get_detected(msg);
#else
memcpy(pattern_detected, _MAV_PAYLOAD(msg), 106);
#endif
}

View File

@ -0,0 +1,292 @@
// MESSAGE POINT_OF_INTEREST PACKING
#define MAVLINK_MSG_ID_POINT_OF_INTEREST 191
typedef struct __mavlink_point_of_interest_t
{
float x; ///< X Position
float y; ///< Y Position
float z; ///< Z Position
uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds
uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
uint8_t coordinate_system; ///< 0: global, 1:local
char name[26]; ///< POI name
} mavlink_point_of_interest_t;
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN 43
#define MAVLINK_MSG_ID_191_LEN 43
#define MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN 26
#define MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST { \
"POINT_OF_INTEREST", \
8, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_point_of_interest_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_point_of_interest_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_point_of_interest_t, z) }, \
{ "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_point_of_interest_t, timeout) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_point_of_interest_t, type) }, \
{ "color", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_point_of_interest_t, color) }, \
{ "coordinate_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_point_of_interest_t, coordinate_system) }, \
{ "name", NULL, MAVLINK_TYPE_CHAR, 26, 17, offsetof(mavlink_point_of_interest_t, name) }, \
} \
}
/**
* @brief Pack a point_of_interest 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 type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param name POI name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[43];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
memcpy(_MAV_PAYLOAD(msg), buf, 43);
#else
mavlink_point_of_interest_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD(msg), &packet, 43);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST;
return mavlink_finalize_message(msg, system_id, component_id, 43, 95);
}
/**
* @brief Pack a point_of_interest 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param name POI name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,uint8_t color,uint8_t coordinate_system,uint16_t timeout,float x,float y,float z,const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[43];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
memcpy(_MAV_PAYLOAD(msg), buf, 43);
#else
mavlink_point_of_interest_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD(msg), &packet, 43);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 43, 95);
}
/**
* @brief Encode a point_of_interest 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 point_of_interest C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_point_of_interest_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_t* point_of_interest)
{
return mavlink_msg_point_of_interest_pack(system_id, component_id, msg, point_of_interest->type, point_of_interest->color, point_of_interest->coordinate_system, point_of_interest->timeout, point_of_interest->x, point_of_interest->y, point_of_interest->z, point_of_interest->name);
}
/**
* @brief Send a point_of_interest message
* @param chan MAVLink channel to send the message
*
* @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param name POI name
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_point_of_interest_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[43];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, 43, 95);
#else
mavlink_point_of_interest_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
memcpy(packet.name, name, sizeof(char)*26);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)&packet, 43, 95);
#endif
}
#endif
// MESSAGE POINT_OF_INTEREST UNPACKING
/**
* @brief Get field type from point_of_interest message
*
* @return 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
*/
static inline uint8_t mavlink_msg_point_of_interest_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 14);
}
/**
* @brief Get field color from point_of_interest message
*
* @return 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
*/
static inline uint8_t mavlink_msg_point_of_interest_get_color(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 15);
}
/**
* @brief Get field coordinate_system from point_of_interest message
*
* @return 0: global, 1:local
*/
static inline uint8_t mavlink_msg_point_of_interest_get_coordinate_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field timeout from point_of_interest message
*
* @return 0: no timeout, >1: timeout in seconds
*/
static inline uint16_t mavlink_msg_point_of_interest_get_timeout(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
}
/**
* @brief Get field x from point_of_interest message
*
* @return X Position
*/
static inline float mavlink_msg_point_of_interest_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from point_of_interest message
*
* @return Y Position
*/
static inline float mavlink_msg_point_of_interest_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from point_of_interest message
*
* @return Z Position
*/
static inline float mavlink_msg_point_of_interest_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field name from point_of_interest message
*
* @return POI name
*/
static inline uint16_t mavlink_msg_point_of_interest_get_name(const mavlink_message_t* msg, char *name)
{
return _MAV_RETURN_char_array(msg, name, 26, 17);
}
/**
* @brief Decode a point_of_interest message into a struct
*
* @param msg The message to decode
* @param point_of_interest C-struct to decode the message contents into
*/
static inline void mavlink_msg_point_of_interest_decode(const mavlink_message_t* msg, mavlink_point_of_interest_t* point_of_interest)
{
#if MAVLINK_NEED_BYTE_SWAP
point_of_interest->x = mavlink_msg_point_of_interest_get_x(msg);
point_of_interest->y = mavlink_msg_point_of_interest_get_y(msg);
point_of_interest->z = mavlink_msg_point_of_interest_get_z(msg);
point_of_interest->timeout = mavlink_msg_point_of_interest_get_timeout(msg);
point_of_interest->type = mavlink_msg_point_of_interest_get_type(msg);
point_of_interest->color = mavlink_msg_point_of_interest_get_color(msg);
point_of_interest->coordinate_system = mavlink_msg_point_of_interest_get_coordinate_system(msg);
mavlink_msg_point_of_interest_get_name(msg, point_of_interest->name);
#else
memcpy(point_of_interest, _MAV_PAYLOAD(msg), 43);
#endif
}

View File

@ -0,0 +1,358 @@
// MESSAGE POINT_OF_INTEREST_CONNECTION PACKING
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION 192
typedef struct __mavlink_point_of_interest_connection_t
{
float xp1; ///< X1 Position
float yp1; ///< Y1 Position
float zp1; ///< Z1 Position
float xp2; ///< X2 Position
float yp2; ///< Y2 Position
float zp2; ///< Z2 Position
uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds
uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
uint8_t coordinate_system; ///< 0: global, 1:local
char name[26]; ///< POI connection name
} mavlink_point_of_interest_connection_t;
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN 55
#define MAVLINK_MSG_ID_192_LEN 55
#define MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN 26
#define MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST_CONNECTION { \
"POINT_OF_INTEREST_CONNECTION", \
11, \
{ { "xp1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_point_of_interest_connection_t, xp1) }, \
{ "yp1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_point_of_interest_connection_t, yp1) }, \
{ "zp1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_point_of_interest_connection_t, zp1) }, \
{ "xp2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_point_of_interest_connection_t, xp2) }, \
{ "yp2", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_point_of_interest_connection_t, yp2) }, \
{ "zp2", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_point_of_interest_connection_t, zp2) }, \
{ "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_point_of_interest_connection_t, timeout) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_point_of_interest_connection_t, type) }, \
{ "color", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_point_of_interest_connection_t, color) }, \
{ "coordinate_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_point_of_interest_connection_t, coordinate_system) }, \
{ "name", NULL, MAVLINK_TYPE_CHAR, 26, 29, offsetof(mavlink_point_of_interest_connection_t, name) }, \
} \
}
/**
* @brief Pack a point_of_interest_connection 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 type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param xp1 X1 Position
* @param yp1 Y1 Position
* @param zp1 Z1 Position
* @param xp2 X2 Position
* @param yp2 Y2 Position
* @param zp2 Z2 Position
* @param name POI connection name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[55];
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
memcpy(_MAV_PAYLOAD(msg), buf, 55);
#else
mavlink_point_of_interest_connection_t packet;
packet.xp1 = xp1;
packet.yp1 = yp1;
packet.zp1 = zp1;
packet.xp2 = xp2;
packet.yp2 = yp2;
packet.zp2 = zp2;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD(msg), &packet, 55);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION;
return mavlink_finalize_message(msg, system_id, component_id, 55, 36);
}
/**
* @brief Pack a point_of_interest_connection 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param xp1 X1 Position
* @param yp1 Y1 Position
* @param zp1 Z1 Position
* @param xp2 X2 Position
* @param yp2 Y2 Position
* @param zp2 Z2 Position
* @param name POI connection name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,uint8_t color,uint8_t coordinate_system,uint16_t timeout,float xp1,float yp1,float zp1,float xp2,float yp2,float zp2,const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[55];
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
memcpy(_MAV_PAYLOAD(msg), buf, 55);
#else
mavlink_point_of_interest_connection_t packet;
packet.xp1 = xp1;
packet.yp1 = yp1;
packet.zp1 = zp1;
packet.xp2 = xp2;
packet.yp2 = yp2;
packet.zp2 = zp2;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD(msg), &packet, 55);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 55, 36);
}
/**
* @brief Encode a point_of_interest_connection 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 point_of_interest_connection C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_connection_t* point_of_interest_connection)
{
return mavlink_msg_point_of_interest_connection_pack(system_id, component_id, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name);
}
/**
* @brief Send a point_of_interest_connection message
* @param chan MAVLink channel to send the message
*
* @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param xp1 X1 Position
* @param yp1 Y1 Position
* @param zp1 Z1 Position
* @param xp2 X2 Position
* @param yp2 Y2 Position
* @param zp2 Z2 Position
* @param name POI connection name
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_point_of_interest_connection_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[55];
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, buf, 55, 36);
#else
mavlink_point_of_interest_connection_t packet;
packet.xp1 = xp1;
packet.yp1 = yp1;
packet.zp1 = zp1;
packet.xp2 = xp2;
packet.yp2 = yp2;
packet.zp2 = zp2;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
memcpy(packet.name, name, sizeof(char)*26);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)&packet, 55, 36);
#endif
}
#endif
// MESSAGE POINT_OF_INTEREST_CONNECTION UNPACKING
/**
* @brief Get field type from point_of_interest_connection message
*
* @return 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
*/
static inline uint8_t mavlink_msg_point_of_interest_connection_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 26);
}
/**
* @brief Get field color from point_of_interest_connection message
*
* @return 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
*/
static inline uint8_t mavlink_msg_point_of_interest_connection_get_color(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 27);
}
/**
* @brief Get field coordinate_system from point_of_interest_connection message
*
* @return 0: global, 1:local
*/
static inline uint8_t mavlink_msg_point_of_interest_connection_get_coordinate_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 28);
}
/**
* @brief Get field timeout from point_of_interest_connection message
*
* @return 0: no timeout, >1: timeout in seconds
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_get_timeout(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field xp1 from point_of_interest_connection message
*
* @return X1 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_xp1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field yp1 from point_of_interest_connection message
*
* @return Y1 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_yp1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field zp1 from point_of_interest_connection message
*
* @return Z1 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_zp1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field xp2 from point_of_interest_connection message
*
* @return X2 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_xp2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field yp2 from point_of_interest_connection message
*
* @return Y2 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_yp2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field zp2 from point_of_interest_connection message
*
* @return Z2 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_zp2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field name from point_of_interest_connection message
*
* @return POI connection name
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_get_name(const mavlink_message_t* msg, char *name)
{
return _MAV_RETURN_char_array(msg, name, 26, 29);
}
/**
* @brief Decode a point_of_interest_connection message into a struct
*
* @param msg The message to decode
* @param point_of_interest_connection C-struct to decode the message contents into
*/
static inline void mavlink_msg_point_of_interest_connection_decode(const mavlink_message_t* msg, mavlink_point_of_interest_connection_t* point_of_interest_connection)
{
#if MAVLINK_NEED_BYTE_SWAP
point_of_interest_connection->xp1 = mavlink_msg_point_of_interest_connection_get_xp1(msg);
point_of_interest_connection->yp1 = mavlink_msg_point_of_interest_connection_get_yp1(msg);
point_of_interest_connection->zp1 = mavlink_msg_point_of_interest_connection_get_zp1(msg);
point_of_interest_connection->xp2 = mavlink_msg_point_of_interest_connection_get_xp2(msg);
point_of_interest_connection->yp2 = mavlink_msg_point_of_interest_connection_get_yp2(msg);
point_of_interest_connection->zp2 = mavlink_msg_point_of_interest_connection_get_zp2(msg);
point_of_interest_connection->timeout = mavlink_msg_point_of_interest_connection_get_timeout(msg);
point_of_interest_connection->type = mavlink_msg_point_of_interest_connection_get_type(msg);
point_of_interest_connection->color = mavlink_msg_point_of_interest_connection_get_color(msg);
point_of_interest_connection->coordinate_system = mavlink_msg_point_of_interest_connection_get_coordinate_system(msg);
mavlink_msg_point_of_interest_connection_get_name(msg, point_of_interest_connection->name);
#else
memcpy(point_of_interest_connection, _MAV_PAYLOAD(msg), 55);
#endif
}

View File

@ -0,0 +1,254 @@
// MESSAGE POSITION_CONTROL_OFFSET_SET PACKING
#define MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET 160
typedef struct __mavlink_position_control_offset_set_t
{
float x; ///< x position offset
float y; ///< y position offset
float z; ///< z position offset
float yaw; ///< yaw orientation offset in radians, 0 = NORTH
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_position_control_offset_set_t;
#define MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_LEN 18
#define MAVLINK_MSG_ID_160_LEN 18
#define MAVLINK_MESSAGE_INFO_POSITION_CONTROL_OFFSET_SET { \
"POSITION_CONTROL_OFFSET_SET", \
6, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_position_control_offset_set_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_control_offset_set_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_control_offset_set_t, z) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_control_offset_set_t, yaw) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_position_control_offset_set_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_position_control_offset_set_t, target_component) }, \
} \
}
/**
* @brief Pack a position_control_offset_set message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target_system System ID
* @param target_component Component ID
* @param x x position offset
* @param y y position offset
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_offset_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
#else
mavlink_position_control_offset_set_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET;
return mavlink_finalize_message(msg, system_id, component_id, 18, 244);
}
/**
* @brief Pack a position_control_offset_set 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param x x position offset
* @param y y position offset
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_offset_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,float x,float y,float z,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
#else
mavlink_position_control_offset_set_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 244);
}
/**
* @brief Encode a position_control_offset_set 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_control_offset_set C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_position_control_offset_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_control_offset_set_t* position_control_offset_set)
{
return mavlink_msg_position_control_offset_set_pack(system_id, component_id, msg, position_control_offset_set->target_system, position_control_offset_set->target_component, position_control_offset_set->x, position_control_offset_set->y, position_control_offset_set->z, position_control_offset_set->yaw);
}
/**
* @brief Send a position_control_offset_set message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param x x position offset
* @param y y position offset
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_offset_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET, buf, 18, 244);
#else
mavlink_position_control_offset_set_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.target_system = target_system;
packet.target_component = target_component;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET, (const char *)&packet, 18, 244);
#endif
}
#endif
// MESSAGE POSITION_CONTROL_OFFSET_SET UNPACKING
/**
* @brief Get field target_system from position_control_offset_set message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_position_control_offset_set_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field target_component from position_control_offset_set message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_position_control_offset_set_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
* @brief Get field x from position_control_offset_set message
*
* @return x position offset
*/
static inline float mavlink_msg_position_control_offset_set_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from position_control_offset_set message
*
* @return y position offset
*/
static inline float mavlink_msg_position_control_offset_set_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from position_control_offset_set message
*
* @return z position offset
*/
static inline float mavlink_msg_position_control_offset_set_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw from position_control_offset_set message
*
* @return yaw orientation offset in radians, 0 = NORTH
*/
static inline float mavlink_msg_position_control_offset_set_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a position_control_offset_set message into a struct
*
* @param msg The message to decode
* @param position_control_offset_set C-struct to decode the message contents into
*/
static inline void mavlink_msg_position_control_offset_set_decode(const mavlink_message_t* msg, mavlink_position_control_offset_set_t* position_control_offset_set)
{
#if MAVLINK_NEED_BYTE_SWAP
position_control_offset_set->x = mavlink_msg_position_control_offset_set_get_x(msg);
position_control_offset_set->y = mavlink_msg_position_control_offset_set_get_y(msg);
position_control_offset_set->z = mavlink_msg_position_control_offset_set_get_z(msg);
position_control_offset_set->yaw = mavlink_msg_position_control_offset_set_get_yaw(msg);
position_control_offset_set->target_system = mavlink_msg_position_control_offset_set_get_target_system(msg);
position_control_offset_set->target_component = mavlink_msg_position_control_offset_set_get_target_component(msg);
#else
memcpy(position_control_offset_set, _MAV_PAYLOAD(msg), 18);
#endif
}

View File

@ -0,0 +1,232 @@
// MESSAGE POSITION_CONTROL_SETPOINT PACKING
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT 170
typedef struct __mavlink_position_control_setpoint_t
{
float x; ///< x position
float y; ///< y position
float z; ///< z position
float yaw; ///< yaw orientation in radians, 0 = NORTH
uint16_t id; ///< ID of waypoint, 0 for plain position
} mavlink_position_control_setpoint_t;
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN 18
#define MAVLINK_MSG_ID_170_LEN 18
#define MAVLINK_MESSAGE_INFO_POSITION_CONTROL_SETPOINT { \
"POSITION_CONTROL_SETPOINT", \
5, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_position_control_setpoint_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_control_setpoint_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_control_setpoint_t, z) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_control_setpoint_t, yaw) }, \
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_position_control_setpoint_t, id) }, \
} \
}
/**
* @brief Pack a position_control_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 id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
#else
mavlink_position_control_setpoint_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT;
return mavlink_finalize_message(msg, system_id, component_id, 18, 28);
}
/**
* @brief Pack a position_control_setpoint 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t id,float x,float y,float z,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
#else
mavlink_position_control_setpoint_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 28);
}
/**
* @brief Encode a position_control_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 position_control_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_position_control_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_control_setpoint_t* position_control_setpoint)
{
return mavlink_msg_position_control_setpoint_pack(system_id, component_id, msg, position_control_setpoint->id, position_control_setpoint->x, position_control_setpoint->y, position_control_setpoint->z, position_control_setpoint->yaw);
}
/**
* @brief Send a position_control_setpoint message
* @param chan MAVLink channel to send the message
*
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_setpoint_send(mavlink_channel_t chan, uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, buf, 18, 28);
#else
mavlink_position_control_setpoint_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, (const char *)&packet, 18, 28);
#endif
}
#endif
// MESSAGE POSITION_CONTROL_SETPOINT UNPACKING
/**
* @brief Get field id from position_control_setpoint message
*
* @return ID of waypoint, 0 for plain position
*/
static inline uint16_t mavlink_msg_position_control_setpoint_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
}
/**
* @brief Get field x from position_control_setpoint message
*
* @return x position
*/
static inline float mavlink_msg_position_control_setpoint_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from position_control_setpoint message
*
* @return y position
*/
static inline float mavlink_msg_position_control_setpoint_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from position_control_setpoint message
*
* @return z position
*/
static inline float mavlink_msg_position_control_setpoint_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw from position_control_setpoint message
*
* @return yaw orientation in radians, 0 = NORTH
*/
static inline float mavlink_msg_position_control_setpoint_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a position_control_setpoint message into a struct
*
* @param msg The message to decode
* @param position_control_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_position_control_setpoint_decode(const mavlink_message_t* msg, mavlink_position_control_setpoint_t* position_control_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
position_control_setpoint->x = mavlink_msg_position_control_setpoint_get_x(msg);
position_control_setpoint->y = mavlink_msg_position_control_setpoint_get_y(msg);
position_control_setpoint->z = mavlink_msg_position_control_setpoint_get_z(msg);
position_control_setpoint->yaw = mavlink_msg_position_control_setpoint_get_yaw(msg);
position_control_setpoint->id = mavlink_msg_position_control_setpoint_get_id(msg);
#else
memcpy(position_control_setpoint, _MAV_PAYLOAD(msg), 18);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE POSITION_CONTROL_SETPOINT_SET PACKING
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET 159
typedef struct __mavlink_position_control_setpoint_set_t
{
float x; ///< x position
float y; ///< y position
float z; ///< z position
float yaw; ///< yaw orientation in radians, 0 = NORTH
uint16_t id; ///< ID of waypoint, 0 for plain position
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_position_control_setpoint_set_t;
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_LEN 20
#define MAVLINK_MSG_ID_159_LEN 20
#define MAVLINK_MESSAGE_INFO_POSITION_CONTROL_SETPOINT_SET { \
"POSITION_CONTROL_SETPOINT_SET", \
7, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_position_control_setpoint_set_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_control_setpoint_set_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_control_setpoint_set_t, z) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_control_setpoint_set_t, yaw) }, \
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_position_control_setpoint_set_t, id) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_position_control_setpoint_set_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_position_control_setpoint_set_t, target_component) }, \
} \
}
/**
* @brief Pack a position_control_setpoint_set message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target_system System ID
* @param target_component Component ID
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_setpoint_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
_mav_put_uint8_t(buf, 18, target_system);
_mav_put_uint8_t(buf, 19, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_position_control_setpoint_set_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET;
return mavlink_finalize_message(msg, system_id, component_id, 20, 11);
}
/**
* @brief Pack a position_control_setpoint_set 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_setpoint_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint16_t id,float x,float y,float z,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
_mav_put_uint8_t(buf, 18, target_system);
_mav_put_uint8_t(buf, 19, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_position_control_setpoint_set_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 11);
}
/**
* @brief Encode a position_control_setpoint_set 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_control_setpoint_set C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_position_control_setpoint_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_control_setpoint_set_t* position_control_setpoint_set)
{
return mavlink_msg_position_control_setpoint_set_pack(system_id, component_id, msg, position_control_setpoint_set->target_system, position_control_setpoint_set->target_component, position_control_setpoint_set->id, position_control_setpoint_set->x, position_control_setpoint_set->y, position_control_setpoint_set->z, position_control_setpoint_set->yaw);
}
/**
* @brief Send a position_control_setpoint_set message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_setpoint_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
_mav_put_uint8_t(buf, 18, target_system);
_mav_put_uint8_t(buf, 19, target_component);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET, buf, 20, 11);
#else
mavlink_position_control_setpoint_set_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
packet.target_system = target_system;
packet.target_component = target_component;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET, (const char *)&packet, 20, 11);
#endif
}
#endif
// MESSAGE POSITION_CONTROL_SETPOINT_SET UNPACKING
/**
* @brief Get field target_system from position_control_setpoint_set message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_position_control_setpoint_set_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 18);
}
/**
* @brief Get field target_component from position_control_setpoint_set message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_position_control_setpoint_set_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 19);
}
/**
* @brief Get field id from position_control_setpoint_set message
*
* @return ID of waypoint, 0 for plain position
*/
static inline uint16_t mavlink_msg_position_control_setpoint_set_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
}
/**
* @brief Get field x from position_control_setpoint_set message
*
* @return x position
*/
static inline float mavlink_msg_position_control_setpoint_set_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from position_control_setpoint_set message
*
* @return y position
*/
static inline float mavlink_msg_position_control_setpoint_set_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from position_control_setpoint_set message
*
* @return z position
*/
static inline float mavlink_msg_position_control_setpoint_set_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw from position_control_setpoint_set message
*
* @return yaw orientation in radians, 0 = NORTH
*/
static inline float mavlink_msg_position_control_setpoint_set_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a position_control_setpoint_set message into a struct
*
* @param msg The message to decode
* @param position_control_setpoint_set C-struct to decode the message contents into
*/
static inline void mavlink_msg_position_control_setpoint_set_decode(const mavlink_message_t* msg, mavlink_position_control_setpoint_set_t* position_control_setpoint_set)
{
#if MAVLINK_NEED_BYTE_SWAP
position_control_setpoint_set->x = mavlink_msg_position_control_setpoint_set_get_x(msg);
position_control_setpoint_set->y = mavlink_msg_position_control_setpoint_set_get_y(msg);
position_control_setpoint_set->z = mavlink_msg_position_control_setpoint_set_get_z(msg);
position_control_setpoint_set->yaw = mavlink_msg_position_control_setpoint_set_get_yaw(msg);
position_control_setpoint_set->id = mavlink_msg_position_control_setpoint_set_get_id(msg);
position_control_setpoint_set->target_system = mavlink_msg_position_control_setpoint_set_get_target_system(msg);
position_control_setpoint_set->target_component = mavlink_msg_position_control_setpoint_set_get_target_component(msg);
#else
memcpy(position_control_setpoint_set, _MAV_PAYLOAD(msg), 20);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE RAW_AUX PACKING
#define MAVLINK_MSG_ID_RAW_AUX 172
typedef struct __mavlink_raw_aux_t
{
int32_t baro; ///< Barometric pressure (hecto Pascal)
uint16_t adc1; ///< ADC1 (J405 ADC3, LPC2148 AD0.6)
uint16_t adc2; ///< ADC2 (J405 ADC5, LPC2148 AD0.2)
uint16_t adc3; ///< ADC3 (J405 ADC6, LPC2148 AD0.1)
uint16_t adc4; ///< ADC4 (J405 ADC7, LPC2148 AD1.3)
uint16_t vbat; ///< Battery voltage
int16_t temp; ///< Temperature (degrees celcius)
} mavlink_raw_aux_t;
#define MAVLINK_MSG_ID_RAW_AUX_LEN 16
#define MAVLINK_MSG_ID_172_LEN 16
#define MAVLINK_MESSAGE_INFO_RAW_AUX { \
"RAW_AUX", \
7, \
{ { "baro", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_raw_aux_t, baro) }, \
{ "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_raw_aux_t, adc1) }, \
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_raw_aux_t, adc2) }, \
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_raw_aux_t, adc3) }, \
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_raw_aux_t, adc4) }, \
{ "vbat", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_raw_aux_t, vbat) }, \
{ "temp", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_aux_t, temp) }, \
} \
}
/**
* @brief Pack a raw_aux 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 adc1 ADC1 (J405 ADC3, LPC2148 AD0.6)
* @param adc2 ADC2 (J405 ADC5, LPC2148 AD0.2)
* @param adc3 ADC3 (J405 ADC6, LPC2148 AD0.1)
* @param adc4 ADC4 (J405 ADC7, LPC2148 AD1.3)
* @param vbat Battery voltage
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_raw_aux_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t vbat, int16_t temp, int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
memcpy(_MAV_PAYLOAD(msg), buf, 16);
#else
mavlink_raw_aux_t packet;
packet.baro = baro;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.vbat = vbat;
packet.temp = temp;
memcpy(_MAV_PAYLOAD(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_AUX;
return mavlink_finalize_message(msg, system_id, component_id, 16, 182);
}
/**
* @brief Pack a raw_aux 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param adc1 ADC1 (J405 ADC3, LPC2148 AD0.6)
* @param adc2 ADC2 (J405 ADC5, LPC2148 AD0.2)
* @param adc3 ADC3 (J405 ADC6, LPC2148 AD0.1)
* @param adc4 ADC4 (J405 ADC7, LPC2148 AD1.3)
* @param vbat Battery voltage
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_raw_aux_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t vbat,int16_t temp,int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
memcpy(_MAV_PAYLOAD(msg), buf, 16);
#else
mavlink_raw_aux_t packet;
packet.baro = baro;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.vbat = vbat;
packet.temp = temp;
memcpy(_MAV_PAYLOAD(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_AUX;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 182);
}
/**
* @brief Encode a raw_aux 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 raw_aux C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_raw_aux_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_aux_t* raw_aux)
{
return mavlink_msg_raw_aux_pack(system_id, component_id, msg, raw_aux->adc1, raw_aux->adc2, raw_aux->adc3, raw_aux->adc4, raw_aux->vbat, raw_aux->temp, raw_aux->baro);
}
/**
* @brief Send a raw_aux message
* @param chan MAVLink channel to send the message
*
* @param adc1 ADC1 (J405 ADC3, LPC2148 AD0.6)
* @param adc2 ADC2 (J405 ADC5, LPC2148 AD0.2)
* @param adc3 ADC3 (J405 ADC6, LPC2148 AD0.1)
* @param adc4 ADC4 (J405 ADC7, LPC2148 AD1.3)
* @param vbat Battery voltage
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_raw_aux_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t vbat, int16_t temp, int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, buf, 16, 182);
#else
mavlink_raw_aux_t packet;
packet.baro = baro;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.vbat = vbat;
packet.temp = temp;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, (const char *)&packet, 16, 182);
#endif
}
#endif
// MESSAGE RAW_AUX UNPACKING
/**
* @brief Get field adc1 from raw_aux message
*
* @return ADC1 (J405 ADC3, LPC2148 AD0.6)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field adc2 from raw_aux message
*
* @return ADC2 (J405 ADC5, LPC2148 AD0.2)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field adc3 from raw_aux message
*
* @return ADC3 (J405 ADC6, LPC2148 AD0.1)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc3(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field adc4 from raw_aux message
*
* @return ADC4 (J405 ADC7, LPC2148 AD1.3)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc4(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
}
/**
* @brief Get field vbat from raw_aux message
*
* @return Battery voltage
*/
static inline uint16_t mavlink_msg_raw_aux_get_vbat(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
}
/**
* @brief Get field temp from raw_aux message
*
* @return Temperature (degrees celcius)
*/
static inline int16_t mavlink_msg_raw_aux_get_temp(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 14);
}
/**
* @brief Get field baro from raw_aux message
*
* @return Barometric pressure (hecto Pascal)
*/
static inline int32_t mavlink_msg_raw_aux_get_baro(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Decode a raw_aux message into a struct
*
* @param msg The message to decode
* @param raw_aux C-struct to decode the message contents into
*/
static inline void mavlink_msg_raw_aux_decode(const mavlink_message_t* msg, mavlink_raw_aux_t* raw_aux)
{
#if MAVLINK_NEED_BYTE_SWAP
raw_aux->baro = mavlink_msg_raw_aux_get_baro(msg);
raw_aux->adc1 = mavlink_msg_raw_aux_get_adc1(msg);
raw_aux->adc2 = mavlink_msg_raw_aux_get_adc2(msg);
raw_aux->adc3 = mavlink_msg_raw_aux_get_adc3(msg);
raw_aux->adc4 = mavlink_msg_raw_aux_get_adc4(msg);
raw_aux->vbat = mavlink_msg_raw_aux_get_vbat(msg);
raw_aux->temp = mavlink_msg_raw_aux_get_temp(msg);
#else
memcpy(raw_aux, _MAV_PAYLOAD(msg), 16);
#endif
}

View File

@ -0,0 +1,254 @@
// MESSAGE SET_CAM_SHUTTER PACKING
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER 151
typedef struct __mavlink_set_cam_shutter_t
{
float gain; ///< Camera gain
uint16_t interval; ///< Shutter interval, in microseconds
uint16_t exposure; ///< Exposure time, in microseconds
uint8_t cam_no; ///< Camera id
uint8_t cam_mode; ///< Camera mode: 0 = auto, 1 = manual
uint8_t trigger_pin; ///< Trigger pin, 0-3 for PtGrey FireFly
} mavlink_set_cam_shutter_t;
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN 11
#define MAVLINK_MSG_ID_151_LEN 11
#define MAVLINK_MESSAGE_INFO_SET_CAM_SHUTTER { \
"SET_CAM_SHUTTER", \
6, \
{ { "gain", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_set_cam_shutter_t, gain) }, \
{ "interval", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_set_cam_shutter_t, interval) }, \
{ "exposure", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_set_cam_shutter_t, exposure) }, \
{ "cam_no", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_set_cam_shutter_t, cam_no) }, \
{ "cam_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_set_cam_shutter_t, cam_mode) }, \
{ "trigger_pin", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_set_cam_shutter_t, trigger_pin) }, \
} \
}
/**
* @brief Pack a set_cam_shutter 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 cam_no Camera id
* @param cam_mode Camera mode: 0 = auto, 1 = manual
* @param trigger_pin Trigger pin, 0-3 for PtGrey FireFly
* @param interval Shutter interval, in microseconds
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_cam_shutter_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t cam_no, uint8_t cam_mode, uint8_t trigger_pin, uint16_t interval, uint16_t exposure, float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[11];
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
memcpy(_MAV_PAYLOAD(msg), buf, 11);
#else
mavlink_set_cam_shutter_t packet;
packet.gain = gain;
packet.interval = interval;
packet.exposure = exposure;
packet.cam_no = cam_no;
packet.cam_mode = cam_mode;
packet.trigger_pin = trigger_pin;
memcpy(_MAV_PAYLOAD(msg), &packet, 11);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_CAM_SHUTTER;
return mavlink_finalize_message(msg, system_id, component_id, 11, 108);
}
/**
* @brief Pack a set_cam_shutter 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param cam_no Camera id
* @param cam_mode Camera mode: 0 = auto, 1 = manual
* @param trigger_pin Trigger pin, 0-3 for PtGrey FireFly
* @param interval Shutter interval, in microseconds
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_cam_shutter_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t cam_no,uint8_t cam_mode,uint8_t trigger_pin,uint16_t interval,uint16_t exposure,float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[11];
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
memcpy(_MAV_PAYLOAD(msg), buf, 11);
#else
mavlink_set_cam_shutter_t packet;
packet.gain = gain;
packet.interval = interval;
packet.exposure = exposure;
packet.cam_no = cam_no;
packet.cam_mode = cam_mode;
packet.trigger_pin = trigger_pin;
memcpy(_MAV_PAYLOAD(msg), &packet, 11);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_CAM_SHUTTER;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 11, 108);
}
/**
* @brief Encode a set_cam_shutter 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 set_cam_shutter C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_cam_shutter_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_cam_shutter_t* set_cam_shutter)
{
return mavlink_msg_set_cam_shutter_pack(system_id, component_id, msg, set_cam_shutter->cam_no, set_cam_shutter->cam_mode, set_cam_shutter->trigger_pin, set_cam_shutter->interval, set_cam_shutter->exposure, set_cam_shutter->gain);
}
/**
* @brief Send a set_cam_shutter message
* @param chan MAVLink channel to send the message
*
* @param cam_no Camera id
* @param cam_mode Camera mode: 0 = auto, 1 = manual
* @param trigger_pin Trigger pin, 0-3 for PtGrey FireFly
* @param interval Shutter interval, in microseconds
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_cam_shutter_send(mavlink_channel_t chan, uint8_t cam_no, uint8_t cam_mode, uint8_t trigger_pin, uint16_t interval, uint16_t exposure, float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[11];
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, buf, 11, 108);
#else
mavlink_set_cam_shutter_t packet;
packet.gain = gain;
packet.interval = interval;
packet.exposure = exposure;
packet.cam_no = cam_no;
packet.cam_mode = cam_mode;
packet.trigger_pin = trigger_pin;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, (const char *)&packet, 11, 108);
#endif
}
#endif
// MESSAGE SET_CAM_SHUTTER UNPACKING
/**
* @brief Get field cam_no from set_cam_shutter message
*
* @return Camera id
*/
static inline uint8_t mavlink_msg_set_cam_shutter_get_cam_no(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Get field cam_mode from set_cam_shutter message
*
* @return Camera mode: 0 = auto, 1 = manual
*/
static inline uint8_t mavlink_msg_set_cam_shutter_get_cam_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 9);
}
/**
* @brief Get field trigger_pin from set_cam_shutter message
*
* @return Trigger pin, 0-3 for PtGrey FireFly
*/
static inline uint8_t mavlink_msg_set_cam_shutter_get_trigger_pin(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field interval from set_cam_shutter message
*
* @return Shutter interval, in microseconds
*/
static inline uint16_t mavlink_msg_set_cam_shutter_get_interval(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field exposure from set_cam_shutter message
*
* @return Exposure time, in microseconds
*/
static inline uint16_t mavlink_msg_set_cam_shutter_get_exposure(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field gain from set_cam_shutter message
*
* @return Camera gain
*/
static inline float mavlink_msg_set_cam_shutter_get_gain(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Decode a set_cam_shutter message into a struct
*
* @param msg The message to decode
* @param set_cam_shutter C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_cam_shutter_decode(const mavlink_message_t* msg, mavlink_set_cam_shutter_t* set_cam_shutter)
{
#if MAVLINK_NEED_BYTE_SWAP
set_cam_shutter->gain = mavlink_msg_set_cam_shutter_get_gain(msg);
set_cam_shutter->interval = mavlink_msg_set_cam_shutter_get_interval(msg);
set_cam_shutter->exposure = mavlink_msg_set_cam_shutter_get_exposure(msg);
set_cam_shutter->cam_no = mavlink_msg_set_cam_shutter_get_cam_no(msg);
set_cam_shutter->cam_mode = mavlink_msg_set_cam_shutter_get_cam_mode(msg);
set_cam_shutter->trigger_pin = mavlink_msg_set_cam_shutter_get_trigger_pin(msg);
#else
memcpy(set_cam_shutter, _MAV_PAYLOAD(msg), 11);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE VICON_POSITION_ESTIMATE PACKING
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 157
typedef struct __mavlink_vicon_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_vicon_position_estimate_t;
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_ID_157_LEN 32
#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \
"VICON_POSITION_ESTIMATE", \
7, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) }, \
} \
}
/**
* @brief Pack a vicon_position_estimate 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 usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 32, 56);
}
/**
* @brief Pack a vicon_position_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 56);
}
/**
* @brief Encode a vicon_position_estimate 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 vicon_position_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
{
return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw);
}
/**
* @brief Send a vicon_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, 32, 56);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, 32, 56);
#endif
}
#endif
// MESSAGE VICON_POSITION_ESTIMATE UNPACKING
/**
* @brief Get field usec from vicon_position_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from vicon_position_estimate message
*
* @return Global X position
*/
static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from vicon_position_estimate message
*
* @return Global Y position
*/
static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from vicon_position_estimate message
*
* @return Global Z position
*/
static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field roll from vicon_position_estimate message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field pitch from vicon_position_estimate message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field yaw from vicon_position_estimate message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a vicon_position_estimate message into a struct
*
* @param msg The message to decode
* @param vicon_position_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_vicon_position_estimate_decode(const mavlink_message_t* msg, mavlink_vicon_position_estimate_t* vicon_position_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
vicon_position_estimate->usec = mavlink_msg_vicon_position_estimate_get_usec(msg);
vicon_position_estimate->x = mavlink_msg_vicon_position_estimate_get_x(msg);
vicon_position_estimate->y = mavlink_msg_vicon_position_estimate_get_y(msg);
vicon_position_estimate->z = mavlink_msg_vicon_position_estimate_get_z(msg);
vicon_position_estimate->roll = mavlink_msg_vicon_position_estimate_get_roll(msg);
vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg);
vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg);
#else
memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), 32);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE VISION_POSITION_ESTIMATE PACKING
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 156
typedef struct __mavlink_vision_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_vision_position_estimate_t;
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_ID_156_LEN 32
#define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \
"VISION_POSITION_ESTIMATE", \
7, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
} \
}
/**
* @brief Pack a vision_position_estimate 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 usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 32, 158);
}
/**
* @brief Pack a vision_position_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 158);
}
/**
* @brief Encode a vision_position_estimate 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 vision_position_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
{
return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw);
}
/**
* @brief Send a vision_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_float(buf, 20, roll);
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, 32, 158);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, 32, 158);
#endif
}
#endif
// MESSAGE VISION_POSITION_ESTIMATE UNPACKING
/**
* @brief Get field usec from vision_position_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from vision_position_estimate message
*
* @return Global X position
*/
static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from vision_position_estimate message
*
* @return Global Y position
*/
static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from vision_position_estimate message
*
* @return Global Z position
*/
static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field roll from vision_position_estimate message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field pitch from vision_position_estimate message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field yaw from vision_position_estimate message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a vision_position_estimate message into a struct
*
* @param msg The message to decode
* @param vision_position_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_vision_position_estimate_t* vision_position_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
vision_position_estimate->usec = mavlink_msg_vision_position_estimate_get_usec(msg);
vision_position_estimate->x = mavlink_msg_vision_position_estimate_get_x(msg);
vision_position_estimate->y = mavlink_msg_vision_position_estimate_get_y(msg);
vision_position_estimate->z = mavlink_msg_vision_position_estimate_get_z(msg);
vision_position_estimate->roll = mavlink_msg_vision_position_estimate_get_roll(msg);
vision_position_estimate->pitch = mavlink_msg_vision_position_estimate_get_pitch(msg);
vision_position_estimate->yaw = mavlink_msg_vision_position_estimate_get_yaw(msg);
#else
memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), 32);
#endif
}

View File

@ -0,0 +1,210 @@
// MESSAGE VISION_SPEED_ESTIMATE PACKING
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 158
typedef struct __mavlink_vision_speed_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X speed
float y; ///< Global Y speed
float z; ///< Global Z speed
} mavlink_vision_speed_estimate_t;
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20
#define MAVLINK_MSG_ID_158_LEN 20
#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
"VISION_SPEED_ESTIMATE", \
4, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \
} \
}
/**
* @brief Pack a vision_speed_estimate 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 usec Timestamp (milliseconds)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float x, float y, float z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
return mavlink_finalize_message(msg, system_id, component_id, 20, 208);
}
/**
* @brief Pack a vision_speed_estimate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float x,float y,float z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 208);
}
/**
* @brief Encode a vision_speed_estimate 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 vision_speed_estimate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
{
return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z);
}
/**
* @brief Send a vision_speed_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, 20, 208);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
packet.x = x;
packet.y = y;
packet.z = z;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, 20, 208);
#endif
}
#endif
// MESSAGE VISION_SPEED_ESTIMATE UNPACKING
/**
* @brief Get field usec from vision_speed_estimate message
*
* @return Timestamp (milliseconds)
*/
static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field x from vision_speed_estimate message
*
* @return Global X speed
*/
static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field y from vision_speed_estimate message
*
* @return Global Y speed
*/
static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field z from vision_speed_estimate message
*
* @return Global Z speed
*/
static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Decode a vision_speed_estimate message into a struct
*
* @param msg The message to decode
* @param vision_speed_estimate C-struct to decode the message contents into
*/
static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_message_t* msg, mavlink_vision_speed_estimate_t* vision_speed_estimate)
{
#if MAVLINK_NEED_BYTE_SWAP
vision_speed_estimate->usec = mavlink_msg_vision_speed_estimate_get_usec(msg);
vision_speed_estimate->x = mavlink_msg_vision_speed_estimate_get_x(msg);
vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg);
vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg);
#else
memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), 20);
#endif
}

View File

@ -0,0 +1,210 @@
// MESSAGE WATCHDOG_COMMAND PACKING
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND 183
typedef struct __mavlink_watchdog_command_t
{
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
uint8_t target_system_id; ///< Target system ID
uint8_t command_id; ///< Command ID
} mavlink_watchdog_command_t;
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN 6
#define MAVLINK_MSG_ID_183_LEN 6
#define MAVLINK_MESSAGE_INFO_WATCHDOG_COMMAND { \
"WATCHDOG_COMMAND", \
4, \
{ { "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_watchdog_command_t, watchdog_id) }, \
{ "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_watchdog_command_t, process_id) }, \
{ "target_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_watchdog_command_t, target_system_id) }, \
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_watchdog_command_t, command_id) }, \
} \
}
/**
* @brief Pack a watchdog_command message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target_system_id Target system ID
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param command_id Command ID
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_command_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system_id, uint16_t watchdog_id, uint16_t process_id, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
#else
mavlink_watchdog_command_t packet;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.target_system_id = target_system_id;
packet.command_id = command_id;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_COMMAND;
return mavlink_finalize_message(msg, system_id, component_id, 6, 162);
}
/**
* @brief Pack a watchdog_command 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system_id Target system ID
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param command_id Command ID
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_command_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system_id,uint16_t watchdog_id,uint16_t process_id,uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
#else
mavlink_watchdog_command_t packet;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.target_system_id = target_system_id;
packet.command_id = command_id;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_COMMAND;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 162);
}
/**
* @brief Encode a watchdog_command 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 watchdog_command C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_command_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_command_t* watchdog_command)
{
return mavlink_msg_watchdog_command_pack(system_id, component_id, msg, watchdog_command->target_system_id, watchdog_command->watchdog_id, watchdog_command->process_id, watchdog_command->command_id);
}
/**
* @brief Send a watchdog_command message
* @param chan MAVLink channel to send the message
*
* @param target_system_id Target system ID
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param command_id Command ID
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_command_send(mavlink_channel_t chan, uint8_t target_system_id, uint16_t watchdog_id, uint16_t process_id, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, buf, 6, 162);
#else
mavlink_watchdog_command_t packet;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.target_system_id = target_system_id;
packet.command_id = command_id;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, (const char *)&packet, 6, 162);
#endif
}
#endif
// MESSAGE WATCHDOG_COMMAND UNPACKING
/**
* @brief Get field target_system_id from watchdog_command message
*
* @return Target system ID
*/
static inline uint8_t mavlink_msg_watchdog_command_get_target_system_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field watchdog_id from watchdog_command message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_command_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field process_id from watchdog_command message
*
* @return Process ID
*/
static inline uint16_t mavlink_msg_watchdog_command_get_process_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field command_id from watchdog_command message
*
* @return Command ID
*/
static inline uint8_t mavlink_msg_watchdog_command_get_command_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Decode a watchdog_command message into a struct
*
* @param msg The message to decode
* @param watchdog_command C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_command_decode(const mavlink_message_t* msg, mavlink_watchdog_command_t* watchdog_command)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_command->watchdog_id = mavlink_msg_watchdog_command_get_watchdog_id(msg);
watchdog_command->process_id = mavlink_msg_watchdog_command_get_process_id(msg);
watchdog_command->target_system_id = mavlink_msg_watchdog_command_get_target_system_id(msg);
watchdog_command->command_id = mavlink_msg_watchdog_command_get_command_id(msg);
#else
memcpy(watchdog_command, _MAV_PAYLOAD(msg), 6);
#endif
}

View File

@ -0,0 +1,166 @@
// MESSAGE WATCHDOG_HEARTBEAT PACKING
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT 180
typedef struct __mavlink_watchdog_heartbeat_t
{
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_count; ///< Number of processes
} mavlink_watchdog_heartbeat_t;
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN 4
#define MAVLINK_MSG_ID_180_LEN 4
#define MAVLINK_MESSAGE_INFO_WATCHDOG_HEARTBEAT { \
"WATCHDOG_HEARTBEAT", \
2, \
{ { "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_watchdog_heartbeat_t, watchdog_id) }, \
{ "process_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_watchdog_heartbeat_t, process_count) }, \
} \
}
/**
* @brief Pack a watchdog_heartbeat 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 watchdog_id Watchdog ID
* @param process_count Number of processes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t watchdog_id, uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_watchdog_heartbeat_t packet;
packet.watchdog_id = watchdog_id;
packet.process_count = process_count;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT;
return mavlink_finalize_message(msg, system_id, component_id, 4, 153);
}
/**
* @brief Pack a watchdog_heartbeat 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param watchdog_id Watchdog ID
* @param process_count Number of processes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t watchdog_id,uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_watchdog_heartbeat_t packet;
packet.watchdog_id = watchdog_id;
packet.process_count = process_count;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 153);
}
/**
* @brief Encode a watchdog_heartbeat 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 watchdog_heartbeat C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_heartbeat_t* watchdog_heartbeat)
{
return mavlink_msg_watchdog_heartbeat_pack(system_id, component_id, msg, watchdog_heartbeat->watchdog_id, watchdog_heartbeat->process_count);
}
/**
* @brief Send a watchdog_heartbeat message
* @param chan MAVLink channel to send the message
*
* @param watchdog_id Watchdog ID
* @param process_count Number of processes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_heartbeat_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, buf, 4, 153);
#else
mavlink_watchdog_heartbeat_t packet;
packet.watchdog_id = watchdog_id;
packet.process_count = process_count;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, (const char *)&packet, 4, 153);
#endif
}
#endif
// MESSAGE WATCHDOG_HEARTBEAT UNPACKING
/**
* @brief Get field watchdog_id from watchdog_heartbeat message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field process_count from watchdog_heartbeat message
*
* @return Number of processes
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_get_process_count(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Decode a watchdog_heartbeat message into a struct
*
* @param msg The message to decode
* @param watchdog_heartbeat C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_heartbeat_decode(const mavlink_message_t* msg, mavlink_watchdog_heartbeat_t* watchdog_heartbeat)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_heartbeat->watchdog_id = mavlink_msg_watchdog_heartbeat_get_watchdog_id(msg);
watchdog_heartbeat->process_count = mavlink_msg_watchdog_heartbeat_get_process_count(msg);
#else
memcpy(watchdog_heartbeat, _MAV_PAYLOAD(msg), 4);
#endif
}

View File

@ -0,0 +1,227 @@
// MESSAGE WATCHDOG_PROCESS_INFO PACKING
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO 181
typedef struct __mavlink_watchdog_process_info_t
{
int32_t timeout; ///< Timeout (seconds)
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
char name[100]; ///< Process name
char arguments[147]; ///< Process arguments
} mavlink_watchdog_process_info_t;
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN 255
#define MAVLINK_MSG_ID_181_LEN 255
#define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_NAME_LEN 100
#define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_ARGUMENTS_LEN 147
#define MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_INFO { \
"WATCHDOG_PROCESS_INFO", \
5, \
{ { "timeout", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_watchdog_process_info_t, timeout) }, \
{ "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_watchdog_process_info_t, watchdog_id) }, \
{ "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_watchdog_process_info_t, process_id) }, \
{ "name", NULL, MAVLINK_TYPE_CHAR, 100, 8, offsetof(mavlink_watchdog_process_info_t, name) }, \
{ "arguments", NULL, MAVLINK_TYPE_CHAR, 147, 108, offsetof(mavlink_watchdog_process_info_t, arguments) }, \
} \
}
/**
* @brief Pack a watchdog_process_info 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 watchdog_id Watchdog ID
* @param process_id Process ID
* @param name Process name
* @param arguments Process arguments
* @param timeout Timeout (seconds)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_info_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[255];
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
memcpy(_MAV_PAYLOAD(msg), buf, 255);
#else
mavlink_watchdog_process_info_t packet;
packet.timeout = timeout;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
memcpy(packet.name, name, sizeof(char)*100);
memcpy(packet.arguments, arguments, sizeof(char)*147);
memcpy(_MAV_PAYLOAD(msg), &packet, 255);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO;
return mavlink_finalize_message(msg, system_id, component_id, 255, 16);
}
/**
* @brief Pack a watchdog_process_info 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param name Process name
* @param arguments Process arguments
* @param timeout Timeout (seconds)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_info_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t watchdog_id,uint16_t process_id,const char *name,const char *arguments,int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[255];
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
memcpy(_MAV_PAYLOAD(msg), buf, 255);
#else
mavlink_watchdog_process_info_t packet;
packet.timeout = timeout;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
memcpy(packet.name, name, sizeof(char)*100);
memcpy(packet.arguments, arguments, sizeof(char)*147);
memcpy(_MAV_PAYLOAD(msg), &packet, 255);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 255, 16);
}
/**
* @brief Encode a watchdog_process_info 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 watchdog_process_info C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_process_info_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_process_info_t* watchdog_process_info)
{
return mavlink_msg_watchdog_process_info_pack(system_id, component_id, msg, watchdog_process_info->watchdog_id, watchdog_process_info->process_id, watchdog_process_info->name, watchdog_process_info->arguments, watchdog_process_info->timeout);
}
/**
* @brief Send a watchdog_process_info message
* @param chan MAVLink channel to send the message
*
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param name Process name
* @param arguments Process arguments
* @param timeout Timeout (seconds)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_process_info_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[255];
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, 255, 16);
#else
mavlink_watchdog_process_info_t packet;
packet.timeout = timeout;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
memcpy(packet.name, name, sizeof(char)*100);
memcpy(packet.arguments, arguments, sizeof(char)*147);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)&packet, 255, 16);
#endif
}
#endif
// MESSAGE WATCHDOG_PROCESS_INFO UNPACKING
/**
* @brief Get field watchdog_id from watchdog_process_info message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field process_id from watchdog_process_info message
*
* @return Process ID
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_process_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field name from watchdog_process_info message
*
* @return Process name
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_name(const mavlink_message_t* msg, char *name)
{
return _MAV_RETURN_char_array(msg, name, 100, 8);
}
/**
* @brief Get field arguments from watchdog_process_info message
*
* @return Process arguments
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_arguments(const mavlink_message_t* msg, char *arguments)
{
return _MAV_RETURN_char_array(msg, arguments, 147, 108);
}
/**
* @brief Get field timeout from watchdog_process_info message
*
* @return Timeout (seconds)
*/
static inline int32_t mavlink_msg_watchdog_process_info_get_timeout(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Decode a watchdog_process_info message into a struct
*
* @param msg The message to decode
* @param watchdog_process_info C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_process_info_decode(const mavlink_message_t* msg, mavlink_watchdog_process_info_t* watchdog_process_info)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_process_info->timeout = mavlink_msg_watchdog_process_info_get_timeout(msg);
watchdog_process_info->watchdog_id = mavlink_msg_watchdog_process_info_get_watchdog_id(msg);
watchdog_process_info->process_id = mavlink_msg_watchdog_process_info_get_process_id(msg);
mavlink_msg_watchdog_process_info_get_name(msg, watchdog_process_info->name);
mavlink_msg_watchdog_process_info_get_arguments(msg, watchdog_process_info->arguments);
#else
memcpy(watchdog_process_info, _MAV_PAYLOAD(msg), 255);
#endif
}

View File

@ -0,0 +1,254 @@
// MESSAGE WATCHDOG_PROCESS_STATUS PACKING
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS 182
typedef struct __mavlink_watchdog_process_status_t
{
int32_t pid; ///< PID
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
uint16_t crashes; ///< Number of crashes
uint8_t state; ///< Is running / finished / suspended / crashed
uint8_t muted; ///< Is muted
} mavlink_watchdog_process_status_t;
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN 12
#define MAVLINK_MSG_ID_182_LEN 12
#define MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_STATUS { \
"WATCHDOG_PROCESS_STATUS", \
6, \
{ { "pid", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_watchdog_process_status_t, pid) }, \
{ "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_watchdog_process_status_t, watchdog_id) }, \
{ "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_watchdog_process_status_t, process_id) }, \
{ "crashes", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_watchdog_process_status_t, crashes) }, \
{ "state", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_watchdog_process_status_t, state) }, \
{ "muted", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_watchdog_process_status_t, muted) }, \
} \
}
/**
* @brief Pack a watchdog_process_status 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 watchdog_id Watchdog ID
* @param process_id Process ID
* @param state Is running / finished / suspended / crashed
* @param muted Is muted
* @param pid PID
* @param crashes Number of crashes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
memcpy(_MAV_PAYLOAD(msg), buf, 12);
#else
mavlink_watchdog_process_status_t packet;
packet.pid = pid;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.crashes = crashes;
packet.state = state;
packet.muted = muted;
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS;
return mavlink_finalize_message(msg, system_id, component_id, 12, 29);
}
/**
* @brief Pack a watchdog_process_status 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param state Is running / finished / suspended / crashed
* @param muted Is muted
* @param pid PID
* @param crashes Number of crashes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t watchdog_id,uint16_t process_id,uint8_t state,uint8_t muted,int32_t pid,uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
memcpy(_MAV_PAYLOAD(msg), buf, 12);
#else
mavlink_watchdog_process_status_t packet;
packet.pid = pid;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.crashes = crashes;
packet.state = state;
packet.muted = muted;
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 29);
}
/**
* @brief Encode a watchdog_process_status 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 watchdog_process_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_process_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_process_status_t* watchdog_process_status)
{
return mavlink_msg_watchdog_process_status_pack(system_id, component_id, msg, watchdog_process_status->watchdog_id, watchdog_process_status->process_id, watchdog_process_status->state, watchdog_process_status->muted, watchdog_process_status->pid, watchdog_process_status->crashes);
}
/**
* @brief Send a watchdog_process_status message
* @param chan MAVLink channel to send the message
*
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param state Is running / finished / suspended / crashed
* @param muted Is muted
* @param pid PID
* @param crashes Number of crashes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_process_status_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, 12, 29);
#else
mavlink_watchdog_process_status_t packet;
packet.pid = pid;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.crashes = crashes;
packet.state = state;
packet.muted = muted;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)&packet, 12, 29);
#endif
}
#endif
// MESSAGE WATCHDOG_PROCESS_STATUS UNPACKING
/**
* @brief Get field watchdog_id from watchdog_process_status message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_process_status_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field process_id from watchdog_process_status message
*
* @return Process ID
*/
static inline uint16_t mavlink_msg_watchdog_process_status_get_process_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field state from watchdog_process_status message
*
* @return Is running / finished / suspended / crashed
*/
static inline uint8_t mavlink_msg_watchdog_process_status_get_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field muted from watchdog_process_status message
*
* @return Is muted
*/
static inline uint8_t mavlink_msg_watchdog_process_status_get_muted(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 11);
}
/**
* @brief Get field pid from watchdog_process_status message
*
* @return PID
*/
static inline int32_t mavlink_msg_watchdog_process_status_get_pid(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Get field crashes from watchdog_process_status message
*
* @return Number of crashes
*/
static inline uint16_t mavlink_msg_watchdog_process_status_get_crashes(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Decode a watchdog_process_status message into a struct
*
* @param msg The message to decode
* @param watchdog_process_status C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_process_status_decode(const mavlink_message_t* msg, mavlink_watchdog_process_status_t* watchdog_process_status)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_process_status->pid = mavlink_msg_watchdog_process_status_get_pid(msg);
watchdog_process_status->watchdog_id = mavlink_msg_watchdog_process_status_get_watchdog_id(msg);
watchdog_process_status->process_id = mavlink_msg_watchdog_process_status_get_process_id(msg);
watchdog_process_status->crashes = mavlink_msg_watchdog_process_status_get_crashes(msg);
watchdog_process_status->state = mavlink_msg_watchdog_process_status_get_state(msg);
watchdog_process_status->muted = mavlink_msg_watchdog_process_status_get_muted(msg);
#else
memcpy(watchdog_process_status, _MAV_PAYLOAD(msg), 12);
#endif
}

View File

@ -0,0 +1,80 @@
/** @file
* @brief MAVLink comm protocol generated from pixhawk.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef PIXHAWK_H
#define PIXHAWK_H
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 52, 1, 92, 0, 0, 0, 0, 20, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 26, 16, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 0, 0, 0, 0, 0, 0, 106, 43, 55, 8, 255, 53, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 86, 95, 224, 0, 0, 0, 0, 11, 244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 249, 182, 0, 0, 0, 0, 0, 0, 0, 153, 16, 29, 162, 0, 0, 0, 0, 0, 0, 90, 95, 36, 148, 223, 88, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_CAM_SHUTTER, MAVLINK_MESSAGE_INFO_IMAGE_TRIGGERED, MAVLINK_MESSAGE_INFO_IMAGE_TRIGGER_CONTROL, MAVLINK_MESSAGE_INFO_IMAGE_AVAILABLE, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_POSITION_CONTROL_SETPOINT_SET, MAVLINK_MESSAGE_INFO_POSITION_CONTROL_OFFSET_SET, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_POSITION_CONTROL_SETPOINT, MAVLINK_MESSAGE_INFO_MARKER, MAVLINK_MESSAGE_INFO_RAW_AUX, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_WATCHDOG_HEARTBEAT, MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_INFO, MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_STATUS, MAVLINK_MESSAGE_INFO_WATCHDOG_COMMAND, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PATTERN_DETECTED, MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST, MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST_CONNECTION, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_BRIEF_FEATURE, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_ATTITUDE_CONTROL, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_PIXHAWK
#include "../common/common.h"
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
// ENUM DEFINITIONS
/** @brief Content Types for data transmission handshake */
enum DATA_TYPES
{
DATA_TYPE_JPEG_IMAGE=1, /* | */
DATA_TYPE_RAW_IMAGE=2, /* | */
DATA_TYPE_KINECT=3, /* | */
DATA_TYPES_ENUM_END=4, /* | */
};
// MESSAGE DEFINITIONS
#include "./mavlink_msg_set_cam_shutter.h"
#include "./mavlink_msg_image_triggered.h"
#include "./mavlink_msg_image_trigger_control.h"
#include "./mavlink_msg_image_available.h"
#include "./mavlink_msg_position_control_setpoint_set.h"
#include "./mavlink_msg_position_control_offset_set.h"
#include "./mavlink_msg_position_control_setpoint.h"
#include "./mavlink_msg_marker.h"
#include "./mavlink_msg_raw_aux.h"
#include "./mavlink_msg_watchdog_heartbeat.h"
#include "./mavlink_msg_watchdog_process_info.h"
#include "./mavlink_msg_watchdog_process_status.h"
#include "./mavlink_msg_watchdog_command.h"
#include "./mavlink_msg_pattern_detected.h"
#include "./mavlink_msg_point_of_interest.h"
#include "./mavlink_msg_point_of_interest_connection.h"
#include "./mavlink_msg_data_transmission_handshake.h"
#include "./mavlink_msg_encapsulated_data.h"
#include "./mavlink_msg_brief_feature.h"
#include "./mavlink_msg_attitude_control.h"
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // PIXHAWK_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
/** @file
* @brief MAVLink comm protocol built from pixhawk.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:39 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
#endif // MAVLINK_VERSION_H

View File

@ -0,0 +1,27 @@
/** @file
* @brief MAVLink comm protocol built from slugs.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "slugs.h"
#endif // MAVLINK_H

View File

@ -0,0 +1,188 @@
// MESSAGE AIR_DATA PACKING
#define MAVLINK_MSG_ID_AIR_DATA 171
typedef struct __mavlink_air_data_t
{
float dynamicPressure; ///< Dynamic pressure (Pa)
float staticPressure; ///< Static pressure (Pa)
uint16_t temperature; ///< Board temperature
} mavlink_air_data_t;
#define MAVLINK_MSG_ID_AIR_DATA_LEN 10
#define MAVLINK_MSG_ID_171_LEN 10
#define MAVLINK_MESSAGE_INFO_AIR_DATA { \
"AIR_DATA", \
3, \
{ { "dynamicPressure", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_air_data_t, dynamicPressure) }, \
{ "staticPressure", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_air_data_t, staticPressure) }, \
{ "temperature", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_air_data_t, temperature) }, \
} \
}
/**
* @brief Pack a air_data 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 dynamicPressure Dynamic pressure (Pa)
* @param staticPressure Static pressure (Pa)
* @param temperature Board temperature
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_air_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float dynamicPressure, float staticPressure, uint16_t temperature)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[10];
_mav_put_float(buf, 0, dynamicPressure);
_mav_put_float(buf, 4, staticPressure);
_mav_put_uint16_t(buf, 8, temperature);
memcpy(_MAV_PAYLOAD(msg), buf, 10);
#else
mavlink_air_data_t packet;
packet.dynamicPressure = dynamicPressure;
packet.staticPressure = staticPressure;
packet.temperature = temperature;
memcpy(_MAV_PAYLOAD(msg), &packet, 10);
#endif
msg->msgid = MAVLINK_MSG_ID_AIR_DATA;
return mavlink_finalize_message(msg, system_id, component_id, 10, 232);
}
/**
* @brief Pack a air_data 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param dynamicPressure Dynamic pressure (Pa)
* @param staticPressure Static pressure (Pa)
* @param temperature Board temperature
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_air_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float dynamicPressure,float staticPressure,uint16_t temperature)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[10];
_mav_put_float(buf, 0, dynamicPressure);
_mav_put_float(buf, 4, staticPressure);
_mav_put_uint16_t(buf, 8, temperature);
memcpy(_MAV_PAYLOAD(msg), buf, 10);
#else
mavlink_air_data_t packet;
packet.dynamicPressure = dynamicPressure;
packet.staticPressure = staticPressure;
packet.temperature = temperature;
memcpy(_MAV_PAYLOAD(msg), &packet, 10);
#endif
msg->msgid = MAVLINK_MSG_ID_AIR_DATA;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 10, 232);
}
/**
* @brief Encode a air_data 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 air_data C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_air_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_air_data_t* air_data)
{
return mavlink_msg_air_data_pack(system_id, component_id, msg, air_data->dynamicPressure, air_data->staticPressure, air_data->temperature);
}
/**
* @brief Send a air_data message
* @param chan MAVLink channel to send the message
*
* @param dynamicPressure Dynamic pressure (Pa)
* @param staticPressure Static pressure (Pa)
* @param temperature Board temperature
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_air_data_send(mavlink_channel_t chan, float dynamicPressure, float staticPressure, uint16_t temperature)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[10];
_mav_put_float(buf, 0, dynamicPressure);
_mav_put_float(buf, 4, staticPressure);
_mav_put_uint16_t(buf, 8, temperature);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIR_DATA, buf, 10, 232);
#else
mavlink_air_data_t packet;
packet.dynamicPressure = dynamicPressure;
packet.staticPressure = staticPressure;
packet.temperature = temperature;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIR_DATA, (const char *)&packet, 10, 232);
#endif
}
#endif
// MESSAGE AIR_DATA UNPACKING
/**
* @brief Get field dynamicPressure from air_data message
*
* @return Dynamic pressure (Pa)
*/
static inline float mavlink_msg_air_data_get_dynamicPressure(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field staticPressure from air_data message
*
* @return Static pressure (Pa)
*/
static inline float mavlink_msg_air_data_get_staticPressure(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field temperature from air_data message
*
* @return Board temperature
*/
static inline uint16_t mavlink_msg_air_data_get_temperature(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Decode a air_data message into a struct
*
* @param msg The message to decode
* @param air_data C-struct to decode the message contents into
*/
static inline void mavlink_msg_air_data_decode(const mavlink_message_t* msg, mavlink_air_data_t* air_data)
{
#if MAVLINK_NEED_BYTE_SWAP
air_data->dynamicPressure = mavlink_msg_air_data_get_dynamicPressure(msg);
air_data->staticPressure = mavlink_msg_air_data_get_staticPressure(msg);
air_data->temperature = mavlink_msg_air_data_get_temperature(msg);
#else
memcpy(air_data, _MAV_PAYLOAD(msg), 10);
#endif
}

View File

@ -0,0 +1,188 @@
// MESSAGE CPU_LOAD PACKING
#define MAVLINK_MSG_ID_CPU_LOAD 170
typedef struct __mavlink_cpu_load_t
{
uint16_t batVolt; ///< Battery Voltage in millivolts
uint8_t sensLoad; ///< Sensor DSC Load
uint8_t ctrlLoad; ///< Control DSC Load
} mavlink_cpu_load_t;
#define MAVLINK_MSG_ID_CPU_LOAD_LEN 4
#define MAVLINK_MSG_ID_170_LEN 4
#define MAVLINK_MESSAGE_INFO_CPU_LOAD { \
"CPU_LOAD", \
3, \
{ { "batVolt", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_cpu_load_t, batVolt) }, \
{ "sensLoad", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_cpu_load_t, sensLoad) }, \
{ "ctrlLoad", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_cpu_load_t, ctrlLoad) }, \
} \
}
/**
* @brief Pack a cpu_load 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 sensLoad Sensor DSC Load
* @param ctrlLoad Control DSC Load
* @param batVolt Battery Voltage in millivolts
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cpu_load_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t sensLoad, uint8_t ctrlLoad, uint16_t batVolt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, batVolt);
_mav_put_uint8_t(buf, 2, sensLoad);
_mav_put_uint8_t(buf, 3, ctrlLoad);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_cpu_load_t packet;
packet.batVolt = batVolt;
packet.sensLoad = sensLoad;
packet.ctrlLoad = ctrlLoad;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_CPU_LOAD;
return mavlink_finalize_message(msg, system_id, component_id, 4, 75);
}
/**
* @brief Pack a cpu_load 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param sensLoad Sensor DSC Load
* @param ctrlLoad Control DSC Load
* @param batVolt Battery Voltage in millivolts
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cpu_load_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t sensLoad,uint8_t ctrlLoad,uint16_t batVolt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, batVolt);
_mav_put_uint8_t(buf, 2, sensLoad);
_mav_put_uint8_t(buf, 3, ctrlLoad);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_cpu_load_t packet;
packet.batVolt = batVolt;
packet.sensLoad = sensLoad;
packet.ctrlLoad = ctrlLoad;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_CPU_LOAD;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 75);
}
/**
* @brief Encode a cpu_load 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 cpu_load C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_cpu_load_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cpu_load_t* cpu_load)
{
return mavlink_msg_cpu_load_pack(system_id, component_id, msg, cpu_load->sensLoad, cpu_load->ctrlLoad, cpu_load->batVolt);
}
/**
* @brief Send a cpu_load message
* @param chan MAVLink channel to send the message
*
* @param sensLoad Sensor DSC Load
* @param ctrlLoad Control DSC Load
* @param batVolt Battery Voltage in millivolts
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_cpu_load_send(mavlink_channel_t chan, uint8_t sensLoad, uint8_t ctrlLoad, uint16_t batVolt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, batVolt);
_mav_put_uint8_t(buf, 2, sensLoad);
_mav_put_uint8_t(buf, 3, ctrlLoad);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, buf, 4, 75);
#else
mavlink_cpu_load_t packet;
packet.batVolt = batVolt;
packet.sensLoad = sensLoad;
packet.ctrlLoad = ctrlLoad;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, (const char *)&packet, 4, 75);
#endif
}
#endif
// MESSAGE CPU_LOAD UNPACKING
/**
* @brief Get field sensLoad from cpu_load message
*
* @return Sensor DSC Load
*/
static inline uint8_t mavlink_msg_cpu_load_get_sensLoad(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field ctrlLoad from cpu_load message
*
* @return Control DSC Load
*/
static inline uint8_t mavlink_msg_cpu_load_get_ctrlLoad(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field batVolt from cpu_load message
*
* @return Battery Voltage in millivolts
*/
static inline uint16_t mavlink_msg_cpu_load_get_batVolt(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Decode a cpu_load message into a struct
*
* @param msg The message to decode
* @param cpu_load C-struct to decode the message contents into
*/
static inline void mavlink_msg_cpu_load_decode(const mavlink_message_t* msg, mavlink_cpu_load_t* cpu_load)
{
#if MAVLINK_NEED_BYTE_SWAP
cpu_load->batVolt = mavlink_msg_cpu_load_get_batVolt(msg);
cpu_load->sensLoad = mavlink_msg_cpu_load_get_sensLoad(msg);
cpu_load->ctrlLoad = mavlink_msg_cpu_load_get_ctrlLoad(msg);
#else
memcpy(cpu_load, _MAV_PAYLOAD(msg), 4);
#endif
}

View File

@ -0,0 +1,166 @@
// MESSAGE CTRL_SRFC_PT PACKING
#define MAVLINK_MSG_ID_CTRL_SRFC_PT 181
typedef struct __mavlink_ctrl_srfc_pt_t
{
uint16_t bitfieldPt; ///< Bitfield containing the PT configuration
uint8_t target; ///< The system setting the commands
} mavlink_ctrl_srfc_pt_t;
#define MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN 3
#define MAVLINK_MSG_ID_181_LEN 3
#define MAVLINK_MESSAGE_INFO_CTRL_SRFC_PT { \
"CTRL_SRFC_PT", \
2, \
{ { "bitfieldPt", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ctrl_srfc_pt_t, bitfieldPt) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_ctrl_srfc_pt_t, target) }, \
} \
}
/**
* @brief Pack a ctrl_srfc_pt message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system setting the commands
* @param bitfieldPt Bitfield containing the PT configuration
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ctrl_srfc_pt_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, uint16_t bitfieldPt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint16_t(buf, 0, bitfieldPt);
_mav_put_uint8_t(buf, 2, target);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_ctrl_srfc_pt_t packet;
packet.bitfieldPt = bitfieldPt;
packet.target = target;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_CTRL_SRFC_PT;
return mavlink_finalize_message(msg, system_id, component_id, 3, 104);
}
/**
* @brief Pack a ctrl_srfc_pt 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system setting the commands
* @param bitfieldPt Bitfield containing the PT configuration
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ctrl_srfc_pt_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,uint16_t bitfieldPt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint16_t(buf, 0, bitfieldPt);
_mav_put_uint8_t(buf, 2, target);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_ctrl_srfc_pt_t packet;
packet.bitfieldPt = bitfieldPt;
packet.target = target;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_CTRL_SRFC_PT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 104);
}
/**
* @brief Encode a ctrl_srfc_pt 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 ctrl_srfc_pt C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_ctrl_srfc_pt_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ctrl_srfc_pt_t* ctrl_srfc_pt)
{
return mavlink_msg_ctrl_srfc_pt_pack(system_id, component_id, msg, ctrl_srfc_pt->target, ctrl_srfc_pt->bitfieldPt);
}
/**
* @brief Send a ctrl_srfc_pt message
* @param chan MAVLink channel to send the message
*
* @param target The system setting the commands
* @param bitfieldPt Bitfield containing the PT configuration
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ctrl_srfc_pt_send(mavlink_channel_t chan, uint8_t target, uint16_t bitfieldPt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint16_t(buf, 0, bitfieldPt);
_mav_put_uint8_t(buf, 2, target);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, buf, 3, 104);
#else
mavlink_ctrl_srfc_pt_t packet;
packet.bitfieldPt = bitfieldPt;
packet.target = target;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, (const char *)&packet, 3, 104);
#endif
}
#endif
// MESSAGE CTRL_SRFC_PT UNPACKING
/**
* @brief Get field target from ctrl_srfc_pt message
*
* @return The system setting the commands
*/
static inline uint8_t mavlink_msg_ctrl_srfc_pt_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field bitfieldPt from ctrl_srfc_pt message
*
* @return Bitfield containing the PT configuration
*/
static inline uint16_t mavlink_msg_ctrl_srfc_pt_get_bitfieldPt(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Decode a ctrl_srfc_pt message into a struct
*
* @param msg The message to decode
* @param ctrl_srfc_pt C-struct to decode the message contents into
*/
static inline void mavlink_msg_ctrl_srfc_pt_decode(const mavlink_message_t* msg, mavlink_ctrl_srfc_pt_t* ctrl_srfc_pt)
{
#if MAVLINK_NEED_BYTE_SWAP
ctrl_srfc_pt->bitfieldPt = mavlink_msg_ctrl_srfc_pt_get_bitfieldPt(msg);
ctrl_srfc_pt->target = mavlink_msg_ctrl_srfc_pt_get_target(msg);
#else
memcpy(ctrl_srfc_pt, _MAV_PAYLOAD(msg), 3);
#endif
}

View File

@ -0,0 +1,254 @@
// MESSAGE DATA_LOG PACKING
#define MAVLINK_MSG_ID_DATA_LOG 177
typedef struct __mavlink_data_log_t
{
float fl_1; ///< Log value 1
float fl_2; ///< Log value 2
float fl_3; ///< Log value 3
float fl_4; ///< Log value 4
float fl_5; ///< Log value 5
float fl_6; ///< Log value 6
} mavlink_data_log_t;
#define MAVLINK_MSG_ID_DATA_LOG_LEN 24
#define MAVLINK_MSG_ID_177_LEN 24
#define MAVLINK_MESSAGE_INFO_DATA_LOG { \
"DATA_LOG", \
6, \
{ { "fl_1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_data_log_t, fl_1) }, \
{ "fl_2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_data_log_t, fl_2) }, \
{ "fl_3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_data_log_t, fl_3) }, \
{ "fl_4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_data_log_t, fl_4) }, \
{ "fl_5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_data_log_t, fl_5) }, \
{ "fl_6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_data_log_t, fl_6) }, \
} \
}
/**
* @brief Pack a data_log 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 fl_1 Log value 1
* @param fl_2 Log value 2
* @param fl_3 Log value 3
* @param fl_4 Log value 4
* @param fl_5 Log value 5
* @param fl_6 Log value 6
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_data_log_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float fl_1, float fl_2, float fl_3, float fl_4, float fl_5, float fl_6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float(buf, 0, fl_1);
_mav_put_float(buf, 4, fl_2);
_mav_put_float(buf, 8, fl_3);
_mav_put_float(buf, 12, fl_4);
_mav_put_float(buf, 16, fl_5);
_mav_put_float(buf, 20, fl_6);
memcpy(_MAV_PAYLOAD(msg), buf, 24);
#else
mavlink_data_log_t packet;
packet.fl_1 = fl_1;
packet.fl_2 = fl_2;
packet.fl_3 = fl_3;
packet.fl_4 = fl_4;
packet.fl_5 = fl_5;
packet.fl_6 = fl_6;
memcpy(_MAV_PAYLOAD(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_LOG;
return mavlink_finalize_message(msg, system_id, component_id, 24, 167);
}
/**
* @brief Pack a data_log 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param fl_1 Log value 1
* @param fl_2 Log value 2
* @param fl_3 Log value 3
* @param fl_4 Log value 4
* @param fl_5 Log value 5
* @param fl_6 Log value 6
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_data_log_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float fl_1,float fl_2,float fl_3,float fl_4,float fl_5,float fl_6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float(buf, 0, fl_1);
_mav_put_float(buf, 4, fl_2);
_mav_put_float(buf, 8, fl_3);
_mav_put_float(buf, 12, fl_4);
_mav_put_float(buf, 16, fl_5);
_mav_put_float(buf, 20, fl_6);
memcpy(_MAV_PAYLOAD(msg), buf, 24);
#else
mavlink_data_log_t packet;
packet.fl_1 = fl_1;
packet.fl_2 = fl_2;
packet.fl_3 = fl_3;
packet.fl_4 = fl_4;
packet.fl_5 = fl_5;
packet.fl_6 = fl_6;
memcpy(_MAV_PAYLOAD(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_LOG;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24, 167);
}
/**
* @brief Encode a data_log 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 data_log C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_data_log_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_log_t* data_log)
{
return mavlink_msg_data_log_pack(system_id, component_id, msg, data_log->fl_1, data_log->fl_2, data_log->fl_3, data_log->fl_4, data_log->fl_5, data_log->fl_6);
}
/**
* @brief Send a data_log message
* @param chan MAVLink channel to send the message
*
* @param fl_1 Log value 1
* @param fl_2 Log value 2
* @param fl_3 Log value 3
* @param fl_4 Log value 4
* @param fl_5 Log value 5
* @param fl_6 Log value 6
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_data_log_send(mavlink_channel_t chan, float fl_1, float fl_2, float fl_3, float fl_4, float fl_5, float fl_6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float(buf, 0, fl_1);
_mav_put_float(buf, 4, fl_2);
_mav_put_float(buf, 8, fl_3);
_mav_put_float(buf, 12, fl_4);
_mav_put_float(buf, 16, fl_5);
_mav_put_float(buf, 20, fl_6);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, buf, 24, 167);
#else
mavlink_data_log_t packet;
packet.fl_1 = fl_1;
packet.fl_2 = fl_2;
packet.fl_3 = fl_3;
packet.fl_4 = fl_4;
packet.fl_5 = fl_5;
packet.fl_6 = fl_6;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, (const char *)&packet, 24, 167);
#endif
}
#endif
// MESSAGE DATA_LOG UNPACKING
/**
* @brief Get field fl_1 from data_log message
*
* @return Log value 1
*/
static inline float mavlink_msg_data_log_get_fl_1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field fl_2 from data_log message
*
* @return Log value 2
*/
static inline float mavlink_msg_data_log_get_fl_2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field fl_3 from data_log message
*
* @return Log value 3
*/
static inline float mavlink_msg_data_log_get_fl_3(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field fl_4 from data_log message
*
* @return Log value 4
*/
static inline float mavlink_msg_data_log_get_fl_4(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field fl_5 from data_log message
*
* @return Log value 5
*/
static inline float mavlink_msg_data_log_get_fl_5(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field fl_6 from data_log message
*
* @return Log value 6
*/
static inline float mavlink_msg_data_log_get_fl_6(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a data_log message into a struct
*
* @param msg The message to decode
* @param data_log C-struct to decode the message contents into
*/
static inline void mavlink_msg_data_log_decode(const mavlink_message_t* msg, mavlink_data_log_t* data_log)
{
#if MAVLINK_NEED_BYTE_SWAP
data_log->fl_1 = mavlink_msg_data_log_get_fl_1(msg);
data_log->fl_2 = mavlink_msg_data_log_get_fl_2(msg);
data_log->fl_3 = mavlink_msg_data_log_get_fl_3(msg);
data_log->fl_4 = mavlink_msg_data_log_get_fl_4(msg);
data_log->fl_5 = mavlink_msg_data_log_get_fl_5(msg);
data_log->fl_6 = mavlink_msg_data_log_get_fl_6(msg);
#else
memcpy(data_log, _MAV_PAYLOAD(msg), 24);
#endif
}

View File

@ -0,0 +1,254 @@
// MESSAGE DIAGNOSTIC PACKING
#define MAVLINK_MSG_ID_DIAGNOSTIC 173
typedef struct __mavlink_diagnostic_t
{
float diagFl1; ///< Diagnostic float 1
float diagFl2; ///< Diagnostic float 2
float diagFl3; ///< Diagnostic float 3
int16_t diagSh1; ///< Diagnostic short 1
int16_t diagSh2; ///< Diagnostic short 2
int16_t diagSh3; ///< Diagnostic short 3
} mavlink_diagnostic_t;
#define MAVLINK_MSG_ID_DIAGNOSTIC_LEN 18
#define MAVLINK_MSG_ID_173_LEN 18
#define MAVLINK_MESSAGE_INFO_DIAGNOSTIC { \
"DIAGNOSTIC", \
6, \
{ { "diagFl1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_diagnostic_t, diagFl1) }, \
{ "diagFl2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_diagnostic_t, diagFl2) }, \
{ "diagFl3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_diagnostic_t, diagFl3) }, \
{ "diagSh1", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_diagnostic_t, diagSh1) }, \
{ "diagSh2", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_diagnostic_t, diagSh2) }, \
{ "diagSh3", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_diagnostic_t, diagSh3) }, \
} \
}
/**
* @brief Pack a diagnostic 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 diagFl1 Diagnostic float 1
* @param diagFl2 Diagnostic float 2
* @param diagFl3 Diagnostic float 3
* @param diagSh1 Diagnostic short 1
* @param diagSh2 Diagnostic short 2
* @param diagSh3 Diagnostic short 3
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_diagnostic_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float diagFl1, float diagFl2, float diagFl3, int16_t diagSh1, int16_t diagSh2, int16_t diagSh3)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, diagFl1);
_mav_put_float(buf, 4, diagFl2);
_mav_put_float(buf, 8, diagFl3);
_mav_put_int16_t(buf, 12, diagSh1);
_mav_put_int16_t(buf, 14, diagSh2);
_mav_put_int16_t(buf, 16, diagSh3);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
#else
mavlink_diagnostic_t packet;
packet.diagFl1 = diagFl1;
packet.diagFl2 = diagFl2;
packet.diagFl3 = diagFl3;
packet.diagSh1 = diagSh1;
packet.diagSh2 = diagSh2;
packet.diagSh3 = diagSh3;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_DIAGNOSTIC;
return mavlink_finalize_message(msg, system_id, component_id, 18, 2);
}
/**
* @brief Pack a diagnostic 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param diagFl1 Diagnostic float 1
* @param diagFl2 Diagnostic float 2
* @param diagFl3 Diagnostic float 3
* @param diagSh1 Diagnostic short 1
* @param diagSh2 Diagnostic short 2
* @param diagSh3 Diagnostic short 3
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_diagnostic_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float diagFl1,float diagFl2,float diagFl3,int16_t diagSh1,int16_t diagSh2,int16_t diagSh3)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, diagFl1);
_mav_put_float(buf, 4, diagFl2);
_mav_put_float(buf, 8, diagFl3);
_mav_put_int16_t(buf, 12, diagSh1);
_mav_put_int16_t(buf, 14, diagSh2);
_mav_put_int16_t(buf, 16, diagSh3);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
#else
mavlink_diagnostic_t packet;
packet.diagFl1 = diagFl1;
packet.diagFl2 = diagFl2;
packet.diagFl3 = diagFl3;
packet.diagSh1 = diagSh1;
packet.diagSh2 = diagSh2;
packet.diagSh3 = diagSh3;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_DIAGNOSTIC;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 2);
}
/**
* @brief Encode a diagnostic 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 diagnostic C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_diagnostic_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_diagnostic_t* diagnostic)
{
return mavlink_msg_diagnostic_pack(system_id, component_id, msg, diagnostic->diagFl1, diagnostic->diagFl2, diagnostic->diagFl3, diagnostic->diagSh1, diagnostic->diagSh2, diagnostic->diagSh3);
}
/**
* @brief Send a diagnostic message
* @param chan MAVLink channel to send the message
*
* @param diagFl1 Diagnostic float 1
* @param diagFl2 Diagnostic float 2
* @param diagFl3 Diagnostic float 3
* @param diagSh1 Diagnostic short 1
* @param diagSh2 Diagnostic short 2
* @param diagSh3 Diagnostic short 3
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_diagnostic_send(mavlink_channel_t chan, float diagFl1, float diagFl2, float diagFl3, int16_t diagSh1, int16_t diagSh2, int16_t diagSh3)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
_mav_put_float(buf, 0, diagFl1);
_mav_put_float(buf, 4, diagFl2);
_mav_put_float(buf, 8, diagFl3);
_mav_put_int16_t(buf, 12, diagSh1);
_mav_put_int16_t(buf, 14, diagSh2);
_mav_put_int16_t(buf, 16, diagSh3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, buf, 18, 2);
#else
mavlink_diagnostic_t packet;
packet.diagFl1 = diagFl1;
packet.diagFl2 = diagFl2;
packet.diagFl3 = diagFl3;
packet.diagSh1 = diagSh1;
packet.diagSh2 = diagSh2;
packet.diagSh3 = diagSh3;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, (const char *)&packet, 18, 2);
#endif
}
#endif
// MESSAGE DIAGNOSTIC UNPACKING
/**
* @brief Get field diagFl1 from diagnostic message
*
* @return Diagnostic float 1
*/
static inline float mavlink_msg_diagnostic_get_diagFl1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field diagFl2 from diagnostic message
*
* @return Diagnostic float 2
*/
static inline float mavlink_msg_diagnostic_get_diagFl2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field diagFl3 from diagnostic message
*
* @return Diagnostic float 3
*/
static inline float mavlink_msg_diagnostic_get_diagFl3(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field diagSh1 from diagnostic message
*
* @return Diagnostic short 1
*/
static inline int16_t mavlink_msg_diagnostic_get_diagSh1(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 12);
}
/**
* @brief Get field diagSh2 from diagnostic message
*
* @return Diagnostic short 2
*/
static inline int16_t mavlink_msg_diagnostic_get_diagSh2(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 14);
}
/**
* @brief Get field diagSh3 from diagnostic message
*
* @return Diagnostic short 3
*/
static inline int16_t mavlink_msg_diagnostic_get_diagSh3(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 16);
}
/**
* @brief Decode a diagnostic message into a struct
*
* @param msg The message to decode
* @param diagnostic C-struct to decode the message contents into
*/
static inline void mavlink_msg_diagnostic_decode(const mavlink_message_t* msg, mavlink_diagnostic_t* diagnostic)
{
#if MAVLINK_NEED_BYTE_SWAP
diagnostic->diagFl1 = mavlink_msg_diagnostic_get_diagFl1(msg);
diagnostic->diagFl2 = mavlink_msg_diagnostic_get_diagFl2(msg);
diagnostic->diagFl3 = mavlink_msg_diagnostic_get_diagFl3(msg);
diagnostic->diagSh1 = mavlink_msg_diagnostic_get_diagSh1(msg);
diagnostic->diagSh2 = mavlink_msg_diagnostic_get_diagSh2(msg);
diagnostic->diagSh3 = mavlink_msg_diagnostic_get_diagSh3(msg);
#else
memcpy(diagnostic, _MAV_PAYLOAD(msg), 18);
#endif
}

View File

@ -0,0 +1,276 @@
// MESSAGE GPS_DATE_TIME PACKING
#define MAVLINK_MSG_ID_GPS_DATE_TIME 179
typedef struct __mavlink_gps_date_time_t
{
uint8_t year; ///< Year reported by Gps
uint8_t month; ///< Month reported by Gps
uint8_t day; ///< Day reported by Gps
uint8_t hour; ///< Hour reported by Gps
uint8_t min; ///< Min reported by Gps
uint8_t sec; ///< Sec reported by Gps
uint8_t visSat; ///< Visible sattelites reported by Gps
} mavlink_gps_date_time_t;
#define MAVLINK_MSG_ID_GPS_DATE_TIME_LEN 7
#define MAVLINK_MSG_ID_179_LEN 7
#define MAVLINK_MESSAGE_INFO_GPS_DATE_TIME { \
"GPS_DATE_TIME", \
7, \
{ { "year", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_date_time_t, year) }, \
{ "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_date_time_t, month) }, \
{ "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_date_time_t, day) }, \
{ "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_gps_date_time_t, hour) }, \
{ "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_gps_date_time_t, min) }, \
{ "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_gps_date_time_t, sec) }, \
{ "visSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gps_date_time_t, visSat) }, \
} \
}
/**
* @brief Pack a gps_date_time 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 year Year reported by Gps
* @param month Month reported by Gps
* @param day Day reported by Gps
* @param hour Hour reported by Gps
* @param min Min reported by Gps
* @param sec Sec reported by Gps
* @param visSat Visible sattelites reported by Gps
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_gps_date_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t visSat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[7];
_mav_put_uint8_t(buf, 0, year);
_mav_put_uint8_t(buf, 1, month);
_mav_put_uint8_t(buf, 2, day);
_mav_put_uint8_t(buf, 3, hour);
_mav_put_uint8_t(buf, 4, min);
_mav_put_uint8_t(buf, 5, sec);
_mav_put_uint8_t(buf, 6, visSat);
memcpy(_MAV_PAYLOAD(msg), buf, 7);
#else
mavlink_gps_date_time_t packet;
packet.year = year;
packet.month = month;
packet.day = day;
packet.hour = hour;
packet.min = min;
packet.sec = sec;
packet.visSat = visSat;
memcpy(_MAV_PAYLOAD(msg), &packet, 7);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
return mavlink_finalize_message(msg, system_id, component_id, 7, 16);
}
/**
* @brief Pack a gps_date_time 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param year Year reported by Gps
* @param month Month reported by Gps
* @param day Day reported by Gps
* @param hour Hour reported by Gps
* @param min Min reported by Gps
* @param sec Sec reported by Gps
* @param visSat Visible sattelites reported by Gps
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_gps_date_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t year,uint8_t month,uint8_t day,uint8_t hour,uint8_t min,uint8_t sec,uint8_t visSat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[7];
_mav_put_uint8_t(buf, 0, year);
_mav_put_uint8_t(buf, 1, month);
_mav_put_uint8_t(buf, 2, day);
_mav_put_uint8_t(buf, 3, hour);
_mav_put_uint8_t(buf, 4, min);
_mav_put_uint8_t(buf, 5, sec);
_mav_put_uint8_t(buf, 6, visSat);
memcpy(_MAV_PAYLOAD(msg), buf, 7);
#else
mavlink_gps_date_time_t packet;
packet.year = year;
packet.month = month;
packet.day = day;
packet.hour = hour;
packet.min = min;
packet.sec = sec;
packet.visSat = visSat;
memcpy(_MAV_PAYLOAD(msg), &packet, 7);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 7, 16);
}
/**
* @brief Encode a gps_date_time 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 gps_date_time C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_gps_date_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_date_time_t* gps_date_time)
{
return mavlink_msg_gps_date_time_pack(system_id, component_id, msg, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->visSat);
}
/**
* @brief Send a gps_date_time message
* @param chan MAVLink channel to send the message
*
* @param year Year reported by Gps
* @param month Month reported by Gps
* @param day Day reported by Gps
* @param hour Hour reported by Gps
* @param min Min reported by Gps
* @param sec Sec reported by Gps
* @param visSat Visible sattelites reported by Gps
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_gps_date_time_send(mavlink_channel_t chan, uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t visSat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[7];
_mav_put_uint8_t(buf, 0, year);
_mav_put_uint8_t(buf, 1, month);
_mav_put_uint8_t(buf, 2, day);
_mav_put_uint8_t(buf, 3, hour);
_mav_put_uint8_t(buf, 4, min);
_mav_put_uint8_t(buf, 5, sec);
_mav_put_uint8_t(buf, 6, visSat);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, 7, 16);
#else
mavlink_gps_date_time_t packet;
packet.year = year;
packet.month = month;
packet.day = day;
packet.hour = hour;
packet.min = min;
packet.sec = sec;
packet.visSat = visSat;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)&packet, 7, 16);
#endif
}
#endif
// MESSAGE GPS_DATE_TIME UNPACKING
/**
* @brief Get field year from gps_date_time message
*
* @return Year reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_year(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field month from gps_date_time message
*
* @return Month reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_month(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field day from gps_date_time message
*
* @return Day reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_day(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field hour from gps_date_time message
*
* @return Hour reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_hour(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field min from gps_date_time message
*
* @return Min reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_min(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field sec from gps_date_time message
*
* @return Sec reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_sec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Get field visSat from gps_date_time message
*
* @return Visible sattelites reported by Gps
*/
static inline uint8_t mavlink_msg_gps_date_time_get_visSat(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 6);
}
/**
* @brief Decode a gps_date_time message into a struct
*
* @param msg The message to decode
* @param gps_date_time C-struct to decode the message contents into
*/
static inline void mavlink_msg_gps_date_time_decode(const mavlink_message_t* msg, mavlink_gps_date_time_t* gps_date_time)
{
#if MAVLINK_NEED_BYTE_SWAP
gps_date_time->year = mavlink_msg_gps_date_time_get_year(msg);
gps_date_time->month = mavlink_msg_gps_date_time_get_month(msg);
gps_date_time->day = mavlink_msg_gps_date_time_get_day(msg);
gps_date_time->hour = mavlink_msg_gps_date_time_get_hour(msg);
gps_date_time->min = mavlink_msg_gps_date_time_get_min(msg);
gps_date_time->sec = mavlink_msg_gps_date_time_get_sec(msg);
gps_date_time->visSat = mavlink_msg_gps_date_time_get_visSat(msg);
#else
memcpy(gps_date_time, _MAV_PAYLOAD(msg), 7);
#endif
}

View File

@ -0,0 +1,210 @@
// MESSAGE MID_LVL_CMDS PACKING
#define MAVLINK_MSG_ID_MID_LVL_CMDS 180
typedef struct __mavlink_mid_lvl_cmds_t
{
float hCommand; ///< Commanded Airspeed
float uCommand; ///< Log value 2
float rCommand; ///< Log value 3
uint8_t target; ///< The system setting the commands
} mavlink_mid_lvl_cmds_t;
#define MAVLINK_MSG_ID_MID_LVL_CMDS_LEN 13
#define MAVLINK_MSG_ID_180_LEN 13
#define MAVLINK_MESSAGE_INFO_MID_LVL_CMDS { \
"MID_LVL_CMDS", \
4, \
{ { "hCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mid_lvl_cmds_t, hCommand) }, \
{ "uCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mid_lvl_cmds_t, uCommand) }, \
{ "rCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mid_lvl_cmds_t, rCommand) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mid_lvl_cmds_t, target) }, \
} \
}
/**
* @brief Pack a mid_lvl_cmds message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system setting the commands
* @param hCommand Commanded Airspeed
* @param uCommand Log value 2
* @param rCommand Log value 3
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mid_lvl_cmds_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, float hCommand, float uCommand, float rCommand)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[13];
_mav_put_float(buf, 0, hCommand);
_mav_put_float(buf, 4, uCommand);
_mav_put_float(buf, 8, rCommand);
_mav_put_uint8_t(buf, 12, target);
memcpy(_MAV_PAYLOAD(msg), buf, 13);
#else
mavlink_mid_lvl_cmds_t packet;
packet.hCommand = hCommand;
packet.uCommand = uCommand;
packet.rCommand = rCommand;
packet.target = target;
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
#endif
msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
return mavlink_finalize_message(msg, system_id, component_id, 13, 146);
}
/**
* @brief Pack a mid_lvl_cmds 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system setting the commands
* @param hCommand Commanded Airspeed
* @param uCommand Log value 2
* @param rCommand Log value 3
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mid_lvl_cmds_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,float hCommand,float uCommand,float rCommand)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[13];
_mav_put_float(buf, 0, hCommand);
_mav_put_float(buf, 4, uCommand);
_mav_put_float(buf, 8, rCommand);
_mav_put_uint8_t(buf, 12, target);
memcpy(_MAV_PAYLOAD(msg), buf, 13);
#else
mavlink_mid_lvl_cmds_t packet;
packet.hCommand = hCommand;
packet.uCommand = uCommand;
packet.rCommand = rCommand;
packet.target = target;
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
#endif
msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 13, 146);
}
/**
* @brief Encode a mid_lvl_cmds 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 mid_lvl_cmds C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_mid_lvl_cmds_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
{
return mavlink_msg_mid_lvl_cmds_pack(system_id, component_id, msg, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
}
/**
* @brief Send a mid_lvl_cmds message
* @param chan MAVLink channel to send the message
*
* @param target The system setting the commands
* @param hCommand Commanded Airspeed
* @param uCommand Log value 2
* @param rCommand Log value 3
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_mid_lvl_cmds_send(mavlink_channel_t chan, uint8_t target, float hCommand, float uCommand, float rCommand)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[13];
_mav_put_float(buf, 0, hCommand);
_mav_put_float(buf, 4, uCommand);
_mav_put_float(buf, 8, rCommand);
_mav_put_uint8_t(buf, 12, target);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, buf, 13, 146);
#else
mavlink_mid_lvl_cmds_t packet;
packet.hCommand = hCommand;
packet.uCommand = uCommand;
packet.rCommand = rCommand;
packet.target = target;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (const char *)&packet, 13, 146);
#endif
}
#endif
// MESSAGE MID_LVL_CMDS UNPACKING
/**
* @brief Get field target from mid_lvl_cmds message
*
* @return The system setting the commands
*/
static inline uint8_t mavlink_msg_mid_lvl_cmds_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 12);
}
/**
* @brief Get field hCommand from mid_lvl_cmds message
*
* @return Commanded Airspeed
*/
static inline float mavlink_msg_mid_lvl_cmds_get_hCommand(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field uCommand from mid_lvl_cmds message
*
* @return Log value 2
*/
static inline float mavlink_msg_mid_lvl_cmds_get_uCommand(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field rCommand from mid_lvl_cmds message
*
* @return Log value 3
*/
static inline float mavlink_msg_mid_lvl_cmds_get_rCommand(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Decode a mid_lvl_cmds message into a struct
*
* @param msg The message to decode
* @param mid_lvl_cmds C-struct to decode the message contents into
*/
static inline void mavlink_msg_mid_lvl_cmds_decode(const mavlink_message_t* msg, mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
{
#if MAVLINK_NEED_BYTE_SWAP
mid_lvl_cmds->hCommand = mavlink_msg_mid_lvl_cmds_get_hCommand(msg);
mid_lvl_cmds->uCommand = mavlink_msg_mid_lvl_cmds_get_uCommand(msg);
mid_lvl_cmds->rCommand = mavlink_msg_mid_lvl_cmds_get_rCommand(msg);
mid_lvl_cmds->target = mavlink_msg_mid_lvl_cmds_get_target(msg);
#else
memcpy(mid_lvl_cmds, _MAV_PAYLOAD(msg), 13);
#endif
}

View File

@ -0,0 +1,254 @@
// MESSAGE SENSOR_BIAS PACKING
#define MAVLINK_MSG_ID_SENSOR_BIAS 172
typedef struct __mavlink_sensor_bias_t
{
float axBias; ///< Accelerometer X bias (m/s)
float ayBias; ///< Accelerometer Y bias (m/s)
float azBias; ///< Accelerometer Z bias (m/s)
float gxBias; ///< Gyro X bias (rad/s)
float gyBias; ///< Gyro Y bias (rad/s)
float gzBias; ///< Gyro Z bias (rad/s)
} mavlink_sensor_bias_t;
#define MAVLINK_MSG_ID_SENSOR_BIAS_LEN 24
#define MAVLINK_MSG_ID_172_LEN 24
#define MAVLINK_MESSAGE_INFO_SENSOR_BIAS { \
"SENSOR_BIAS", \
6, \
{ { "axBias", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_bias_t, axBias) }, \
{ "ayBias", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sensor_bias_t, ayBias) }, \
{ "azBias", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sensor_bias_t, azBias) }, \
{ "gxBias", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_bias_t, gxBias) }, \
{ "gyBias", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_bias_t, gyBias) }, \
{ "gzBias", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_bias_t, gzBias) }, \
} \
}
/**
* @brief Pack a sensor_bias 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 axBias Accelerometer X bias (m/s)
* @param ayBias Accelerometer Y bias (m/s)
* @param azBias Accelerometer Z bias (m/s)
* @param gxBias Gyro X bias (rad/s)
* @param gyBias Gyro Y bias (rad/s)
* @param gzBias Gyro Z bias (rad/s)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_sensor_bias_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float axBias, float ayBias, float azBias, float gxBias, float gyBias, float gzBias)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float(buf, 0, axBias);
_mav_put_float(buf, 4, ayBias);
_mav_put_float(buf, 8, azBias);
_mav_put_float(buf, 12, gxBias);
_mav_put_float(buf, 16, gyBias);
_mav_put_float(buf, 20, gzBias);
memcpy(_MAV_PAYLOAD(msg), buf, 24);
#else
mavlink_sensor_bias_t packet;
packet.axBias = axBias;
packet.ayBias = ayBias;
packet.azBias = azBias;
packet.gxBias = gxBias;
packet.gyBias = gyBias;
packet.gzBias = gzBias;
memcpy(_MAV_PAYLOAD(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_SENSOR_BIAS;
return mavlink_finalize_message(msg, system_id, component_id, 24, 168);
}
/**
* @brief Pack a sensor_bias 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param axBias Accelerometer X bias (m/s)
* @param ayBias Accelerometer Y bias (m/s)
* @param azBias Accelerometer Z bias (m/s)
* @param gxBias Gyro X bias (rad/s)
* @param gyBias Gyro Y bias (rad/s)
* @param gzBias Gyro Z bias (rad/s)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_sensor_bias_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float axBias,float ayBias,float azBias,float gxBias,float gyBias,float gzBias)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float(buf, 0, axBias);
_mav_put_float(buf, 4, ayBias);
_mav_put_float(buf, 8, azBias);
_mav_put_float(buf, 12, gxBias);
_mav_put_float(buf, 16, gyBias);
_mav_put_float(buf, 20, gzBias);
memcpy(_MAV_PAYLOAD(msg), buf, 24);
#else
mavlink_sensor_bias_t packet;
packet.axBias = axBias;
packet.ayBias = ayBias;
packet.azBias = azBias;
packet.gxBias = gxBias;
packet.gyBias = gyBias;
packet.gzBias = gzBias;
memcpy(_MAV_PAYLOAD(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_SENSOR_BIAS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24, 168);
}
/**
* @brief Encode a sensor_bias 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 sensor_bias C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_sensor_bias_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_bias_t* sensor_bias)
{
return mavlink_msg_sensor_bias_pack(system_id, component_id, msg, sensor_bias->axBias, sensor_bias->ayBias, sensor_bias->azBias, sensor_bias->gxBias, sensor_bias->gyBias, sensor_bias->gzBias);
}
/**
* @brief Send a sensor_bias message
* @param chan MAVLink channel to send the message
*
* @param axBias Accelerometer X bias (m/s)
* @param ayBias Accelerometer Y bias (m/s)
* @param azBias Accelerometer Z bias (m/s)
* @param gxBias Gyro X bias (rad/s)
* @param gyBias Gyro Y bias (rad/s)
* @param gzBias Gyro Z bias (rad/s)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_sensor_bias_send(mavlink_channel_t chan, float axBias, float ayBias, float azBias, float gxBias, float gyBias, float gzBias)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float(buf, 0, axBias);
_mav_put_float(buf, 4, ayBias);
_mav_put_float(buf, 8, azBias);
_mav_put_float(buf, 12, gxBias);
_mav_put_float(buf, 16, gyBias);
_mav_put_float(buf, 20, gzBias);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, buf, 24, 168);
#else
mavlink_sensor_bias_t packet;
packet.axBias = axBias;
packet.ayBias = ayBias;
packet.azBias = azBias;
packet.gxBias = gxBias;
packet.gyBias = gyBias;
packet.gzBias = gzBias;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, (const char *)&packet, 24, 168);
#endif
}
#endif
// MESSAGE SENSOR_BIAS UNPACKING
/**
* @brief Get field axBias from sensor_bias message
*
* @return Accelerometer X bias (m/s)
*/
static inline float mavlink_msg_sensor_bias_get_axBias(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field ayBias from sensor_bias message
*
* @return Accelerometer Y bias (m/s)
*/
static inline float mavlink_msg_sensor_bias_get_ayBias(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field azBias from sensor_bias message
*
* @return Accelerometer Z bias (m/s)
*/
static inline float mavlink_msg_sensor_bias_get_azBias(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field gxBias from sensor_bias message
*
* @return Gyro X bias (rad/s)
*/
static inline float mavlink_msg_sensor_bias_get_gxBias(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field gyBias from sensor_bias message
*
* @return Gyro Y bias (rad/s)
*/
static inline float mavlink_msg_sensor_bias_get_gyBias(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field gzBias from sensor_bias message
*
* @return Gyro Z bias (rad/s)
*/
static inline float mavlink_msg_sensor_bias_get_gzBias(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a sensor_bias message into a struct
*
* @param msg The message to decode
* @param sensor_bias C-struct to decode the message contents into
*/
static inline void mavlink_msg_sensor_bias_decode(const mavlink_message_t* msg, mavlink_sensor_bias_t* sensor_bias)
{
#if MAVLINK_NEED_BYTE_SWAP
sensor_bias->axBias = mavlink_msg_sensor_bias_get_axBias(msg);
sensor_bias->ayBias = mavlink_msg_sensor_bias_get_ayBias(msg);
sensor_bias->azBias = mavlink_msg_sensor_bias_get_azBias(msg);
sensor_bias->gxBias = mavlink_msg_sensor_bias_get_gxBias(msg);
sensor_bias->gyBias = mavlink_msg_sensor_bias_get_gyBias(msg);
sensor_bias->gzBias = mavlink_msg_sensor_bias_get_gzBias(msg);
#else
memcpy(sensor_bias, _MAV_PAYLOAD(msg), 24);
#endif
}

View File

@ -0,0 +1,188 @@
// MESSAGE SLUGS_ACTION PACKING
#define MAVLINK_MSG_ID_SLUGS_ACTION 183
typedef struct __mavlink_slugs_action_t
{
uint16_t actionVal; ///< Value associated with the action
uint8_t target; ///< The system reporting the action
uint8_t actionId; ///< Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
} mavlink_slugs_action_t;
#define MAVLINK_MSG_ID_SLUGS_ACTION_LEN 4
#define MAVLINK_MSG_ID_183_LEN 4
#define MAVLINK_MESSAGE_INFO_SLUGS_ACTION { \
"SLUGS_ACTION", \
3, \
{ { "actionVal", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_slugs_action_t, actionVal) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_slugs_action_t, target) }, \
{ "actionId", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_slugs_action_t, actionId) }, \
} \
}
/**
* @brief Pack a slugs_action message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system reporting the action
* @param actionId Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
* @param actionVal Value associated with the action
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_slugs_action_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, uint8_t actionId, uint16_t actionVal)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, actionVal);
_mav_put_uint8_t(buf, 2, target);
_mav_put_uint8_t(buf, 3, actionId);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_slugs_action_t packet;
packet.actionVal = actionVal;
packet.target = target;
packet.actionId = actionId;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_SLUGS_ACTION;
return mavlink_finalize_message(msg, system_id, component_id, 4, 65);
}
/**
* @brief Pack a slugs_action 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system reporting the action
* @param actionId Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
* @param actionVal Value associated with the action
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_slugs_action_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,uint8_t actionId,uint16_t actionVal)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, actionVal);
_mav_put_uint8_t(buf, 2, target);
_mav_put_uint8_t(buf, 3, actionId);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_slugs_action_t packet;
packet.actionVal = actionVal;
packet.target = target;
packet.actionId = actionId;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_SLUGS_ACTION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 65);
}
/**
* @brief Encode a slugs_action 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 slugs_action C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_slugs_action_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_action_t* slugs_action)
{
return mavlink_msg_slugs_action_pack(system_id, component_id, msg, slugs_action->target, slugs_action->actionId, slugs_action->actionVal);
}
/**
* @brief Send a slugs_action message
* @param chan MAVLink channel to send the message
*
* @param target The system reporting the action
* @param actionId Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
* @param actionVal Value associated with the action
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_slugs_action_send(mavlink_channel_t chan, uint8_t target, uint8_t actionId, uint16_t actionVal)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, actionVal);
_mav_put_uint8_t(buf, 2, target);
_mav_put_uint8_t(buf, 3, actionId);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_ACTION, buf, 4, 65);
#else
mavlink_slugs_action_t packet;
packet.actionVal = actionVal;
packet.target = target;
packet.actionId = actionId;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_ACTION, (const char *)&packet, 4, 65);
#endif
}
#endif
// MESSAGE SLUGS_ACTION UNPACKING
/**
* @brief Get field target from slugs_action message
*
* @return The system reporting the action
*/
static inline uint8_t mavlink_msg_slugs_action_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field actionId from slugs_action message
*
* @return Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
*/
static inline uint8_t mavlink_msg_slugs_action_get_actionId(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field actionVal from slugs_action message
*
* @return Value associated with the action
*/
static inline uint16_t mavlink_msg_slugs_action_get_actionVal(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Decode a slugs_action message into a struct
*
* @param msg The message to decode
* @param slugs_action C-struct to decode the message contents into
*/
static inline void mavlink_msg_slugs_action_decode(const mavlink_message_t* msg, mavlink_slugs_action_t* slugs_action)
{
#if MAVLINK_NEED_BYTE_SWAP
slugs_action->actionVal = mavlink_msg_slugs_action_get_actionVal(msg);
slugs_action->target = mavlink_msg_slugs_action_get_target(msg);
slugs_action->actionId = mavlink_msg_slugs_action_get_actionId(msg);
#else
memcpy(slugs_action, _MAV_PAYLOAD(msg), 4);
#endif
}

View File

@ -0,0 +1,320 @@
// MESSAGE SLUGS_NAVIGATION PACKING
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION 176
typedef struct __mavlink_slugs_navigation_t
{
float u_m; ///< Measured Airspeed prior to the Nav Filter
float phi_c; ///< Commanded Roll
float theta_c; ///< Commanded Pitch
float psiDot_c; ///< Commanded Turn rate
float ay_body; ///< Y component of the body acceleration
float totalDist; ///< Total Distance to Run on this leg of Navigation
float dist2Go; ///< Remaining distance to Run on this leg of Navigation
uint8_t fromWP; ///< Origin WP
uint8_t toWP; ///< Destination WP
} mavlink_slugs_navigation_t;
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN 30
#define MAVLINK_MSG_ID_176_LEN 30
#define MAVLINK_MESSAGE_INFO_SLUGS_NAVIGATION { \
"SLUGS_NAVIGATION", \
9, \
{ { "u_m", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_navigation_t, u_m) }, \
{ "phi_c", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_navigation_t, phi_c) }, \
{ "theta_c", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_slugs_navigation_t, theta_c) }, \
{ "psiDot_c", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_slugs_navigation_t, psiDot_c) }, \
{ "ay_body", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_slugs_navigation_t, ay_body) }, \
{ "totalDist", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_slugs_navigation_t, totalDist) }, \
{ "dist2Go", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_slugs_navigation_t, dist2Go) }, \
{ "fromWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_slugs_navigation_t, fromWP) }, \
{ "toWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_slugs_navigation_t, toWP) }, \
} \
}
/**
* @brief Pack a slugs_navigation 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 u_m Measured Airspeed prior to the Nav Filter
* @param phi_c Commanded Roll
* @param theta_c Commanded Pitch
* @param psiDot_c Commanded Turn rate
* @param ay_body Y component of the body acceleration
* @param totalDist Total Distance to Run on this leg of Navigation
* @param dist2Go Remaining distance to Run on this leg of Navigation
* @param fromWP Origin WP
* @param toWP Destination WP
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_slugs_navigation_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[30];
_mav_put_float(buf, 0, u_m);
_mav_put_float(buf, 4, phi_c);
_mav_put_float(buf, 8, theta_c);
_mav_put_float(buf, 12, psiDot_c);
_mav_put_float(buf, 16, ay_body);
_mav_put_float(buf, 20, totalDist);
_mav_put_float(buf, 24, dist2Go);
_mav_put_uint8_t(buf, 28, fromWP);
_mav_put_uint8_t(buf, 29, toWP);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
#else
mavlink_slugs_navigation_t packet;
packet.u_m = u_m;
packet.phi_c = phi_c;
packet.theta_c = theta_c;
packet.psiDot_c = psiDot_c;
packet.ay_body = ay_body;
packet.totalDist = totalDist;
packet.dist2Go = dist2Go;
packet.fromWP = fromWP;
packet.toWP = toWP;
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
return mavlink_finalize_message(msg, system_id, component_id, 30, 120);
}
/**
* @brief Pack a slugs_navigation 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param u_m Measured Airspeed prior to the Nav Filter
* @param phi_c Commanded Roll
* @param theta_c Commanded Pitch
* @param psiDot_c Commanded Turn rate
* @param ay_body Y component of the body acceleration
* @param totalDist Total Distance to Run on this leg of Navigation
* @param dist2Go Remaining distance to Run on this leg of Navigation
* @param fromWP Origin WP
* @param toWP Destination WP
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_slugs_navigation_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float u_m,float phi_c,float theta_c,float psiDot_c,float ay_body,float totalDist,float dist2Go,uint8_t fromWP,uint8_t toWP)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[30];
_mav_put_float(buf, 0, u_m);
_mav_put_float(buf, 4, phi_c);
_mav_put_float(buf, 8, theta_c);
_mav_put_float(buf, 12, psiDot_c);
_mav_put_float(buf, 16, ay_body);
_mav_put_float(buf, 20, totalDist);
_mav_put_float(buf, 24, dist2Go);
_mav_put_uint8_t(buf, 28, fromWP);
_mav_put_uint8_t(buf, 29, toWP);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
#else
mavlink_slugs_navigation_t packet;
packet.u_m = u_m;
packet.phi_c = phi_c;
packet.theta_c = theta_c;
packet.psiDot_c = psiDot_c;
packet.ay_body = ay_body;
packet.totalDist = totalDist;
packet.dist2Go = dist2Go;
packet.fromWP = fromWP;
packet.toWP = toWP;
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 30, 120);
}
/**
* @brief Encode a slugs_navigation 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 slugs_navigation C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_slugs_navigation_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_navigation_t* slugs_navigation)
{
return mavlink_msg_slugs_navigation_pack(system_id, component_id, msg, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP);
}
/**
* @brief Send a slugs_navigation message
* @param chan MAVLink channel to send the message
*
* @param u_m Measured Airspeed prior to the Nav Filter
* @param phi_c Commanded Roll
* @param theta_c Commanded Pitch
* @param psiDot_c Commanded Turn rate
* @param ay_body Y component of the body acceleration
* @param totalDist Total Distance to Run on this leg of Navigation
* @param dist2Go Remaining distance to Run on this leg of Navigation
* @param fromWP Origin WP
* @param toWP Destination WP
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_slugs_navigation_send(mavlink_channel_t chan, float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[30];
_mav_put_float(buf, 0, u_m);
_mav_put_float(buf, 4, phi_c);
_mav_put_float(buf, 8, theta_c);
_mav_put_float(buf, 12, psiDot_c);
_mav_put_float(buf, 16, ay_body);
_mav_put_float(buf, 20, totalDist);
_mav_put_float(buf, 24, dist2Go);
_mav_put_uint8_t(buf, 28, fromWP);
_mav_put_uint8_t(buf, 29, toWP);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, buf, 30, 120);
#else
mavlink_slugs_navigation_t packet;
packet.u_m = u_m;
packet.phi_c = phi_c;
packet.theta_c = theta_c;
packet.psiDot_c = psiDot_c;
packet.ay_body = ay_body;
packet.totalDist = totalDist;
packet.dist2Go = dist2Go;
packet.fromWP = fromWP;
packet.toWP = toWP;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)&packet, 30, 120);
#endif
}
#endif
// MESSAGE SLUGS_NAVIGATION UNPACKING
/**
* @brief Get field u_m from slugs_navigation message
*
* @return Measured Airspeed prior to the Nav Filter
*/
static inline float mavlink_msg_slugs_navigation_get_u_m(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field phi_c from slugs_navigation message
*
* @return Commanded Roll
*/
static inline float mavlink_msg_slugs_navigation_get_phi_c(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field theta_c from slugs_navigation message
*
* @return Commanded Pitch
*/
static inline float mavlink_msg_slugs_navigation_get_theta_c(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field psiDot_c from slugs_navigation message
*
* @return Commanded Turn rate
*/
static inline float mavlink_msg_slugs_navigation_get_psiDot_c(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field ay_body from slugs_navigation message
*
* @return Y component of the body acceleration
*/
static inline float mavlink_msg_slugs_navigation_get_ay_body(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field totalDist from slugs_navigation message
*
* @return Total Distance to Run on this leg of Navigation
*/
static inline float mavlink_msg_slugs_navigation_get_totalDist(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field dist2Go from slugs_navigation message
*
* @return Remaining distance to Run on this leg of Navigation
*/
static inline float mavlink_msg_slugs_navigation_get_dist2Go(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field fromWP from slugs_navigation message
*
* @return Origin WP
*/
static inline uint8_t mavlink_msg_slugs_navigation_get_fromWP(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 28);
}
/**
* @brief Get field toWP from slugs_navigation message
*
* @return Destination WP
*/
static inline uint8_t mavlink_msg_slugs_navigation_get_toWP(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 29);
}
/**
* @brief Decode a slugs_navigation message into a struct
*
* @param msg The message to decode
* @param slugs_navigation C-struct to decode the message contents into
*/
static inline void mavlink_msg_slugs_navigation_decode(const mavlink_message_t* msg, mavlink_slugs_navigation_t* slugs_navigation)
{
#if MAVLINK_NEED_BYTE_SWAP
slugs_navigation->u_m = mavlink_msg_slugs_navigation_get_u_m(msg);
slugs_navigation->phi_c = mavlink_msg_slugs_navigation_get_phi_c(msg);
slugs_navigation->theta_c = mavlink_msg_slugs_navigation_get_theta_c(msg);
slugs_navigation->psiDot_c = mavlink_msg_slugs_navigation_get_psiDot_c(msg);
slugs_navigation->ay_body = mavlink_msg_slugs_navigation_get_ay_body(msg);
slugs_navigation->totalDist = mavlink_msg_slugs_navigation_get_totalDist(msg);
slugs_navigation->dist2Go = mavlink_msg_slugs_navigation_get_dist2Go(msg);
slugs_navigation->fromWP = mavlink_msg_slugs_navigation_get_fromWP(msg);
slugs_navigation->toWP = mavlink_msg_slugs_navigation_get_toWP(msg);
#else
memcpy(slugs_navigation, _MAV_PAYLOAD(msg), 30);
#endif
}

View File

@ -0,0 +1,62 @@
/** @file
* @brief MAVLink comm protocol generated from slugs.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef SLUGS_H
#define SLUGS_H
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10, 24, 18, 0, 0, 30, 24, 0, 7, 13, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 232, 168, 2, 0, 0, 120, 167, 0, 16, 146, 104, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_CPU_LOAD, MAVLINK_MESSAGE_INFO_AIR_DATA, MAVLINK_MESSAGE_INFO_SENSOR_BIAS, MAVLINK_MESSAGE_INFO_DIAGNOSTIC, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SLUGS_NAVIGATION, MAVLINK_MESSAGE_INFO_DATA_LOG, {NULL}, MAVLINK_MESSAGE_INFO_GPS_DATE_TIME, MAVLINK_MESSAGE_INFO_MID_LVL_CMDS, MAVLINK_MESSAGE_INFO_CTRL_SRFC_PT, {NULL}, MAVLINK_MESSAGE_INFO_SLUGS_ACTION, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_SLUGS
#include "../common/common.h"
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
// ENUM DEFINITIONS
// MESSAGE DEFINITIONS
#include "./mavlink_msg_cpu_load.h"
#include "./mavlink_msg_air_data.h"
#include "./mavlink_msg_sensor_bias.h"
#include "./mavlink_msg_diagnostic.h"
#include "./mavlink_msg_slugs_navigation.h"
#include "./mavlink_msg_data_log.h"
#include "./mavlink_msg_gps_date_time.h"
#include "./mavlink_msg_mid_lvl_cmds.h"
#include "./mavlink_msg_ctrl_srfc_pt.h"
#include "./mavlink_msg_slugs_action.h"
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // SLUGS_H

View File

@ -0,0 +1,552 @@
/** @file
* @brief MAVLink comm protocol testsuite generated from slugs.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef SLUGS_TESTSUITE_H
#define SLUGS_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_slugs(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_common(system_id, component_id, last_msg);
mavlink_test_slugs(system_id, component_id, last_msg);
}
#endif
#include "../common/testsuite.h"
static void mavlink_test_cpu_load(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_cpu_load_t packet_in = {
17235,
139,
206,
};
mavlink_cpu_load_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.batVolt = packet_in.batVolt;
packet1.sensLoad = packet_in.sensLoad;
packet1.ctrlLoad = packet_in.ctrlLoad;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_cpu_load_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_cpu_load_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_cpu_load_pack(system_id, component_id, &msg , packet1.sensLoad , packet1.ctrlLoad , packet1.batVolt );
mavlink_msg_cpu_load_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_cpu_load_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sensLoad , packet1.ctrlLoad , packet1.batVolt );
mavlink_msg_cpu_load_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_cpu_load_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_cpu_load_send(MAVLINK_COMM_1 , packet1.sensLoad , packet1.ctrlLoad , packet1.batVolt );
mavlink_msg_cpu_load_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_air_data(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_air_data_t packet_in = {
17.0,
45.0,
17651,
};
mavlink_air_data_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.dynamicPressure = packet_in.dynamicPressure;
packet1.staticPressure = packet_in.staticPressure;
packet1.temperature = packet_in.temperature;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_air_data_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_air_data_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_air_data_pack(system_id, component_id, &msg , packet1.dynamicPressure , packet1.staticPressure , packet1.temperature );
mavlink_msg_air_data_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_air_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.dynamicPressure , packet1.staticPressure , packet1.temperature );
mavlink_msg_air_data_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_air_data_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_air_data_send(MAVLINK_COMM_1 , packet1.dynamicPressure , packet1.staticPressure , packet1.temperature );
mavlink_msg_air_data_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_sensor_bias(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_sensor_bias_t packet_in = {
17.0,
45.0,
73.0,
101.0,
129.0,
157.0,
};
mavlink_sensor_bias_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.axBias = packet_in.axBias;
packet1.ayBias = packet_in.ayBias;
packet1.azBias = packet_in.azBias;
packet1.gxBias = packet_in.gxBias;
packet1.gyBias = packet_in.gyBias;
packet1.gzBias = packet_in.gzBias;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_bias_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_sensor_bias_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_bias_pack(system_id, component_id, &msg , packet1.axBias , packet1.ayBias , packet1.azBias , packet1.gxBias , packet1.gyBias , packet1.gzBias );
mavlink_msg_sensor_bias_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_bias_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.axBias , packet1.ayBias , packet1.azBias , packet1.gxBias , packet1.gyBias , packet1.gzBias );
mavlink_msg_sensor_bias_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_sensor_bias_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_bias_send(MAVLINK_COMM_1 , packet1.axBias , packet1.ayBias , packet1.azBias , packet1.gxBias , packet1.gyBias , packet1.gzBias );
mavlink_msg_sensor_bias_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_diagnostic(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_diagnostic_t packet_in = {
17.0,
45.0,
73.0,
17859,
17963,
18067,
};
mavlink_diagnostic_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.diagFl1 = packet_in.diagFl1;
packet1.diagFl2 = packet_in.diagFl2;
packet1.diagFl3 = packet_in.diagFl3;
packet1.diagSh1 = packet_in.diagSh1;
packet1.diagSh2 = packet_in.diagSh2;
packet1.diagSh3 = packet_in.diagSh3;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_diagnostic_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_diagnostic_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_diagnostic_pack(system_id, component_id, &msg , packet1.diagFl1 , packet1.diagFl2 , packet1.diagFl3 , packet1.diagSh1 , packet1.diagSh2 , packet1.diagSh3 );
mavlink_msg_diagnostic_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_diagnostic_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.diagFl1 , packet1.diagFl2 , packet1.diagFl3 , packet1.diagSh1 , packet1.diagSh2 , packet1.diagSh3 );
mavlink_msg_diagnostic_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_diagnostic_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_diagnostic_send(MAVLINK_COMM_1 , packet1.diagFl1 , packet1.diagFl2 , packet1.diagFl3 , packet1.diagSh1 , packet1.diagSh2 , packet1.diagSh3 );
mavlink_msg_diagnostic_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_slugs_navigation(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_slugs_navigation_t packet_in = {
17.0,
45.0,
73.0,
101.0,
129.0,
157.0,
185.0,
89,
156,
};
mavlink_slugs_navigation_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.u_m = packet_in.u_m;
packet1.phi_c = packet_in.phi_c;
packet1.theta_c = packet_in.theta_c;
packet1.psiDot_c = packet_in.psiDot_c;
packet1.ay_body = packet_in.ay_body;
packet1.totalDist = packet_in.totalDist;
packet1.dist2Go = packet_in.dist2Go;
packet1.fromWP = packet_in.fromWP;
packet1.toWP = packet_in.toWP;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_navigation_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_slugs_navigation_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_navigation_pack(system_id, component_id, &msg , packet1.u_m , packet1.phi_c , packet1.theta_c , packet1.psiDot_c , packet1.ay_body , packet1.totalDist , packet1.dist2Go , packet1.fromWP , packet1.toWP );
mavlink_msg_slugs_navigation_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_navigation_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.u_m , packet1.phi_c , packet1.theta_c , packet1.psiDot_c , packet1.ay_body , packet1.totalDist , packet1.dist2Go , packet1.fromWP , packet1.toWP );
mavlink_msg_slugs_navigation_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_slugs_navigation_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_navigation_send(MAVLINK_COMM_1 , packet1.u_m , packet1.phi_c , packet1.theta_c , packet1.psiDot_c , packet1.ay_body , packet1.totalDist , packet1.dist2Go , packet1.fromWP , packet1.toWP );
mavlink_msg_slugs_navigation_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_data_log(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_data_log_t packet_in = {
17.0,
45.0,
73.0,
101.0,
129.0,
157.0,
};
mavlink_data_log_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.fl_1 = packet_in.fl_1;
packet1.fl_2 = packet_in.fl_2;
packet1.fl_3 = packet_in.fl_3;
packet1.fl_4 = packet_in.fl_4;
packet1.fl_5 = packet_in.fl_5;
packet1.fl_6 = packet_in.fl_6;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_data_log_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_data_log_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_data_log_pack(system_id, component_id, &msg , packet1.fl_1 , packet1.fl_2 , packet1.fl_3 , packet1.fl_4 , packet1.fl_5 , packet1.fl_6 );
mavlink_msg_data_log_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_data_log_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.fl_1 , packet1.fl_2 , packet1.fl_3 , packet1.fl_4 , packet1.fl_5 , packet1.fl_6 );
mavlink_msg_data_log_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_data_log_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_data_log_send(MAVLINK_COMM_1 , packet1.fl_1 , packet1.fl_2 , packet1.fl_3 , packet1.fl_4 , packet1.fl_5 , packet1.fl_6 );
mavlink_msg_data_log_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_gps_date_time(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_gps_date_time_t packet_in = {
5,
72,
139,
206,
17,
84,
151,
};
mavlink_gps_date_time_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.year = packet_in.year;
packet1.month = packet_in.month;
packet1.day = packet_in.day;
packet1.hour = packet_in.hour;
packet1.min = packet_in.min;
packet1.sec = packet_in.sec;
packet1.visSat = packet_in.visSat;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_gps_date_time_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_gps_date_time_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_gps_date_time_pack(system_id, component_id, &msg , packet1.year , packet1.month , packet1.day , packet1.hour , packet1.min , packet1.sec , packet1.visSat );
mavlink_msg_gps_date_time_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_gps_date_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.year , packet1.month , packet1.day , packet1.hour , packet1.min , packet1.sec , packet1.visSat );
mavlink_msg_gps_date_time_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_gps_date_time_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_gps_date_time_send(MAVLINK_COMM_1 , packet1.year , packet1.month , packet1.day , packet1.hour , packet1.min , packet1.sec , packet1.visSat );
mavlink_msg_gps_date_time_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_mid_lvl_cmds(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_mid_lvl_cmds_t packet_in = {
17.0,
45.0,
73.0,
41,
};
mavlink_mid_lvl_cmds_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.hCommand = packet_in.hCommand;
packet1.uCommand = packet_in.uCommand;
packet1.rCommand = packet_in.rCommand;
packet1.target = packet_in.target;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_mid_lvl_cmds_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_mid_lvl_cmds_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_mid_lvl_cmds_pack(system_id, component_id, &msg , packet1.target , packet1.hCommand , packet1.uCommand , packet1.rCommand );
mavlink_msg_mid_lvl_cmds_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_mid_lvl_cmds_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.hCommand , packet1.uCommand , packet1.rCommand );
mavlink_msg_mid_lvl_cmds_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_mid_lvl_cmds_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_mid_lvl_cmds_send(MAVLINK_COMM_1 , packet1.target , packet1.hCommand , packet1.uCommand , packet1.rCommand );
mavlink_msg_mid_lvl_cmds_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ctrl_srfc_pt(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_ctrl_srfc_pt_t packet_in = {
17235,
139,
};
mavlink_ctrl_srfc_pt_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.bitfieldPt = packet_in.bitfieldPt;
packet1.target = packet_in.target;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ctrl_srfc_pt_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_ctrl_srfc_pt_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ctrl_srfc_pt_pack(system_id, component_id, &msg , packet1.target , packet1.bitfieldPt );
mavlink_msg_ctrl_srfc_pt_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ctrl_srfc_pt_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.bitfieldPt );
mavlink_msg_ctrl_srfc_pt_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_ctrl_srfc_pt_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ctrl_srfc_pt_send(MAVLINK_COMM_1 , packet1.target , packet1.bitfieldPt );
mavlink_msg_ctrl_srfc_pt_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_slugs_action(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_slugs_action_t packet_in = {
17235,
139,
206,
};
mavlink_slugs_action_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.actionVal = packet_in.actionVal;
packet1.target = packet_in.target;
packet1.actionId = packet_in.actionId;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_action_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_slugs_action_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_action_pack(system_id, component_id, &msg , packet1.target , packet1.actionId , packet1.actionVal );
mavlink_msg_slugs_action_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_action_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.actionId , packet1.actionVal );
mavlink_msg_slugs_action_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_slugs_action_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_slugs_action_send(MAVLINK_COMM_1 , packet1.target , packet1.actionId , packet1.actionVal );
mavlink_msg_slugs_action_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_slugs(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_cpu_load(system_id, component_id, last_msg);
mavlink_test_air_data(system_id, component_id, last_msg);
mavlink_test_sensor_bias(system_id, component_id, last_msg);
mavlink_test_diagnostic(system_id, component_id, last_msg);
mavlink_test_slugs_navigation(system_id, component_id, last_msg);
mavlink_test_data_log(system_id, component_id, last_msg);
mavlink_test_gps_date_time(system_id, component_id, last_msg);
mavlink_test_mid_lvl_cmds(system_id, component_id, last_msg);
mavlink_test_ctrl_srfc_pt(system_id, component_id, last_msg);
mavlink_test_slugs_action(system_id, component_id, last_msg);
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // SLUGS_TESTSUITE_H

View File

@ -0,0 +1,12 @@
/** @file
* @brief MAVLink comm protocol built from slugs.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:40 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
#endif // MAVLINK_VERSION_H

View File

@ -0,0 +1,27 @@
/** @file
* @brief MAVLink comm protocol built from test.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "test.h"
#endif // MAVLINK_H

View File

@ -0,0 +1,610 @@
// MESSAGE TEST_TYPES PACKING
#define MAVLINK_MSG_ID_TEST_TYPES 0
typedef struct __mavlink_test_types_t
{
uint64_t u64; ///< uint64_t
int64_t s64; ///< int64_t
double d; ///< double
uint64_t u64_array[3]; ///< uint64_t_array
int64_t s64_array[3]; ///< int64_t_array
double d_array[3]; ///< double_array
uint32_t u32; ///< uint32_t
int32_t s32; ///< int32_t
float f; ///< float
uint32_t u32_array[3]; ///< uint32_t_array
int32_t s32_array[3]; ///< int32_t_array
float f_array[3]; ///< float_array
uint16_t u16; ///< uint16_t
int16_t s16; ///< int16_t
uint16_t u16_array[3]; ///< uint16_t_array
int16_t s16_array[3]; ///< int16_t_array
char c; ///< char
char s[10]; ///< string
uint8_t u8; ///< uint8_t
int8_t s8; ///< int8_t
uint8_t u8_array[3]; ///< uint8_t_array
int8_t s8_array[3]; ///< int8_t_array
} mavlink_test_types_t;
#define MAVLINK_MSG_ID_TEST_TYPES_LEN 179
#define MAVLINK_MSG_ID_0_LEN 179
#define MAVLINK_MSG_TEST_TYPES_FIELD_U64_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_S64_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_D_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_U32_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_S32_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_F_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_U16_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_S16_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_S_LEN 10
#define MAVLINK_MSG_TEST_TYPES_FIELD_U8_ARRAY_LEN 3
#define MAVLINK_MSG_TEST_TYPES_FIELD_S8_ARRAY_LEN 3
#define MAVLINK_MESSAGE_INFO_TEST_TYPES { \
"TEST_TYPES", \
22, \
{ { "u64", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_test_types_t, u64) }, \
{ "s64", NULL, MAVLINK_TYPE_INT64_T, 0, 8, offsetof(mavlink_test_types_t, s64) }, \
{ "d", NULL, MAVLINK_TYPE_DOUBLE, 0, 16, offsetof(mavlink_test_types_t, d) }, \
{ "u64_array", NULL, MAVLINK_TYPE_UINT64_T, 3, 24, offsetof(mavlink_test_types_t, u64_array) }, \
{ "s64_array", NULL, MAVLINK_TYPE_INT64_T, 3, 48, offsetof(mavlink_test_types_t, s64_array) }, \
{ "d_array", NULL, MAVLINK_TYPE_DOUBLE, 3, 72, offsetof(mavlink_test_types_t, d_array) }, \
{ "u32", "0x%08x", MAVLINK_TYPE_UINT32_T, 0, 96, offsetof(mavlink_test_types_t, u32) }, \
{ "s32", NULL, MAVLINK_TYPE_INT32_T, 0, 100, offsetof(mavlink_test_types_t, s32) }, \
{ "f", NULL, MAVLINK_TYPE_FLOAT, 0, 104, offsetof(mavlink_test_types_t, f) }, \
{ "u32_array", NULL, MAVLINK_TYPE_UINT32_T, 3, 108, offsetof(mavlink_test_types_t, u32_array) }, \
{ "s32_array", NULL, MAVLINK_TYPE_INT32_T, 3, 120, offsetof(mavlink_test_types_t, s32_array) }, \
{ "f_array", NULL, MAVLINK_TYPE_FLOAT, 3, 132, offsetof(mavlink_test_types_t, f_array) }, \
{ "u16", NULL, MAVLINK_TYPE_UINT16_T, 0, 144, offsetof(mavlink_test_types_t, u16) }, \
{ "s16", NULL, MAVLINK_TYPE_INT16_T, 0, 146, offsetof(mavlink_test_types_t, s16) }, \
{ "u16_array", NULL, MAVLINK_TYPE_UINT16_T, 3, 148, offsetof(mavlink_test_types_t, u16_array) }, \
{ "s16_array", NULL, MAVLINK_TYPE_INT16_T, 3, 154, offsetof(mavlink_test_types_t, s16_array) }, \
{ "c", NULL, MAVLINK_TYPE_CHAR, 0, 160, offsetof(mavlink_test_types_t, c) }, \
{ "s", NULL, MAVLINK_TYPE_CHAR, 10, 161, offsetof(mavlink_test_types_t, s) }, \
{ "u8", NULL, MAVLINK_TYPE_UINT8_T, 0, 171, offsetof(mavlink_test_types_t, u8) }, \
{ "s8", NULL, MAVLINK_TYPE_INT8_T, 0, 172, offsetof(mavlink_test_types_t, s8) }, \
{ "u8_array", NULL, MAVLINK_TYPE_UINT8_T, 3, 173, offsetof(mavlink_test_types_t, u8_array) }, \
{ "s8_array", NULL, MAVLINK_TYPE_INT8_T, 3, 176, offsetof(mavlink_test_types_t, s8_array) }, \
} \
}
/**
* @brief Pack a test_types 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 c char
* @param s string
* @param u8 uint8_t
* @param u16 uint16_t
* @param u32 uint32_t
* @param u64 uint64_t
* @param s8 int8_t
* @param s16 int16_t
* @param s32 int32_t
* @param s64 int64_t
* @param f float
* @param d double
* @param u8_array uint8_t_array
* @param u16_array uint16_t_array
* @param u32_array uint32_t_array
* @param u64_array uint64_t_array
* @param s8_array int8_t_array
* @param s16_array int16_t_array
* @param s32_array int32_t_array
* @param s64_array int64_t_array
* @param f_array float_array
* @param d_array double_array
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_test_types_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
char c, const char *s, uint8_t u8, uint16_t u16, uint32_t u32, uint64_t u64, int8_t s8, int16_t s16, int32_t s32, int64_t s64, float f, double d, const uint8_t *u8_array, const uint16_t *u16_array, const uint32_t *u32_array, const uint64_t *u64_array, const int8_t *s8_array, const int16_t *s16_array, const int32_t *s32_array, const int64_t *s64_array, const float *f_array, const double *d_array)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[179];
_mav_put_uint64_t(buf, 0, u64);
_mav_put_int64_t(buf, 8, s64);
_mav_put_double(buf, 16, d);
_mav_put_uint32_t(buf, 96, u32);
_mav_put_int32_t(buf, 100, s32);
_mav_put_float(buf, 104, f);
_mav_put_uint16_t(buf, 144, u16);
_mav_put_int16_t(buf, 146, s16);
_mav_put_char(buf, 160, c);
_mav_put_uint8_t(buf, 171, u8);
_mav_put_int8_t(buf, 172, s8);
_mav_put_uint64_t_array(buf, 24, u64_array, 3);
_mav_put_int64_t_array(buf, 48, s64_array, 3);
_mav_put_double_array(buf, 72, d_array, 3);
_mav_put_uint32_t_array(buf, 108, u32_array, 3);
_mav_put_int32_t_array(buf, 120, s32_array, 3);
_mav_put_float_array(buf, 132, f_array, 3);
_mav_put_uint16_t_array(buf, 148, u16_array, 3);
_mav_put_int16_t_array(buf, 154, s16_array, 3);
_mav_put_char_array(buf, 161, s, 10);
_mav_put_uint8_t_array(buf, 173, u8_array, 3);
_mav_put_int8_t_array(buf, 176, s8_array, 3);
memcpy(_MAV_PAYLOAD(msg), buf, 179);
#else
mavlink_test_types_t packet;
packet.u64 = u64;
packet.s64 = s64;
packet.d = d;
packet.u32 = u32;
packet.s32 = s32;
packet.f = f;
packet.u16 = u16;
packet.s16 = s16;
packet.c = c;
packet.u8 = u8;
packet.s8 = s8;
memcpy(packet.u64_array, u64_array, sizeof(uint64_t)*3);
memcpy(packet.s64_array, s64_array, sizeof(int64_t)*3);
memcpy(packet.d_array, d_array, sizeof(double)*3);
memcpy(packet.u32_array, u32_array, sizeof(uint32_t)*3);
memcpy(packet.s32_array, s32_array, sizeof(int32_t)*3);
memcpy(packet.f_array, f_array, sizeof(float)*3);
memcpy(packet.u16_array, u16_array, sizeof(uint16_t)*3);
memcpy(packet.s16_array, s16_array, sizeof(int16_t)*3);
memcpy(packet.s, s, sizeof(char)*10);
memcpy(packet.u8_array, u8_array, sizeof(uint8_t)*3);
memcpy(packet.s8_array, s8_array, sizeof(int8_t)*3);
memcpy(_MAV_PAYLOAD(msg), &packet, 179);
#endif
msg->msgid = MAVLINK_MSG_ID_TEST_TYPES;
return mavlink_finalize_message(msg, system_id, component_id, 179, 103);
}
/**
* @brief Pack a test_types 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param c char
* @param s string
* @param u8 uint8_t
* @param u16 uint16_t
* @param u32 uint32_t
* @param u64 uint64_t
* @param s8 int8_t
* @param s16 int16_t
* @param s32 int32_t
* @param s64 int64_t
* @param f float
* @param d double
* @param u8_array uint8_t_array
* @param u16_array uint16_t_array
* @param u32_array uint32_t_array
* @param u64_array uint64_t_array
* @param s8_array int8_t_array
* @param s16_array int16_t_array
* @param s32_array int32_t_array
* @param s64_array int64_t_array
* @param f_array float_array
* @param d_array double_array
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_test_types_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
char c,const char *s,uint8_t u8,uint16_t u16,uint32_t u32,uint64_t u64,int8_t s8,int16_t s16,int32_t s32,int64_t s64,float f,double d,const uint8_t *u8_array,const uint16_t *u16_array,const uint32_t *u32_array,const uint64_t *u64_array,const int8_t *s8_array,const int16_t *s16_array,const int32_t *s32_array,const int64_t *s64_array,const float *f_array,const double *d_array)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[179];
_mav_put_uint64_t(buf, 0, u64);
_mav_put_int64_t(buf, 8, s64);
_mav_put_double(buf, 16, d);
_mav_put_uint32_t(buf, 96, u32);
_mav_put_int32_t(buf, 100, s32);
_mav_put_float(buf, 104, f);
_mav_put_uint16_t(buf, 144, u16);
_mav_put_int16_t(buf, 146, s16);
_mav_put_char(buf, 160, c);
_mav_put_uint8_t(buf, 171, u8);
_mav_put_int8_t(buf, 172, s8);
_mav_put_uint64_t_array(buf, 24, u64_array, 3);
_mav_put_int64_t_array(buf, 48, s64_array, 3);
_mav_put_double_array(buf, 72, d_array, 3);
_mav_put_uint32_t_array(buf, 108, u32_array, 3);
_mav_put_int32_t_array(buf, 120, s32_array, 3);
_mav_put_float_array(buf, 132, f_array, 3);
_mav_put_uint16_t_array(buf, 148, u16_array, 3);
_mav_put_int16_t_array(buf, 154, s16_array, 3);
_mav_put_char_array(buf, 161, s, 10);
_mav_put_uint8_t_array(buf, 173, u8_array, 3);
_mav_put_int8_t_array(buf, 176, s8_array, 3);
memcpy(_MAV_PAYLOAD(msg), buf, 179);
#else
mavlink_test_types_t packet;
packet.u64 = u64;
packet.s64 = s64;
packet.d = d;
packet.u32 = u32;
packet.s32 = s32;
packet.f = f;
packet.u16 = u16;
packet.s16 = s16;
packet.c = c;
packet.u8 = u8;
packet.s8 = s8;
memcpy(packet.u64_array, u64_array, sizeof(uint64_t)*3);
memcpy(packet.s64_array, s64_array, sizeof(int64_t)*3);
memcpy(packet.d_array, d_array, sizeof(double)*3);
memcpy(packet.u32_array, u32_array, sizeof(uint32_t)*3);
memcpy(packet.s32_array, s32_array, sizeof(int32_t)*3);
memcpy(packet.f_array, f_array, sizeof(float)*3);
memcpy(packet.u16_array, u16_array, sizeof(uint16_t)*3);
memcpy(packet.s16_array, s16_array, sizeof(int16_t)*3);
memcpy(packet.s, s, sizeof(char)*10);
memcpy(packet.u8_array, u8_array, sizeof(uint8_t)*3);
memcpy(packet.s8_array, s8_array, sizeof(int8_t)*3);
memcpy(_MAV_PAYLOAD(msg), &packet, 179);
#endif
msg->msgid = MAVLINK_MSG_ID_TEST_TYPES;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 179, 103);
}
/**
* @brief Encode a test_types 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 test_types C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_test_types_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_test_types_t* test_types)
{
return mavlink_msg_test_types_pack(system_id, component_id, msg, test_types->c, test_types->s, test_types->u8, test_types->u16, test_types->u32, test_types->u64, test_types->s8, test_types->s16, test_types->s32, test_types->s64, test_types->f, test_types->d, test_types->u8_array, test_types->u16_array, test_types->u32_array, test_types->u64_array, test_types->s8_array, test_types->s16_array, test_types->s32_array, test_types->s64_array, test_types->f_array, test_types->d_array);
}
/**
* @brief Send a test_types message
* @param chan MAVLink channel to send the message
*
* @param c char
* @param s string
* @param u8 uint8_t
* @param u16 uint16_t
* @param u32 uint32_t
* @param u64 uint64_t
* @param s8 int8_t
* @param s16 int16_t
* @param s32 int32_t
* @param s64 int64_t
* @param f float
* @param d double
* @param u8_array uint8_t_array
* @param u16_array uint16_t_array
* @param u32_array uint32_t_array
* @param u64_array uint64_t_array
* @param s8_array int8_t_array
* @param s16_array int16_t_array
* @param s32_array int32_t_array
* @param s64_array int64_t_array
* @param f_array float_array
* @param d_array double_array
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_test_types_send(mavlink_channel_t chan, char c, const char *s, uint8_t u8, uint16_t u16, uint32_t u32, uint64_t u64, int8_t s8, int16_t s16, int32_t s32, int64_t s64, float f, double d, const uint8_t *u8_array, const uint16_t *u16_array, const uint32_t *u32_array, const uint64_t *u64_array, const int8_t *s8_array, const int16_t *s16_array, const int32_t *s32_array, const int64_t *s64_array, const float *f_array, const double *d_array)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[179];
_mav_put_uint64_t(buf, 0, u64);
_mav_put_int64_t(buf, 8, s64);
_mav_put_double(buf, 16, d);
_mav_put_uint32_t(buf, 96, u32);
_mav_put_int32_t(buf, 100, s32);
_mav_put_float(buf, 104, f);
_mav_put_uint16_t(buf, 144, u16);
_mav_put_int16_t(buf, 146, s16);
_mav_put_char(buf, 160, c);
_mav_put_uint8_t(buf, 171, u8);
_mav_put_int8_t(buf, 172, s8);
_mav_put_uint64_t_array(buf, 24, u64_array, 3);
_mav_put_int64_t_array(buf, 48, s64_array, 3);
_mav_put_double_array(buf, 72, d_array, 3);
_mav_put_uint32_t_array(buf, 108, u32_array, 3);
_mav_put_int32_t_array(buf, 120, s32_array, 3);
_mav_put_float_array(buf, 132, f_array, 3);
_mav_put_uint16_t_array(buf, 148, u16_array, 3);
_mav_put_int16_t_array(buf, 154, s16_array, 3);
_mav_put_char_array(buf, 161, s, 10);
_mav_put_uint8_t_array(buf, 173, u8_array, 3);
_mav_put_int8_t_array(buf, 176, s8_array, 3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_TYPES, buf, 179, 103);
#else
mavlink_test_types_t packet;
packet.u64 = u64;
packet.s64 = s64;
packet.d = d;
packet.u32 = u32;
packet.s32 = s32;
packet.f = f;
packet.u16 = u16;
packet.s16 = s16;
packet.c = c;
packet.u8 = u8;
packet.s8 = s8;
memcpy(packet.u64_array, u64_array, sizeof(uint64_t)*3);
memcpy(packet.s64_array, s64_array, sizeof(int64_t)*3);
memcpy(packet.d_array, d_array, sizeof(double)*3);
memcpy(packet.u32_array, u32_array, sizeof(uint32_t)*3);
memcpy(packet.s32_array, s32_array, sizeof(int32_t)*3);
memcpy(packet.f_array, f_array, sizeof(float)*3);
memcpy(packet.u16_array, u16_array, sizeof(uint16_t)*3);
memcpy(packet.s16_array, s16_array, sizeof(int16_t)*3);
memcpy(packet.s, s, sizeof(char)*10);
memcpy(packet.u8_array, u8_array, sizeof(uint8_t)*3);
memcpy(packet.s8_array, s8_array, sizeof(int8_t)*3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_TYPES, (const char *)&packet, 179, 103);
#endif
}
#endif
// MESSAGE TEST_TYPES UNPACKING
/**
* @brief Get field c from test_types message
*
* @return char
*/
static inline char mavlink_msg_test_types_get_c(const mavlink_message_t* msg)
{
return _MAV_RETURN_char(msg, 160);
}
/**
* @brief Get field s from test_types message
*
* @return string
*/
static inline uint16_t mavlink_msg_test_types_get_s(const mavlink_message_t* msg, char *s)
{
return _MAV_RETURN_char_array(msg, s, 10, 161);
}
/**
* @brief Get field u8 from test_types message
*
* @return uint8_t
*/
static inline uint8_t mavlink_msg_test_types_get_u8(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 171);
}
/**
* @brief Get field u16 from test_types message
*
* @return uint16_t
*/
static inline uint16_t mavlink_msg_test_types_get_u16(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 144);
}
/**
* @brief Get field u32 from test_types message
*
* @return uint32_t
*/
static inline uint32_t mavlink_msg_test_types_get_u32(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 96);
}
/**
* @brief Get field u64 from test_types message
*
* @return uint64_t
*/
static inline uint64_t mavlink_msg_test_types_get_u64(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field s8 from test_types message
*
* @return int8_t
*/
static inline int8_t mavlink_msg_test_types_get_s8(const mavlink_message_t* msg)
{
return _MAV_RETURN_int8_t(msg, 172);
}
/**
* @brief Get field s16 from test_types message
*
* @return int16_t
*/
static inline int16_t mavlink_msg_test_types_get_s16(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 146);
}
/**
* @brief Get field s32 from test_types message
*
* @return int32_t
*/
static inline int32_t mavlink_msg_test_types_get_s32(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 100);
}
/**
* @brief Get field s64 from test_types message
*
* @return int64_t
*/
static inline int64_t mavlink_msg_test_types_get_s64(const mavlink_message_t* msg)
{
return _MAV_RETURN_int64_t(msg, 8);
}
/**
* @brief Get field f from test_types message
*
* @return float
*/
static inline float mavlink_msg_test_types_get_f(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 104);
}
/**
* @brief Get field d from test_types message
*
* @return double
*/
static inline double mavlink_msg_test_types_get_d(const mavlink_message_t* msg)
{
return _MAV_RETURN_double(msg, 16);
}
/**
* @brief Get field u8_array from test_types message
*
* @return uint8_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_u8_array(const mavlink_message_t* msg, uint8_t *u8_array)
{
return _MAV_RETURN_uint8_t_array(msg, u8_array, 3, 173);
}
/**
* @brief Get field u16_array from test_types message
*
* @return uint16_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_u16_array(const mavlink_message_t* msg, uint16_t *u16_array)
{
return _MAV_RETURN_uint16_t_array(msg, u16_array, 3, 148);
}
/**
* @brief Get field u32_array from test_types message
*
* @return uint32_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_u32_array(const mavlink_message_t* msg, uint32_t *u32_array)
{
return _MAV_RETURN_uint32_t_array(msg, u32_array, 3, 108);
}
/**
* @brief Get field u64_array from test_types message
*
* @return uint64_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_u64_array(const mavlink_message_t* msg, uint64_t *u64_array)
{
return _MAV_RETURN_uint64_t_array(msg, u64_array, 3, 24);
}
/**
* @brief Get field s8_array from test_types message
*
* @return int8_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_s8_array(const mavlink_message_t* msg, int8_t *s8_array)
{
return _MAV_RETURN_int8_t_array(msg, s8_array, 3, 176);
}
/**
* @brief Get field s16_array from test_types message
*
* @return int16_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_s16_array(const mavlink_message_t* msg, int16_t *s16_array)
{
return _MAV_RETURN_int16_t_array(msg, s16_array, 3, 154);
}
/**
* @brief Get field s32_array from test_types message
*
* @return int32_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_s32_array(const mavlink_message_t* msg, int32_t *s32_array)
{
return _MAV_RETURN_int32_t_array(msg, s32_array, 3, 120);
}
/**
* @brief Get field s64_array from test_types message
*
* @return int64_t_array
*/
static inline uint16_t mavlink_msg_test_types_get_s64_array(const mavlink_message_t* msg, int64_t *s64_array)
{
return _MAV_RETURN_int64_t_array(msg, s64_array, 3, 48);
}
/**
* @brief Get field f_array from test_types message
*
* @return float_array
*/
static inline uint16_t mavlink_msg_test_types_get_f_array(const mavlink_message_t* msg, float *f_array)
{
return _MAV_RETURN_float_array(msg, f_array, 3, 132);
}
/**
* @brief Get field d_array from test_types message
*
* @return double_array
*/
static inline uint16_t mavlink_msg_test_types_get_d_array(const mavlink_message_t* msg, double *d_array)
{
return _MAV_RETURN_double_array(msg, d_array, 3, 72);
}
/**
* @brief Decode a test_types message into a struct
*
* @param msg The message to decode
* @param test_types C-struct to decode the message contents into
*/
static inline void mavlink_msg_test_types_decode(const mavlink_message_t* msg, mavlink_test_types_t* test_types)
{
#if MAVLINK_NEED_BYTE_SWAP
test_types->u64 = mavlink_msg_test_types_get_u64(msg);
test_types->s64 = mavlink_msg_test_types_get_s64(msg);
test_types->d = mavlink_msg_test_types_get_d(msg);
mavlink_msg_test_types_get_u64_array(msg, test_types->u64_array);
mavlink_msg_test_types_get_s64_array(msg, test_types->s64_array);
mavlink_msg_test_types_get_d_array(msg, test_types->d_array);
test_types->u32 = mavlink_msg_test_types_get_u32(msg);
test_types->s32 = mavlink_msg_test_types_get_s32(msg);
test_types->f = mavlink_msg_test_types_get_f(msg);
mavlink_msg_test_types_get_u32_array(msg, test_types->u32_array);
mavlink_msg_test_types_get_s32_array(msg, test_types->s32_array);
mavlink_msg_test_types_get_f_array(msg, test_types->f_array);
test_types->u16 = mavlink_msg_test_types_get_u16(msg);
test_types->s16 = mavlink_msg_test_types_get_s16(msg);
mavlink_msg_test_types_get_u16_array(msg, test_types->u16_array);
mavlink_msg_test_types_get_s16_array(msg, test_types->s16_array);
test_types->c = mavlink_msg_test_types_get_c(msg);
mavlink_msg_test_types_get_s(msg, test_types->s);
test_types->u8 = mavlink_msg_test_types_get_u8(msg);
test_types->s8 = mavlink_msg_test_types_get_s8(msg);
mavlink_msg_test_types_get_u8_array(msg, test_types->u8_array);
mavlink_msg_test_types_get_s8_array(msg, test_types->s8_array);
#else
memcpy(test_types, _MAV_PAYLOAD(msg), 179);
#endif
}

View File

@ -0,0 +1,53 @@
/** @file
* @brief MAVLink comm protocol generated from test.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef TEST_H
#define TEST_H
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_TEST_TYPES, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_TEST
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 3
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 3
#endif
// ENUM DEFINITIONS
// MESSAGE DEFINITIONS
#include "./mavlink_msg_test_types.h"
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // TEST_H

View File

@ -0,0 +1,120 @@
/** @file
* @brief MAVLink comm protocol testsuite generated from test.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef TEST_TESTSUITE_H
#define TEST_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_test(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_test(system_id, component_id, last_msg);
}
#endif
static void mavlink_test_test_types(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_test_types_t packet_in = {
93372036854775807ULL,
93372036854776311LL,
235.0,
{ 93372036854777319, 93372036854777320, 93372036854777321 },
{ 93372036854778831, 93372036854778832, 93372036854778833 },
{ 627.0, 628.0, 629.0 },
963502456,
963502664,
745.0,
{ 963503080, 963503081, 963503082 },
{ 963503704, 963503705, 963503706 },
{ 941.0, 942.0, 943.0 },
24723,
24827,
{ 24931, 24932, 24933 },
{ 25243, 25244, 25245 },
'E',
"FGHIJKLMN",
198,
9,
{ 76, 77, 78 },
{ 21, 22, 23 },
};
mavlink_test_types_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.u64 = packet_in.u64;
packet1.s64 = packet_in.s64;
packet1.d = packet_in.d;
packet1.u32 = packet_in.u32;
packet1.s32 = packet_in.s32;
packet1.f = packet_in.f;
packet1.u16 = packet_in.u16;
packet1.s16 = packet_in.s16;
packet1.c = packet_in.c;
packet1.u8 = packet_in.u8;
packet1.s8 = packet_in.s8;
memcpy(packet1.u64_array, packet_in.u64_array, sizeof(uint64_t)*3);
memcpy(packet1.s64_array, packet_in.s64_array, sizeof(int64_t)*3);
memcpy(packet1.d_array, packet_in.d_array, sizeof(double)*3);
memcpy(packet1.u32_array, packet_in.u32_array, sizeof(uint32_t)*3);
memcpy(packet1.s32_array, packet_in.s32_array, sizeof(int32_t)*3);
memcpy(packet1.f_array, packet_in.f_array, sizeof(float)*3);
memcpy(packet1.u16_array, packet_in.u16_array, sizeof(uint16_t)*3);
memcpy(packet1.s16_array, packet_in.s16_array, sizeof(int16_t)*3);
memcpy(packet1.s, packet_in.s, sizeof(char)*10);
memcpy(packet1.u8_array, packet_in.u8_array, sizeof(uint8_t)*3);
memcpy(packet1.s8_array, packet_in.s8_array, sizeof(int8_t)*3);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_test_types_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_test_types_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_test_types_pack(system_id, component_id, &msg , packet1.c , packet1.s , packet1.u8 , packet1.u16 , packet1.u32 , packet1.u64 , packet1.s8 , packet1.s16 , packet1.s32 , packet1.s64 , packet1.f , packet1.d , packet1.u8_array , packet1.u16_array , packet1.u32_array , packet1.u64_array , packet1.s8_array , packet1.s16_array , packet1.s32_array , packet1.s64_array , packet1.f_array , packet1.d_array );
mavlink_msg_test_types_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_test_types_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.c , packet1.s , packet1.u8 , packet1.u16 , packet1.u32 , packet1.u64 , packet1.s8 , packet1.s16 , packet1.s32 , packet1.s64 , packet1.f , packet1.d , packet1.u8_array , packet1.u16_array , packet1.u32_array , packet1.u64_array , packet1.s8_array , packet1.s16_array , packet1.s32_array , packet1.s64_array , packet1.f_array , packet1.d_array );
mavlink_msg_test_types_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_test_types_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_test_types_send(MAVLINK_COMM_1 , packet1.c , packet1.s , packet1.u8 , packet1.u16 , packet1.u32 , packet1.u64 , packet1.s8 , packet1.s16 , packet1.s32 , packet1.s64 , packet1.f , packet1.d , packet1.u8_array , packet1.u16_array , packet1.u32_array , packet1.u64_array , packet1.s8_array , packet1.s16_array , packet1.s32_array , packet1.s64_array , packet1.f_array , packet1.d_array );
mavlink_msg_test_types_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_test(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_test_types(system_id, component_id, last_msg);
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // TEST_TESTSUITE_H

View File

@ -0,0 +1,12 @@
/** @file
* @brief MAVLink comm protocol built from test.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:40 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 179
#endif // MAVLINK_VERSION_H

View File

@ -0,0 +1,27 @@
/** @file
* @brief MAVLink comm protocol built from ualberta.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "ualberta.h"
#endif // MAVLINK_H

View File

@ -0,0 +1,276 @@
// MESSAGE NAV_FILTER_BIAS PACKING
#define MAVLINK_MSG_ID_NAV_FILTER_BIAS 220
typedef struct __mavlink_nav_filter_bias_t
{
uint64_t usec; ///< Timestamp (microseconds)
float accel_0; ///< b_f[0]
float accel_1; ///< b_f[1]
float accel_2; ///< b_f[2]
float gyro_0; ///< b_f[0]
float gyro_1; ///< b_f[1]
float gyro_2; ///< b_f[2]
} mavlink_nav_filter_bias_t;
#define MAVLINK_MSG_ID_NAV_FILTER_BIAS_LEN 32
#define MAVLINK_MSG_ID_220_LEN 32
#define MAVLINK_MESSAGE_INFO_NAV_FILTER_BIAS { \
"NAV_FILTER_BIAS", \
7, \
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_nav_filter_bias_t, usec) }, \
{ "accel_0", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_filter_bias_t, accel_0) }, \
{ "accel_1", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_filter_bias_t, accel_1) }, \
{ "accel_2", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_filter_bias_t, accel_2) }, \
{ "gyro_0", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_nav_filter_bias_t, gyro_0) }, \
{ "gyro_1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_nav_filter_bias_t, gyro_1) }, \
{ "gyro_2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_nav_filter_bias_t, gyro_2) }, \
} \
}
/**
* @brief Pack a nav_filter_bias 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 usec Timestamp (microseconds)
* @param accel_0 b_f[0]
* @param accel_1 b_f[1]
* @param accel_2 b_f[2]
* @param gyro_0 b_f[0]
* @param gyro_1 b_f[1]
* @param gyro_2 b_f[2]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_nav_filter_bias_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float accel_0, float accel_1, float accel_2, float gyro_0, float gyro_1, float gyro_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, accel_0);
_mav_put_float(buf, 12, accel_1);
_mav_put_float(buf, 16, accel_2);
_mav_put_float(buf, 20, gyro_0);
_mav_put_float(buf, 24, gyro_1);
_mav_put_float(buf, 28, gyro_2);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_nav_filter_bias_t packet;
packet.usec = usec;
packet.accel_0 = accel_0;
packet.accel_1 = accel_1;
packet.accel_2 = accel_2;
packet.gyro_0 = gyro_0;
packet.gyro_1 = gyro_1;
packet.gyro_2 = gyro_2;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_NAV_FILTER_BIAS;
return mavlink_finalize_message(msg, system_id, component_id, 32, 34);
}
/**
* @brief Pack a nav_filter_bias 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (microseconds)
* @param accel_0 b_f[0]
* @param accel_1 b_f[1]
* @param accel_2 b_f[2]
* @param gyro_0 b_f[0]
* @param gyro_1 b_f[1]
* @param gyro_2 b_f[2]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_nav_filter_bias_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float accel_0,float accel_1,float accel_2,float gyro_0,float gyro_1,float gyro_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, accel_0);
_mav_put_float(buf, 12, accel_1);
_mav_put_float(buf, 16, accel_2);
_mav_put_float(buf, 20, gyro_0);
_mav_put_float(buf, 24, gyro_1);
_mav_put_float(buf, 28, gyro_2);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_nav_filter_bias_t packet;
packet.usec = usec;
packet.accel_0 = accel_0;
packet.accel_1 = accel_1;
packet.accel_2 = accel_2;
packet.gyro_0 = gyro_0;
packet.gyro_1 = gyro_1;
packet.gyro_2 = gyro_2;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_NAV_FILTER_BIAS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 34);
}
/**
* @brief Encode a nav_filter_bias 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 nav_filter_bias C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_nav_filter_bias_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_nav_filter_bias_t* nav_filter_bias)
{
return mavlink_msg_nav_filter_bias_pack(system_id, component_id, msg, nav_filter_bias->usec, nav_filter_bias->accel_0, nav_filter_bias->accel_1, nav_filter_bias->accel_2, nav_filter_bias->gyro_0, nav_filter_bias->gyro_1, nav_filter_bias->gyro_2);
}
/**
* @brief Send a nav_filter_bias message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (microseconds)
* @param accel_0 b_f[0]
* @param accel_1 b_f[1]
* @param accel_2 b_f[2]
* @param gyro_0 b_f[0]
* @param gyro_1 b_f[1]
* @param gyro_2 b_f[2]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_nav_filter_bias_send(mavlink_channel_t chan, uint64_t usec, float accel_0, float accel_1, float accel_2, float gyro_0, float gyro_1, float gyro_2)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, accel_0);
_mav_put_float(buf, 12, accel_1);
_mav_put_float(buf, 16, accel_2);
_mav_put_float(buf, 20, gyro_0);
_mav_put_float(buf, 24, gyro_1);
_mav_put_float(buf, 28, gyro_2);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_FILTER_BIAS, buf, 32, 34);
#else
mavlink_nav_filter_bias_t packet;
packet.usec = usec;
packet.accel_0 = accel_0;
packet.accel_1 = accel_1;
packet.accel_2 = accel_2;
packet.gyro_0 = gyro_0;
packet.gyro_1 = gyro_1;
packet.gyro_2 = gyro_2;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_FILTER_BIAS, (const char *)&packet, 32, 34);
#endif
}
#endif
// MESSAGE NAV_FILTER_BIAS UNPACKING
/**
* @brief Get field usec from nav_filter_bias message
*
* @return Timestamp (microseconds)
*/
static inline uint64_t mavlink_msg_nav_filter_bias_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field accel_0 from nav_filter_bias message
*
* @return b_f[0]
*/
static inline float mavlink_msg_nav_filter_bias_get_accel_0(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field accel_1 from nav_filter_bias message
*
* @return b_f[1]
*/
static inline float mavlink_msg_nav_filter_bias_get_accel_1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field accel_2 from nav_filter_bias message
*
* @return b_f[2]
*/
static inline float mavlink_msg_nav_filter_bias_get_accel_2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field gyro_0 from nav_filter_bias message
*
* @return b_f[0]
*/
static inline float mavlink_msg_nav_filter_bias_get_gyro_0(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field gyro_1 from nav_filter_bias message
*
* @return b_f[1]
*/
static inline float mavlink_msg_nav_filter_bias_get_gyro_1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field gyro_2 from nav_filter_bias message
*
* @return b_f[2]
*/
static inline float mavlink_msg_nav_filter_bias_get_gyro_2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a nav_filter_bias message into a struct
*
* @param msg The message to decode
* @param nav_filter_bias C-struct to decode the message contents into
*/
static inline void mavlink_msg_nav_filter_bias_decode(const mavlink_message_t* msg, mavlink_nav_filter_bias_t* nav_filter_bias)
{
#if MAVLINK_NEED_BYTE_SWAP
nav_filter_bias->usec = mavlink_msg_nav_filter_bias_get_usec(msg);
nav_filter_bias->accel_0 = mavlink_msg_nav_filter_bias_get_accel_0(msg);
nav_filter_bias->accel_1 = mavlink_msg_nav_filter_bias_get_accel_1(msg);
nav_filter_bias->accel_2 = mavlink_msg_nav_filter_bias_get_accel_2(msg);
nav_filter_bias->gyro_0 = mavlink_msg_nav_filter_bias_get_gyro_0(msg);
nav_filter_bias->gyro_1 = mavlink_msg_nav_filter_bias_get_gyro_1(msg);
nav_filter_bias->gyro_2 = mavlink_msg_nav_filter_bias_get_gyro_2(msg);
#else
memcpy(nav_filter_bias, _MAV_PAYLOAD(msg), 32);
#endif
}

View File

@ -0,0 +1,259 @@
// MESSAGE RADIO_CALIBRATION PACKING
#define MAVLINK_MSG_ID_RADIO_CALIBRATION 221
typedef struct __mavlink_radio_calibration_t
{
uint16_t aileron[3]; ///< Aileron setpoints: left, center, right
uint16_t elevator[3]; ///< Elevator setpoints: nose down, center, nose up
uint16_t rudder[3]; ///< Rudder setpoints: nose left, center, nose right
uint16_t gyro[2]; ///< Tail gyro mode/gain setpoints: heading hold, rate mode
uint16_t pitch[5]; ///< Pitch curve setpoints (every 25%)
uint16_t throttle[5]; ///< Throttle curve setpoints (every 25%)
} mavlink_radio_calibration_t;
#define MAVLINK_MSG_ID_RADIO_CALIBRATION_LEN 42
#define MAVLINK_MSG_ID_221_LEN 42
#define MAVLINK_MSG_RADIO_CALIBRATION_FIELD_AILERON_LEN 3
#define MAVLINK_MSG_RADIO_CALIBRATION_FIELD_ELEVATOR_LEN 3
#define MAVLINK_MSG_RADIO_CALIBRATION_FIELD_RUDDER_LEN 3
#define MAVLINK_MSG_RADIO_CALIBRATION_FIELD_GYRO_LEN 2
#define MAVLINK_MSG_RADIO_CALIBRATION_FIELD_PITCH_LEN 5
#define MAVLINK_MSG_RADIO_CALIBRATION_FIELD_THROTTLE_LEN 5
#define MAVLINK_MESSAGE_INFO_RADIO_CALIBRATION { \
"RADIO_CALIBRATION", \
6, \
{ { "aileron", NULL, MAVLINK_TYPE_UINT16_T, 3, 0, offsetof(mavlink_radio_calibration_t, aileron) }, \
{ "elevator", NULL, MAVLINK_TYPE_UINT16_T, 3, 6, offsetof(mavlink_radio_calibration_t, elevator) }, \
{ "rudder", NULL, MAVLINK_TYPE_UINT16_T, 3, 12, offsetof(mavlink_radio_calibration_t, rudder) }, \
{ "gyro", NULL, MAVLINK_TYPE_UINT16_T, 2, 18, offsetof(mavlink_radio_calibration_t, gyro) }, \
{ "pitch", NULL, MAVLINK_TYPE_UINT16_T, 5, 22, offsetof(mavlink_radio_calibration_t, pitch) }, \
{ "throttle", NULL, MAVLINK_TYPE_UINT16_T, 5, 32, offsetof(mavlink_radio_calibration_t, throttle) }, \
} \
}
/**
* @brief Pack a radio_calibration 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 aileron Aileron setpoints: left, center, right
* @param elevator Elevator setpoints: nose down, center, nose up
* @param rudder Rudder setpoints: nose left, center, nose right
* @param gyro Tail gyro mode/gain setpoints: heading hold, rate mode
* @param pitch Pitch curve setpoints (every 25%)
* @param throttle Throttle curve setpoints (every 25%)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_radio_calibration_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const uint16_t *aileron, const uint16_t *elevator, const uint16_t *rudder, const uint16_t *gyro, const uint16_t *pitch, const uint16_t *throttle)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[42];
_mav_put_uint16_t_array(buf, 0, aileron, 3);
_mav_put_uint16_t_array(buf, 6, elevator, 3);
_mav_put_uint16_t_array(buf, 12, rudder, 3);
_mav_put_uint16_t_array(buf, 18, gyro, 2);
_mav_put_uint16_t_array(buf, 22, pitch, 5);
_mav_put_uint16_t_array(buf, 32, throttle, 5);
memcpy(_MAV_PAYLOAD(msg), buf, 42);
#else
mavlink_radio_calibration_t packet;
memcpy(packet.aileron, aileron, sizeof(uint16_t)*3);
memcpy(packet.elevator, elevator, sizeof(uint16_t)*3);
memcpy(packet.rudder, rudder, sizeof(uint16_t)*3);
memcpy(packet.gyro, gyro, sizeof(uint16_t)*2);
memcpy(packet.pitch, pitch, sizeof(uint16_t)*5);
memcpy(packet.throttle, throttle, sizeof(uint16_t)*5);
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
#endif
msg->msgid = MAVLINK_MSG_ID_RADIO_CALIBRATION;
return mavlink_finalize_message(msg, system_id, component_id, 42, 71);
}
/**
* @brief Pack a radio_calibration 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param aileron Aileron setpoints: left, center, right
* @param elevator Elevator setpoints: nose down, center, nose up
* @param rudder Rudder setpoints: nose left, center, nose right
* @param gyro Tail gyro mode/gain setpoints: heading hold, rate mode
* @param pitch Pitch curve setpoints (every 25%)
* @param throttle Throttle curve setpoints (every 25%)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_radio_calibration_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const uint16_t *aileron,const uint16_t *elevator,const uint16_t *rudder,const uint16_t *gyro,const uint16_t *pitch,const uint16_t *throttle)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[42];
_mav_put_uint16_t_array(buf, 0, aileron, 3);
_mav_put_uint16_t_array(buf, 6, elevator, 3);
_mav_put_uint16_t_array(buf, 12, rudder, 3);
_mav_put_uint16_t_array(buf, 18, gyro, 2);
_mav_put_uint16_t_array(buf, 22, pitch, 5);
_mav_put_uint16_t_array(buf, 32, throttle, 5);
memcpy(_MAV_PAYLOAD(msg), buf, 42);
#else
mavlink_radio_calibration_t packet;
memcpy(packet.aileron, aileron, sizeof(uint16_t)*3);
memcpy(packet.elevator, elevator, sizeof(uint16_t)*3);
memcpy(packet.rudder, rudder, sizeof(uint16_t)*3);
memcpy(packet.gyro, gyro, sizeof(uint16_t)*2);
memcpy(packet.pitch, pitch, sizeof(uint16_t)*5);
memcpy(packet.throttle, throttle, sizeof(uint16_t)*5);
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
#endif
msg->msgid = MAVLINK_MSG_ID_RADIO_CALIBRATION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 42, 71);
}
/**
* @brief Encode a radio_calibration 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 radio_calibration C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_radio_calibration_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_calibration_t* radio_calibration)
{
return mavlink_msg_radio_calibration_pack(system_id, component_id, msg, radio_calibration->aileron, radio_calibration->elevator, radio_calibration->rudder, radio_calibration->gyro, radio_calibration->pitch, radio_calibration->throttle);
}
/**
* @brief Send a radio_calibration message
* @param chan MAVLink channel to send the message
*
* @param aileron Aileron setpoints: left, center, right
* @param elevator Elevator setpoints: nose down, center, nose up
* @param rudder Rudder setpoints: nose left, center, nose right
* @param gyro Tail gyro mode/gain setpoints: heading hold, rate mode
* @param pitch Pitch curve setpoints (every 25%)
* @param throttle Throttle curve setpoints (every 25%)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_radio_calibration_send(mavlink_channel_t chan, const uint16_t *aileron, const uint16_t *elevator, const uint16_t *rudder, const uint16_t *gyro, const uint16_t *pitch, const uint16_t *throttle)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[42];
_mav_put_uint16_t_array(buf, 0, aileron, 3);
_mav_put_uint16_t_array(buf, 6, elevator, 3);
_mav_put_uint16_t_array(buf, 12, rudder, 3);
_mav_put_uint16_t_array(buf, 18, gyro, 2);
_mav_put_uint16_t_array(buf, 22, pitch, 5);
_mav_put_uint16_t_array(buf, 32, throttle, 5);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_CALIBRATION, buf, 42, 71);
#else
mavlink_radio_calibration_t packet;
memcpy(packet.aileron, aileron, sizeof(uint16_t)*3);
memcpy(packet.elevator, elevator, sizeof(uint16_t)*3);
memcpy(packet.rudder, rudder, sizeof(uint16_t)*3);
memcpy(packet.gyro, gyro, sizeof(uint16_t)*2);
memcpy(packet.pitch, pitch, sizeof(uint16_t)*5);
memcpy(packet.throttle, throttle, sizeof(uint16_t)*5);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_CALIBRATION, (const char *)&packet, 42, 71);
#endif
}
#endif
// MESSAGE RADIO_CALIBRATION UNPACKING
/**
* @brief Get field aileron from radio_calibration message
*
* @return Aileron setpoints: left, center, right
*/
static inline uint16_t mavlink_msg_radio_calibration_get_aileron(const mavlink_message_t* msg, uint16_t *aileron)
{
return _MAV_RETURN_uint16_t_array(msg, aileron, 3, 0);
}
/**
* @brief Get field elevator from radio_calibration message
*
* @return Elevator setpoints: nose down, center, nose up
*/
static inline uint16_t mavlink_msg_radio_calibration_get_elevator(const mavlink_message_t* msg, uint16_t *elevator)
{
return _MAV_RETURN_uint16_t_array(msg, elevator, 3, 6);
}
/**
* @brief Get field rudder from radio_calibration message
*
* @return Rudder setpoints: nose left, center, nose right
*/
static inline uint16_t mavlink_msg_radio_calibration_get_rudder(const mavlink_message_t* msg, uint16_t *rudder)
{
return _MAV_RETURN_uint16_t_array(msg, rudder, 3, 12);
}
/**
* @brief Get field gyro from radio_calibration message
*
* @return Tail gyro mode/gain setpoints: heading hold, rate mode
*/
static inline uint16_t mavlink_msg_radio_calibration_get_gyro(const mavlink_message_t* msg, uint16_t *gyro)
{
return _MAV_RETURN_uint16_t_array(msg, gyro, 2, 18);
}
/**
* @brief Get field pitch from radio_calibration message
*
* @return Pitch curve setpoints (every 25%)
*/
static inline uint16_t mavlink_msg_radio_calibration_get_pitch(const mavlink_message_t* msg, uint16_t *pitch)
{
return _MAV_RETURN_uint16_t_array(msg, pitch, 5, 22);
}
/**
* @brief Get field throttle from radio_calibration message
*
* @return Throttle curve setpoints (every 25%)
*/
static inline uint16_t mavlink_msg_radio_calibration_get_throttle(const mavlink_message_t* msg, uint16_t *throttle)
{
return _MAV_RETURN_uint16_t_array(msg, throttle, 5, 32);
}
/**
* @brief Decode a radio_calibration message into a struct
*
* @param msg The message to decode
* @param radio_calibration C-struct to decode the message contents into
*/
static inline void mavlink_msg_radio_calibration_decode(const mavlink_message_t* msg, mavlink_radio_calibration_t* radio_calibration)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_radio_calibration_get_aileron(msg, radio_calibration->aileron);
mavlink_msg_radio_calibration_get_elevator(msg, radio_calibration->elevator);
mavlink_msg_radio_calibration_get_rudder(msg, radio_calibration->rudder);
mavlink_msg_radio_calibration_get_gyro(msg, radio_calibration->gyro);
mavlink_msg_radio_calibration_get_pitch(msg, radio_calibration->pitch);
mavlink_msg_radio_calibration_get_throttle(msg, radio_calibration->throttle);
#else
memcpy(radio_calibration, _MAV_PAYLOAD(msg), 42);
#endif
}

View File

@ -0,0 +1,188 @@
// MESSAGE UALBERTA_SYS_STATUS PACKING
#define MAVLINK_MSG_ID_UALBERTA_SYS_STATUS 222
typedef struct __mavlink_ualberta_sys_status_t
{
uint8_t mode; ///< System mode, see UALBERTA_AUTOPILOT_MODE ENUM
uint8_t nav_mode; ///< Navigation mode, see UALBERTA_NAV_MODE ENUM
uint8_t pilot; ///< Pilot mode, see UALBERTA_PILOT_MODE
} mavlink_ualberta_sys_status_t;
#define MAVLINK_MSG_ID_UALBERTA_SYS_STATUS_LEN 3
#define MAVLINK_MSG_ID_222_LEN 3
#define MAVLINK_MESSAGE_INFO_UALBERTA_SYS_STATUS { \
"UALBERTA_SYS_STATUS", \
3, \
{ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_ualberta_sys_status_t, mode) }, \
{ "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_ualberta_sys_status_t, nav_mode) }, \
{ "pilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_ualberta_sys_status_t, pilot) }, \
} \
}
/**
* @brief Pack a ualberta_sys_status 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 mode System mode, see UALBERTA_AUTOPILOT_MODE ENUM
* @param nav_mode Navigation mode, see UALBERTA_NAV_MODE ENUM
* @param pilot Pilot mode, see UALBERTA_PILOT_MODE
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ualberta_sys_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t mode, uint8_t nav_mode, uint8_t pilot)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, mode);
_mav_put_uint8_t(buf, 1, nav_mode);
_mav_put_uint8_t(buf, 2, pilot);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_ualberta_sys_status_t packet;
packet.mode = mode;
packet.nav_mode = nav_mode;
packet.pilot = pilot;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_UALBERTA_SYS_STATUS;
return mavlink_finalize_message(msg, system_id, component_id, 3, 15);
}
/**
* @brief Pack a ualberta_sys_status 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param mode System mode, see UALBERTA_AUTOPILOT_MODE ENUM
* @param nav_mode Navigation mode, see UALBERTA_NAV_MODE ENUM
* @param pilot Pilot mode, see UALBERTA_PILOT_MODE
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ualberta_sys_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t mode,uint8_t nav_mode,uint8_t pilot)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, mode);
_mav_put_uint8_t(buf, 1, nav_mode);
_mav_put_uint8_t(buf, 2, pilot);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_ualberta_sys_status_t packet;
packet.mode = mode;
packet.nav_mode = nav_mode;
packet.pilot = pilot;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_UALBERTA_SYS_STATUS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 15);
}
/**
* @brief Encode a ualberta_sys_status 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 ualberta_sys_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_ualberta_sys_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ualberta_sys_status_t* ualberta_sys_status)
{
return mavlink_msg_ualberta_sys_status_pack(system_id, component_id, msg, ualberta_sys_status->mode, ualberta_sys_status->nav_mode, ualberta_sys_status->pilot);
}
/**
* @brief Send a ualberta_sys_status message
* @param chan MAVLink channel to send the message
*
* @param mode System mode, see UALBERTA_AUTOPILOT_MODE ENUM
* @param nav_mode Navigation mode, see UALBERTA_NAV_MODE ENUM
* @param pilot Pilot mode, see UALBERTA_PILOT_MODE
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ualberta_sys_status_send(mavlink_channel_t chan, uint8_t mode, uint8_t nav_mode, uint8_t pilot)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, mode);
_mav_put_uint8_t(buf, 1, nav_mode);
_mav_put_uint8_t(buf, 2, pilot);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UALBERTA_SYS_STATUS, buf, 3, 15);
#else
mavlink_ualberta_sys_status_t packet;
packet.mode = mode;
packet.nav_mode = nav_mode;
packet.pilot = pilot;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UALBERTA_SYS_STATUS, (const char *)&packet, 3, 15);
#endif
}
#endif
// MESSAGE UALBERTA_SYS_STATUS UNPACKING
/**
* @brief Get field mode from ualberta_sys_status message
*
* @return System mode, see UALBERTA_AUTOPILOT_MODE ENUM
*/
static inline uint8_t mavlink_msg_ualberta_sys_status_get_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field nav_mode from ualberta_sys_status message
*
* @return Navigation mode, see UALBERTA_NAV_MODE ENUM
*/
static inline uint8_t mavlink_msg_ualberta_sys_status_get_nav_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field pilot from ualberta_sys_status message
*
* @return Pilot mode, see UALBERTA_PILOT_MODE
*/
static inline uint8_t mavlink_msg_ualberta_sys_status_get_pilot(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Decode a ualberta_sys_status message into a struct
*
* @param msg The message to decode
* @param ualberta_sys_status C-struct to decode the message contents into
*/
static inline void mavlink_msg_ualberta_sys_status_decode(const mavlink_message_t* msg, mavlink_ualberta_sys_status_t* ualberta_sys_status)
{
#if MAVLINK_NEED_BYTE_SWAP
ualberta_sys_status->mode = mavlink_msg_ualberta_sys_status_get_mode(msg);
ualberta_sys_status->nav_mode = mavlink_msg_ualberta_sys_status_get_nav_mode(msg);
ualberta_sys_status->pilot = mavlink_msg_ualberta_sys_status_get_pilot(msg);
#else
memcpy(ualberta_sys_status, _MAV_PAYLOAD(msg), 3);
#endif
}

View File

@ -0,0 +1,192 @@
/** @file
* @brief MAVLink comm protocol testsuite generated from ualberta.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef UALBERTA_TESTSUITE_H
#define UALBERTA_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_ualberta(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_common(system_id, component_id, last_msg);
mavlink_test_ualberta(system_id, component_id, last_msg);
}
#endif
#include "../common/testsuite.h"
static void mavlink_test_nav_filter_bias(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_nav_filter_bias_t packet_in = {
93372036854775807ULL,
73.0,
101.0,
129.0,
157.0,
185.0,
213.0,
};
mavlink_nav_filter_bias_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.usec = packet_in.usec;
packet1.accel_0 = packet_in.accel_0;
packet1.accel_1 = packet_in.accel_1;
packet1.accel_2 = packet_in.accel_2;
packet1.gyro_0 = packet_in.gyro_0;
packet1.gyro_1 = packet_in.gyro_1;
packet1.gyro_2 = packet_in.gyro_2;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_nav_filter_bias_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_nav_filter_bias_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_nav_filter_bias_pack(system_id, component_id, &msg , packet1.usec , packet1.accel_0 , packet1.accel_1 , packet1.accel_2 , packet1.gyro_0 , packet1.gyro_1 , packet1.gyro_2 );
mavlink_msg_nav_filter_bias_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_nav_filter_bias_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.accel_0 , packet1.accel_1 , packet1.accel_2 , packet1.gyro_0 , packet1.gyro_1 , packet1.gyro_2 );
mavlink_msg_nav_filter_bias_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_nav_filter_bias_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_nav_filter_bias_send(MAVLINK_COMM_1 , packet1.usec , packet1.accel_0 , packet1.accel_1 , packet1.accel_2 , packet1.gyro_0 , packet1.gyro_1 , packet1.gyro_2 );
mavlink_msg_nav_filter_bias_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_radio_calibration(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_radio_calibration_t packet_in = {
{ 17235, 17236, 17237 },
{ 17547, 17548, 17549 },
{ 17859, 17860, 17861 },
{ 18171, 18172 },
{ 18379, 18380, 18381, 18382, 18383 },
{ 18899, 18900, 18901, 18902, 18903 },
};
mavlink_radio_calibration_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
memcpy(packet1.aileron, packet_in.aileron, sizeof(uint16_t)*3);
memcpy(packet1.elevator, packet_in.elevator, sizeof(uint16_t)*3);
memcpy(packet1.rudder, packet_in.rudder, sizeof(uint16_t)*3);
memcpy(packet1.gyro, packet_in.gyro, sizeof(uint16_t)*2);
memcpy(packet1.pitch, packet_in.pitch, sizeof(uint16_t)*5);
memcpy(packet1.throttle, packet_in.throttle, sizeof(uint16_t)*5);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_radio_calibration_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_radio_calibration_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_radio_calibration_pack(system_id, component_id, &msg , packet1.aileron , packet1.elevator , packet1.rudder , packet1.gyro , packet1.pitch , packet1.throttle );
mavlink_msg_radio_calibration_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_radio_calibration_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.aileron , packet1.elevator , packet1.rudder , packet1.gyro , packet1.pitch , packet1.throttle );
mavlink_msg_radio_calibration_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_radio_calibration_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_radio_calibration_send(MAVLINK_COMM_1 , packet1.aileron , packet1.elevator , packet1.rudder , packet1.gyro , packet1.pitch , packet1.throttle );
mavlink_msg_radio_calibration_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ualberta_sys_status(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_ualberta_sys_status_t packet_in = {
5,
72,
139,
};
mavlink_ualberta_sys_status_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.mode = packet_in.mode;
packet1.nav_mode = packet_in.nav_mode;
packet1.pilot = packet_in.pilot;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ualberta_sys_status_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_ualberta_sys_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ualberta_sys_status_pack(system_id, component_id, &msg , packet1.mode , packet1.nav_mode , packet1.pilot );
mavlink_msg_ualberta_sys_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ualberta_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.mode , packet1.nav_mode , packet1.pilot );
mavlink_msg_ualberta_sys_status_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_ualberta_sys_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ualberta_sys_status_send(MAVLINK_COMM_1 , packet1.mode , packet1.nav_mode , packet1.pilot );
mavlink_msg_ualberta_sys_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ualberta(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_nav_filter_bias(system_id, component_id, last_msg);
mavlink_test_radio_calibration(system_id, component_id, last_msg);
mavlink_test_ualberta_sys_status(system_id, component_id, last_msg);
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // UALBERTA_TESTSUITE_H

View File

@ -0,0 +1,84 @@
/** @file
* @brief MAVLink comm protocol generated from ualberta.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef UALBERTA_H
#define UALBERTA_H
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 0, 28, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 0, 104, 244, 237, 222, 0, 158, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 71, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_FILTER_BIAS, MAVLINK_MESSAGE_INFO_RADIO_CALIBRATION, MAVLINK_MESSAGE_INFO_UALBERTA_SYS_STATUS, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_UALBERTA
#include "../common/common.h"
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
// ENUM DEFINITIONS
/** @brief Available autopilot modes for ualberta uav */
enum UALBERTA_AUTOPILOT_MODE
{
MODE_MANUAL_DIRECT=1, /* | */
MODE_MANUAL_SCALED=2, /* | */
MODE_AUTO_PID_ATT=3, /* | */
MODE_AUTO_PID_VEL=4, /* | */
MODE_AUTO_PID_POS=5, /* | */
UALBERTA_AUTOPILOT_MODE_ENUM_END=6, /* | */
};
/** @brief Navigation filter mode */
enum UALBERTA_NAV_MODE
{
NAV_AHRS_INIT=1, /* | */
NAV_AHRS=2, /* | */
NAV_INS_GPS_INIT=3, /* | */
NAV_INS_GPS=4, /* | */
UALBERTA_NAV_MODE_ENUM_END=5, /* | */
};
/** @brief Mode currently commanded by pilot */
enum UALBERTA_PILOT_MODE
{
PILOT_MANUAL=1, /* | */
PILOT_AUTO=2, /* | */
PILOT_ROTO=3, /* | */
UALBERTA_PILOT_MODE_ENUM_END=4, /* | */
};
// MESSAGE DEFINITIONS
#include "./mavlink_msg_nav_filter_bias.h"
#include "./mavlink_msg_radio_calibration.h"
#include "./mavlink_msg_ualberta_sys_status.h"
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // UALBERTA_H

View File

@ -0,0 +1,12 @@
/** @file
* @brief MAVLink comm protocol built from ualberta.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Oct 24 09:45:40 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
#endif // MAVLINK_VERSION_H

View File

@ -19,11 +19,11 @@
<entry value="4" name="MAV_AUTOPILOT_OPENPILOT">
<description>OpenPilot, http://openpilot.org</description>
</entry>
<entry value="5" name="MAV_AUTOPILOT_GENERIC_MISSION_MISSIONS_ONLY">
<description>Generic autopilot only supporting simple MISSIONs</description>
<entry value="5" name="MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY">
<description>Generic autopilot only supporting simple waypoints</description>
</entry>
<entry value="6" name="MAV_AUTOPILOT_GENERIC_MISSION_NAVIGATION_ONLY">
<description>Generic autopilot supporting MISSIONs and other simple navigation commands</description>
<entry value="6" name="MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY">
<description>Generic autopilot supporting waypoints and other simple navigation commands</description>
</entry>
<entry value="7" name="MAV_AUTOPILOT_GENERIC_MISSION_FULL">
<description>Generic autopilot supporting the full mission command set</description>
@ -97,7 +97,21 @@
<description>Eighth bit: 00000001</description>
</entry>
</enum>
<enum name="MAV_GOTO">
<description>Override command, pauses current mission execution and moves immediately to a position</description>
<entry value="0" name="MAV_GOTO_DO_HOLD">
<description>Hold at the current position.</description>
</entry>
<entry value="1" name="MAV_GOTO_DO_CONTINUE">
<description>Continue with the mission execution.</description>
</entry>
<entry value="2" name="MAV_GOTO_HOLD_AT_CURRENT_POSITION">
<description>Hold at the current position of the system</description>
</entry>
<entry value="3" name="MAV_GOTO_HOLD_AT_SPECIFIED_POSITION">
<description>Hold at the position specified in the parameters of the DO_HOLD action</description>
</entry>
</enum>
<enum name="MAV_MODE">
<description>These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it
simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override.</description>
@ -215,6 +229,9 @@
</entry>
</enum>
<enum name="MAV_COMPONENT">
<entry value="0" name="MAV_COMP_ID_ALL">
<description/>
</entry>
<entry value="220" name="MAV_COMP_ID_GPS">
<description/>
</entry>
@ -331,10 +348,10 @@
<enum name="MAV_CMD">
<description>Commands to be executed by the MAV. They can be executed on user request,
or as part of a mission script. If the action is used in a mission, the parameter mapping
to the MISSION/mission message is as follows:
to the waypoint/mission message is as follows:
Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what
ARINC 424 is for commercial aircraft: A data format how to interpret MISSION/mission data.</description>
<entry value="16" name="MAV_CMD_NAV_MISSION">
ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data.</description>
<entry value="16" name="MAV_CMD_NAV_WAYPOINT">
<description>Navigate to MISSION.</description>
<param index="1">Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)</param>
<param index="2">Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)</param>
@ -627,6 +644,26 @@
<param index="6">Empty</param>
<param index="7">Empty</param>
</entry>
<entry value="246" name="MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN">
<description>Request the reboot or shutdown of system components.</description>
<param index="1">0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.</param>
<param index="2">0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.</param>
<param index="3">Reserved</param>
<param index="4">Reserved</param>
<param index="5">Empty</param>
<param index="6">Empty</param>
<param index="7">Empty</param>
</entry>
<entry value="252" name="MAV_CMD_OVERRIDE_GOTO">
<description>Hold / continue the current action</description>
<param index="1">MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with mission plan</param>
<param index="2">MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position</param>
<param index="3">MAV_FRAME coordinate frame of hold point</param>
<param index="4">Desired yaw angle in degrees</param>
<param index="5">Latitude / X position</param>
<param index="6">Longitude / Y position</param>
<param index="7">Altitude / Z position</param>
</entry>
</enum>
<enum name="MAV_DATA_STREAM">
<description>Data stream IDs. A data stream is not a fixed set of messages, but rather a
@ -1214,8 +1251,8 @@
</message>
<message id="77" name="COMMAND_ACK">
<description>Report status of a command. Includes feedback wether the command was executed</description>
<field type="float" name="command">Current airspeed in m/s</field>
<field type="float" name="result">1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION</field>
<field type="uint16_t" name="command">Command ID, as defined by MAV_CMD enum.</field>
<field type="uint8_t" name="result">1: Command ACCEPTED and EXECUTED, 1: Command TEMPORARY REJECTED/DENIED, 2: Command PERMANENTLY DENIED, 3: Command UNKNOWN/UNSUPPORTED, 4: Command executed, but failed</field>
</message>
<!--
@ -1315,6 +1352,39 @@
<field type="uint8_t" name="quality">Optical flow quality / confidence. 0: bad, 255: maximum quality</field>
<field type="float" name="ground_distance">Ground distance in meters</field>
</message>
<message id="101" name="GLOBAL_VISION_POSITION_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X position</field>
<field type="float" name="y">Global Y position</field>
<field type="float" name="z">Global Z position</field>
<field type="float" name="roll">Roll angle in rad</field>
<field type="float" name="pitch">Pitch angle in rad</field>
<field type="float" name="yaw">Yaw angle in rad</field>
</message>
<message id="102" name="VISION_POSITION_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X position</field>
<field type="float" name="y">Global Y position</field>
<field type="float" name="z">Global Z position</field>
<field type="float" name="roll">Roll angle in rad</field>
<field type="float" name="pitch">Pitch angle in rad</field>
<field type="float" name="yaw">Yaw angle in rad</field>
</message>
<message id="103" name="VISION_SPEED_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X speed</field>
<field type="float" name="y">Global Y speed</field>
<field type="float" name="z">Global Z speed</field>
</message>
<message id="104" name="VICON_POSITION_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X position</field>
<field type="float" name="y">Global Y position</field>
<field type="float" name="z">Global Z position</field>
<field type="float" name="roll">Roll angle in rad</field>
<field type="float" name="pitch">Pitch angle in rad</field>
<field type="float" name="yaw">Yaw angle in rad</field>
</message>
<!-- MESSAGE IDs 150 - 240: Space for custom messages in individual projectname_messages.xml files -->
<message id="249" name="MEMORY_VECT">
<description>Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output.</description>

View File

@ -60,30 +60,6 @@
<field type="float" name="ground_y">Ground truth Y</field>
<field type="float" name="ground_z">Ground truth Z</field>
</message>
<message id="156" name="VISION_POSITION_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X position</field>
<field type="float" name="y">Global Y position</field>
<field type="float" name="z">Global Z position</field>
<field type="float" name="roll">Roll angle in rad</field>
<field type="float" name="pitch">Pitch angle in rad</field>
<field type="float" name="yaw">Yaw angle in rad</field>
</message>
<message id="157" name="VICON_POSITION_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X position</field>
<field type="float" name="y">Global Y position</field>
<field type="float" name="z">Global Z position</field>
<field type="float" name="roll">Roll angle in rad</field>
<field type="float" name="pitch">Pitch angle in rad</field>
<field type="float" name="yaw">Yaw angle in rad</field>
</message>
<message id="158" name="VISION_SPEED_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
<field type="float" name="x">Global X speed</field>
<field type="float" name="y">Global Y speed</field>
<field type="float" name="z">Global Z speed</field>
</message>
<message id="159" name="POSITION_CONTROL_SETPOINT_SET">
<description>Message sent to the MAV to set a new position as reference for the controller</description>
<field type="uint8_t" name="target_system">System ID</field>

View File

@ -8,7 +8,7 @@
<field type="char[10]" name="s">string</field>
<field type="uint8_t" name="u8">uint8_t</field>
<field type="uint16_t" name="u16">uint16_t</field>
<field type="uint32_t" name="u32" print_format="0x%08x">uint32_t</field>
<field print_format="0x%08x" type="uint32_t" name="u32">uint32_t</field>
<field type="uint64_t" name="u64">uint64_t</field>
<field type="int8_t" name="s8">int8_t</field>
<field type="int16_t" name="s16">int16_t</field>