From 8e1d9e3a1d771254de0e91f50c193e771a78a063 Mon Sep 17 00:00:00 2001 From: Adrian Zankich Date: Fri, 26 Sep 2014 19:30:52 -0700 Subject: [PATCH] Add mavlink docs --- platforms/mavlink/common/common.go | 4483 ++++++++++++++++++--------- platforms/mavlink/common/mavlink.go | 71 +- platforms/mavlink/common/version.go | 18 +- 3 files changed, 3035 insertions(+), 1537 deletions(-) diff --git a/platforms/mavlink/common/common.go b/platforms/mavlink/common/common.go index 1f36bded..da84d639 100644 --- a/platforms/mavlink/common/common.go +++ b/platforms/mavlink/common/common.go @@ -1,9 +1,9 @@ package mavlink -/** @file - * @brief MAVLink comm protocol generated from common.xml - * @see http://qgroundcontrol.org/mavlink/ - */ +// +// MAVLink comm protocol generated from common.xml +// http://qgroundcontrol.org/mavlink/ +// import ( "bytes" "encoding/binary" @@ -129,6 +129,7 @@ var messages = map[uint8]MAVLinkMessage{ 254: &Debug{}, } +// NewMAVLinkMessage returns a new MAVLinkMessage or an error if it encounters an unknown Message ID func NewMAVLinkMessage(msgid uint8, data []byte) (MAVLinkMessage, error) { message := messages[msgid] if message != nil { @@ -138,414 +139,523 @@ func NewMAVLinkMessage(msgid uint8, data []byte) (MAVLinkMessage, error) { return nil, errors.New(fmt.Sprintf("Unknown Message ID: %v", msgid)) } -/** @brief Micro air vehicle / autopilot classes. This identifies the individual model. */ +// // MAV_AUTOPILOT -const MAV_AUTOPILOT_GENERIC = 0 /* Generic autopilot, full support for everything | */ -const MAV_AUTOPILOT_PIXHAWK = 1 /* PIXHAWK autopilot, http://pixhawk.ethz.ch | */ -const MAV_AUTOPILOT_SLUGS = 2 /* SLUGS autopilot, http://slugsuav.soe.ucsc.edu | */ -const MAV_AUTOPILOT_ARDUPILOTMEGA = 3 /* ArduPilotMega / ArduCopter, http://diydrones.com | */ -const MAV_AUTOPILOT_OPENPILOT = 4 /* OpenPilot, http://openpilot.org | */ -const MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5 /* Generic autopilot only supporting simple waypoints | */ -const MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6 /* Generic autopilot supporting waypoints and other simple navigation commands | */ -const MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7 /* Generic autopilot supporting the full mission command set | */ -const MAV_AUTOPILOT_INVALID = 8 /* No valid autopilot, e.g. a GCS or other MAVLink component | */ -const MAV_AUTOPILOT_PPZ = 9 /* PPZ UAV - http://nongnu.org/paparazzi | */ -const MAV_AUTOPILOT_UDB = 10 /* UAV Dev Board | */ -const MAV_AUTOPILOT_FP = 11 /* FlexiPilot | */ -const MAV_AUTOPILOT_PX4 = 12 /* PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | */ -const MAV_AUTOPILOT_SMACCMPILOT = 13 /* SMACCMPilot - http://smaccmpilot.org | */ -const MAV_AUTOPILOT_AUTOQUAD = 14 /* AutoQuad -- http://autoquad.org | */ -const MAV_AUTOPILOT_ARMAZILA = 15 /* Armazila -- http://armazila.com | */ -const MAV_AUTOPILOT_AEROB = 16 /* Aerob -- http://aerob.ru | */ -const MAV_AUTOPILOT_ENUM_END = 17 /* | */ +/*Micro air vehicle / autopilot classes. This identifies the individual model.*/ +// +const ( + MAV_AUTOPILOT_GENERIC = 0 // Generic autopilot, full support for everything | + MAV_AUTOPILOT_PIXHAWK = 1 // PIXHAWK autopilot, http://pixhawk.ethz.ch | + 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_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 | + MAV_AUTOPILOT_UDB = 10 // UAV Dev Board | + MAV_AUTOPILOT_FP = 11 // FlexiPilot | + MAV_AUTOPILOT_PX4 = 12 // PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | + MAV_AUTOPILOT_SMACCMPILOT = 13 // SMACCMPilot - http://smaccmpilot.org | + MAV_AUTOPILOT_AUTOQUAD = 14 // AutoQuad -- http://autoquad.org | + MAV_AUTOPILOT_ARMAZILA = 15 // Armazila -- http://armazila.com | + MAV_AUTOPILOT_AEROB = 16 // Aerob -- http://aerob.ru | + MAV_AUTOPILOT_ENUM_END = 17 // | +) -/** @brief */ +// // MAV_TYPE -const MAV_TYPE_GENERIC = 0 /* Generic micro air vehicle. | */ -const MAV_TYPE_FIXED_WING = 1 /* Fixed wing aircraft. | */ -const MAV_TYPE_QUADROTOR = 2 /* Quadrotor | */ -const MAV_TYPE_COAXIAL = 3 /* Coaxial helicopter | */ -const MAV_TYPE_HELICOPTER = 4 /* Normal helicopter with tail rotor. | */ -const MAV_TYPE_ANTENNA_TRACKER = 5 /* Ground installation | */ -const MAV_TYPE_GCS = 6 /* Operator control unit / ground control station | */ -const MAV_TYPE_AIRSHIP = 7 /* Airship, controlled | */ -const MAV_TYPE_FREE_BALLOON = 8 /* Free balloon, uncontrolled | */ -const MAV_TYPE_ROCKET = 9 /* Rocket | */ -const MAV_TYPE_GROUND_ROVER = 10 /* Ground rover | */ -const MAV_TYPE_SURFACE_BOAT = 11 /* Surface vessel, boat, ship | */ -const MAV_TYPE_SUBMARINE = 12 /* Submarine | */ -const MAV_TYPE_HEXAROTOR = 13 /* Hexarotor | */ -const MAV_TYPE_OCTOROTOR = 14 /* Octorotor | */ -const MAV_TYPE_TRICOPTER = 15 /* Octorotor | */ -const MAV_TYPE_FLAPPING_WING = 16 /* Flapping wing | */ -const MAV_TYPE_KITE = 17 /* Flapping wing | */ -const MAV_TYPE_ONBOARD_CONTROLLER = 18 /* Onboard companion controller | */ -const MAV_TYPE_ENUM_END = 19 /* | */ +/**/ +// +const ( + MAV_TYPE_GENERIC = 0 // Generic micro air vehicle. | + MAV_TYPE_FIXED_WING = 1 // Fixed wing aircraft. | + MAV_TYPE_QUADROTOR = 2 // Quadrotor | + MAV_TYPE_COAXIAL = 3 // Coaxial helicopter | + MAV_TYPE_HELICOPTER = 4 // Normal helicopter with tail rotor. | + MAV_TYPE_ANTENNA_TRACKER = 5 // Ground installation | + MAV_TYPE_GCS = 6 // Operator control unit / ground control station | + MAV_TYPE_AIRSHIP = 7 // Airship, controlled | + MAV_TYPE_FREE_BALLOON = 8 // Free balloon, uncontrolled | + MAV_TYPE_ROCKET = 9 // Rocket | + MAV_TYPE_GROUND_ROVER = 10 // Ground rover | + MAV_TYPE_SURFACE_BOAT = 11 // Surface vessel, boat, ship | + MAV_TYPE_SUBMARINE = 12 // Submarine | + MAV_TYPE_HEXAROTOR = 13 // Hexarotor | + MAV_TYPE_OCTOROTOR = 14 // Octorotor | + MAV_TYPE_TRICOPTER = 15 // Octorotor | + MAV_TYPE_FLAPPING_WING = 16 // Flapping wing | + MAV_TYPE_KITE = 17 // Flapping wing | + MAV_TYPE_ONBOARD_CONTROLLER = 18 // Onboard companion controller | + MAV_TYPE_ENUM_END = 19 // | +) -/** @brief These flags encode the MAV mode. */ +// // MAV_MODE_FLAG -const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 /* 0b00000001 Reserved for future use. | */ -const MAV_MODE_FLAG_TEST_ENABLED = 2 /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ -const MAV_MODE_FLAG_AUTO_ENABLED = 4 /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ -const MAV_MODE_FLAG_GUIDED_ENABLED = 8 /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ -const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ -const MAV_MODE_FLAG_HIL_ENABLED = 32 /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ -const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 /* 0b01000000 remote control input is enabled. | */ -const MAV_MODE_FLAG_SAFETY_ARMED = 128 /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | */ -const MAV_MODE_FLAG_ENUM_END = 129 /* | */ +/*These flags encode the MAV mode.*/ +// +const ( + MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 // 0b00000001 Reserved for future use. | + MAV_MODE_FLAG_TEST_ENABLED = 2 // 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | + MAV_MODE_FLAG_AUTO_ENABLED = 4 // 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | + MAV_MODE_FLAG_GUIDED_ENABLED = 8 // 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | + MAV_MODE_FLAG_STABILIZE_ENABLED = 16 // 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | + MAV_MODE_FLAG_HIL_ENABLED = 32 // 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | + MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 // 0b01000000 remote control input is enabled. | + MAV_MODE_FLAG_SAFETY_ARMED = 128 // 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | + MAV_MODE_FLAG_ENUM_END = 129 // | +) -/** @brief These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. */ +// // MAV_MODE_FLAG_DECODE_POSITION -const MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1 /* Eighth bit: 00000001 | */ -const MAV_MODE_FLAG_DECODE_POSITION_TEST = 2 /* Seventh bit: 00000010 | */ -const MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4 /* Sixt bit: 00000100 | */ -const MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8 /* Fifth bit: 00001000 | */ -const MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16 /* Fourth bit: 00010000 | */ -const MAV_MODE_FLAG_DECODE_POSITION_HIL = 32 /* Third bit: 00100000 | */ -const MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64 /* Second bit: 01000000 | */ -const MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128 /* First bit: 10000000 | */ -const MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129 /* | */ +/*These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not.*/ +// +const ( + MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1 // Eighth bit: 00000001 | + MAV_MODE_FLAG_DECODE_POSITION_TEST = 2 // Seventh bit: 00000010 | + MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4 // Sixt bit: 00000100 | + MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8 // Fifth bit: 00001000 | + MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16 // Fourth bit: 00010000 | + MAV_MODE_FLAG_DECODE_POSITION_HIL = 32 // Third bit: 00100000 | + MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64 // Second bit: 01000000 | + MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128 // First bit: 10000000 | + MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129 // | +) -/** @brief Override command, pauses current mission execution and moves immediately to a position */ +// // MAV_GOTO -const MAV_GOTO_DO_HOLD = 0 /* Hold at the current position. | */ -const MAV_GOTO_DO_CONTINUE = 1 /* Continue with the next item in mission execution. | */ -const MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2 /* Hold at the current position of the system | */ -const MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3 /* Hold at the position specified in the parameters of the DO_HOLD action | */ -const MAV_GOTO_ENUM_END = 4 /* | */ +/*Override command, pauses current mission execution and moves immediately to a position*/ +// +const ( + MAV_GOTO_DO_HOLD = 0 // Hold at the current position. | + MAV_GOTO_DO_CONTINUE = 1 // Continue with the next item in 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. */ +// // MAV_MODE -const MAV_MODE_PREFLIGHT = 0 /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ -const MAV_MODE_MANUAL_DISARMED = 64 /* System is allowed to be active, under manual (RC) control, no stabilization | */ -const MAV_MODE_TEST_DISARMED = 66 /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ -const MAV_MODE_STABILIZE_DISARMED = 80 /* System is allowed to be active, under assisted RC control. | */ -const MAV_MODE_GUIDED_DISARMED = 88 /* System is allowed to be active, under autonomous control, manual setpoint | */ -const MAV_MODE_AUTO_DISARMED = 92 /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ -const MAV_MODE_MANUAL_ARMED = 192 /* System is allowed to be active, under manual (RC) control, no stabilization | */ -const MAV_MODE_TEST_ARMED = 194 /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ -const MAV_MODE_STABILIZE_ARMED = 208 /* System is allowed to be active, under assisted RC control. | */ -const MAV_MODE_GUIDED_ARMED = 216 /* System is allowed to be active, under autonomous control, manual setpoint | */ -const MAV_MODE_AUTO_ARMED = 220 /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ -const MAV_MODE_ENUM_END = 221 /* | */ +/*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.*/ +// +const ( + MAV_MODE_PREFLIGHT = 0 // System is not ready to fly, booting, calibrating, etc. No flag is set. | + MAV_MODE_MANUAL_DISARMED = 64 // System is allowed to be active, under manual (RC) control, no stabilization | + MAV_MODE_TEST_DISARMED = 66 // UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | + MAV_MODE_STABILIZE_DISARMED = 80 // System is allowed to be active, under assisted RC control. | + MAV_MODE_GUIDED_DISARMED = 88 // System is allowed to be active, under autonomous control, manual setpoint | + MAV_MODE_AUTO_DISARMED = 92 // System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | + MAV_MODE_MANUAL_ARMED = 192 // System is allowed to be active, under manual (RC) control, no stabilization | + MAV_MODE_TEST_ARMED = 194 // UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | + MAV_MODE_STABILIZE_ARMED = 208 // System is allowed to be active, under assisted RC control. | + MAV_MODE_GUIDED_ARMED = 216 // System is allowed to be active, under autonomous control, manual setpoint | + MAV_MODE_AUTO_ARMED = 220 // System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | + MAV_MODE_ENUM_END = 221 // | +) -/** @brief */ +// // MAV_STATE -const MAV_STATE_UNINIT = 0 /* Uninitialized system, state is unknown. | */ -const MAV_STATE_BOOT = 1 /* System is booting up. | */ -const MAV_STATE_CALIBRATING = 2 /* System is calibrating and not flight-ready. | */ -const MAV_STATE_STANDBY = 3 /* System is grounded and on standby. It can be launched any time. | */ -const MAV_STATE_ACTIVE = 4 /* System is active and might be already airborne. Motors are engaged. | */ -const MAV_STATE_CRITICAL = 5 /* System is in a non-normal flight mode. It can however still navigate. | */ -const MAV_STATE_EMERGENCY = 6 /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ -const MAV_STATE_POWEROFF = 7 /* System just initialized its power-down sequence, will shut down now. | */ -const MAV_STATE_ENUM_END = 8 /* | */ +/**/ +// +const ( + MAV_STATE_UNINIT = 0 // Uninitialized system, state is unknown. | + MAV_STATE_BOOT = 1 // System is booting up. | + MAV_STATE_CALIBRATING = 2 // System is calibrating and not flight-ready. | + MAV_STATE_STANDBY = 3 // System is grounded and on standby. It can be launched any time. | + MAV_STATE_ACTIVE = 4 // System is active and might be already airborne. Motors are engaged. | + MAV_STATE_CRITICAL = 5 // System is in a non-normal flight mode. It can however still navigate. | + MAV_STATE_EMERGENCY = 6 // System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | + MAV_STATE_POWEROFF = 7 // System just initialized its power-down sequence, will shut down now. | + MAV_STATE_ENUM_END = 8 // | +) -/** @brief */ +// // MAV_COMPONENT -const MAV_COMP_ID_ALL = 0 /* | */ -const MAV_COMP_ID_CAMERA = 100 /* | */ -const MAV_COMP_ID_SERVO1 = 140 /* | */ -const MAV_COMP_ID_SERVO2 = 141 /* | */ -const MAV_COMP_ID_SERVO3 = 142 /* | */ -const MAV_COMP_ID_SERVO4 = 143 /* | */ -const MAV_COMP_ID_SERVO5 = 144 /* | */ -const MAV_COMP_ID_SERVO6 = 145 /* | */ -const MAV_COMP_ID_SERVO7 = 146 /* | */ -const MAV_COMP_ID_SERVO8 = 147 /* | */ -const MAV_COMP_ID_SERVO9 = 148 /* | */ -const MAV_COMP_ID_SERVO10 = 149 /* | */ -const MAV_COMP_ID_SERVO11 = 150 /* | */ -const MAV_COMP_ID_SERVO12 = 151 /* | */ -const MAV_COMP_ID_SERVO13 = 152 /* | */ -const MAV_COMP_ID_SERVO14 = 153 /* | */ -const MAV_COMP_ID_MAPPER = 180 /* | */ -const MAV_COMP_ID_MISSIONPLANNER = 190 /* | */ -const MAV_COMP_ID_PATHPLANNER = 195 /* | */ -const MAV_COMP_ID_IMU = 200 /* | */ -const MAV_COMP_ID_IMU_2 = 201 /* | */ -const MAV_COMP_ID_IMU_3 = 202 /* | */ -const MAV_COMP_ID_GPS = 220 /* | */ -const MAV_COMP_ID_UDP_BRIDGE = 240 /* | */ -const MAV_COMP_ID_UART_BRIDGE = 241 /* | */ -const MAV_COMP_ID_SYSTEM_CONTROL = 250 /* | */ -const MAV_COMPONENT_ENUM_END = 251 /* | */ +/**/ +// +const ( + MAV_COMP_ID_ALL = 0 // | + MAV_COMP_ID_CAMERA = 100 // | + MAV_COMP_ID_SERVO1 = 140 // | + MAV_COMP_ID_SERVO2 = 141 // | + MAV_COMP_ID_SERVO3 = 142 // | + MAV_COMP_ID_SERVO4 = 143 // | + MAV_COMP_ID_SERVO5 = 144 // | + MAV_COMP_ID_SERVO6 = 145 // | + MAV_COMP_ID_SERVO7 = 146 // | + MAV_COMP_ID_SERVO8 = 147 // | + MAV_COMP_ID_SERVO9 = 148 // | + MAV_COMP_ID_SERVO10 = 149 // | + MAV_COMP_ID_SERVO11 = 150 // | + MAV_COMP_ID_SERVO12 = 151 // | + MAV_COMP_ID_SERVO13 = 152 // | + MAV_COMP_ID_SERVO14 = 153 // | + MAV_COMP_ID_MAPPER = 180 // | + MAV_COMP_ID_MISSIONPLANNER = 190 // | + MAV_COMP_ID_PATHPLANNER = 195 // | + MAV_COMP_ID_IMU = 200 // | + MAV_COMP_ID_IMU_2 = 201 // | + MAV_COMP_ID_IMU_3 = 202 // | + MAV_COMP_ID_GPS = 220 // | + MAV_COMP_ID_UDP_BRIDGE = 240 // | + MAV_COMP_ID_UART_BRIDGE = 241 // | + MAV_COMP_ID_SYSTEM_CONTROL = 250 // | + MAV_COMPONENT_ENUM_END = 251 // | +) -/** @brief These encode the sensors whose status is sent as part of the SYS_STATUS message. */ +// // MAV_SYS_STATUS_SENSOR -const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 /* 0x01 3D gyro | */ -const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 /* 0x02 3D accelerometer | */ -const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 /* 0x04 3D magnetometer | */ -const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 /* 0x08 absolute pressure | */ -const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 /* 0x10 differential pressure | */ -const MAV_SYS_STATUS_SENSOR_GPS = 32 /* 0x20 GPS | */ -const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 /* 0x40 optical flow | */ -const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 /* 0x80 computer vision position | */ -const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 /* 0x100 laser based position | */ -const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 /* 0x200 external ground truth (Vicon or Leica) | */ -const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 /* 0x400 3D angular rate control | */ -const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 /* 0x800 attitude stabilization | */ -const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 /* 0x1000 yaw position | */ -const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 /* 0x2000 z/altitude control | */ -const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 /* 0x4000 x/y position control | */ -const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 /* 0x8000 motor outputs / control | */ -const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 /* 0x10000 rc receiver | */ -const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 /* 0x20000 2nd 3D gyro | */ -const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 /* 0x40000 2nd 3D accelerometer | */ -const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 /* 0x80000 2nd 3D magnetometer | */ -const MAV_SYS_STATUS_GEOFENCE = 1048576 /* 0x100000 geofence | */ -const MAV_SYS_STATUS_AHRS = 2097152 /* 0x200000 AHRS subsystem health | */ -const MAV_SYS_STATUS_TERRAIN = 4194304 /* 0x400000 Terrain subsystem health | */ -const MAV_SYS_STATUS_SENSOR_ENUM_END = 4194305 /* | */ +/*These encode the sensors whose status is sent as part of the SYS_STATUS message.*/ +// +const ( + MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 // 0x01 3D gyro | + MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 // 0x02 3D accelerometer | + MAV_SYS_STATUS_SENSOR_3D_MAG = 4 // 0x04 3D magnetometer | + MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 // 0x08 absolute pressure | + MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 // 0x10 differential pressure | + MAV_SYS_STATUS_SENSOR_GPS = 32 // 0x20 GPS | + MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 // 0x40 optical flow | + MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 // 0x80 computer vision position | + MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 // 0x100 laser based position | + MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 // 0x200 external ground truth (Vicon or Leica) | + MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 // 0x400 3D angular rate control | + MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 // 0x800 attitude stabilization | + MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 // 0x1000 yaw position | + MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 // 0x2000 z/altitude control | + MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 // 0x4000 x/y position control | + MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 // 0x8000 motor outputs / control | + MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 // 0x10000 rc receiver | + MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 // 0x20000 2nd 3D gyro | + MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 // 0x40000 2nd 3D accelerometer | + MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 // 0x80000 2nd 3D magnetometer | + MAV_SYS_STATUS_GEOFENCE = 1048576 // 0x100000 geofence | + MAV_SYS_STATUS_AHRS = 2097152 // 0x200000 AHRS subsystem health | + MAV_SYS_STATUS_TERRAIN = 4194304 // 0x400000 Terrain subsystem health | + MAV_SYS_STATUS_SENSOR_ENUM_END = 4194305 // | +) -/** @brief */ +// // MAV_FRAME -const MAV_FRAME_GLOBAL = 0 /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ -const MAV_FRAME_LOCAL_NED = 1 /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ -const MAV_FRAME_MISSION = 2 /* NOT a coordinate frame, indicates a mission command. | */ -const MAV_FRAME_GLOBAL_RELATIVE_ALT = 3 /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ -const MAV_FRAME_LOCAL_ENU = 4 /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ -const MAV_FRAME_GLOBAL_INT = 5 /* Global coordinate frame with some fields as scaled integers, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL). Lat / Lon are scaled * 1E7 to avoid floating point accuracy limitations. | */ -const MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6 /* Global coordinate frame with some fields as scaled integers, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. Lat / Lon are scaled * 1E7 to avoid floating point accuracy limitations. | */ -const MAV_FRAME_LOCAL_OFFSET_NED = 7 /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ -const MAV_FRAME_BODY_NED = 8 /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ -const MAV_FRAME_BODY_OFFSET_NED = 9 /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ -const MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at ground level in terrain model. | */ -const MAV_FRAME_ENUM_END = 11 /* | */ +/**/ +// +const ( + MAV_FRAME_GLOBAL = 0 // Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | + MAV_FRAME_LOCAL_NED = 1 // Local coordinate frame, Z-up (x: north, y: east, z: down). | + MAV_FRAME_MISSION = 2 // NOT a coordinate frame, indicates a mission command. | + MAV_FRAME_GLOBAL_RELATIVE_ALT = 3 // Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | + MAV_FRAME_LOCAL_ENU = 4 // Local coordinate frame, Z-down (x: east, y: north, z: up) | + MAV_FRAME_GLOBAL_INT = 5 // Global coordinate frame with some fields as scaled integers, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL). Lat / Lon are scaled * 1E7 to avoid floating point accuracy limitations. | + MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6 // Global coordinate frame with some fields as scaled integers, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. Lat / Lon are scaled * 1E7 to avoid floating point accuracy limitations. | + MAV_FRAME_LOCAL_OFFSET_NED = 7 // Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | + MAV_FRAME_BODY_NED = 8 // Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | + MAV_FRAME_BODY_OFFSET_NED = 9 // Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | + MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 // Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at ground level in terrain model. | + MAV_FRAME_ENUM_END = 11 // | +) -/** @brief */ +// // MAVLINK_DATA_STREAM_TYPE -const MAVLINK_DATA_STREAM_IMG_JPEG = 1 /* | */ -const MAVLINK_DATA_STREAM_IMG_BMP = 2 /* | */ -const MAVLINK_DATA_STREAM_IMG_RAW8U = 3 /* | */ -const MAVLINK_DATA_STREAM_IMG_RAW32U = 4 /* | */ -const MAVLINK_DATA_STREAM_IMG_PGM = 5 /* | */ -const MAVLINK_DATA_STREAM_IMG_PNG = 6 /* | */ -const MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7 /* | */ +/**/ +// +const ( + MAVLINK_DATA_STREAM_IMG_JPEG = 1 // | + MAVLINK_DATA_STREAM_IMG_BMP = 2 // | + MAVLINK_DATA_STREAM_IMG_RAW8U = 3 // | + MAVLINK_DATA_STREAM_IMG_RAW32U = 4 // | + MAVLINK_DATA_STREAM_IMG_PGM = 5 // | + MAVLINK_DATA_STREAM_IMG_PNG = 6 // | + MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7 // | +) -/** @brief */ +// // FENCE_ACTION -const FENCE_ACTION_NONE = 0 /* Disable fenced mode | */ -const FENCE_ACTION_GUIDED = 1 /* Switched to guided mode to return point (fence point 0) | */ -const FENCE_ACTION_REPORT = 2 /* Report fence breach, but don't take action | */ -const FENCE_ACTION_GUIDED_THR_PASS = 3 /* Switched to guided mode to return point (fence point 0) with manual throttle control | */ -const FENCE_ACTION_ENUM_END = 4 /* | */ +/**/ +// +const ( + FENCE_ACTION_NONE = 0 // Disable fenced mode | + FENCE_ACTION_GUIDED = 1 // Switched to guided mode to return point (fence point 0) | + FENCE_ACTION_REPORT = 2 // Report fence breach, but don't take action | + FENCE_ACTION_GUIDED_THR_PASS = 3 // Switched to guided mode to return point (fence point 0) with manual throttle control | + FENCE_ACTION_ENUM_END = 4 // | +) -/** @brief */ +// // FENCE_BREACH -const FENCE_BREACH_NONE = 0 /* No last fence breach | */ -const FENCE_BREACH_MINALT = 1 /* Breached minimum altitude | */ -const FENCE_BREACH_MAXALT = 2 /* Breached maximum altitude | */ -const FENCE_BREACH_BOUNDARY = 3 /* Breached fence boundary | */ -const FENCE_BREACH_ENUM_END = 4 /* | */ +/**/ +// +const ( + FENCE_BREACH_NONE = 0 // No last fence breach | + FENCE_BREACH_MINALT = 1 // Breached minimum altitude | + FENCE_BREACH_MAXALT = 2 // Breached maximum altitude | + FENCE_BREACH_BOUNDARY = 3 // Breached fence boundary | + FENCE_BREACH_ENUM_END = 4 // | +) -/** @brief Enumeration of possible mount operation modes */ +// // MAV_MOUNT_MODE -const MAV_MOUNT_MODE_RETRACT = 0 /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ -const MAV_MOUNT_MODE_NEUTRAL = 1 /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ -const MAV_MOUNT_MODE_MAVLINK_TARGETING = 2 /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ -const MAV_MOUNT_MODE_RC_TARGETING = 3 /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ -const MAV_MOUNT_MODE_GPS_POINT = 4 /* Load neutral position and start to point to Lat,Lon,Alt | */ -const MAV_MOUNT_MODE_ENUM_END = 5 /* | */ +/*Enumeration of possible mount operation modes*/ +// +const ( + MAV_MOUNT_MODE_RETRACT = 0 // Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | + MAV_MOUNT_MODE_NEUTRAL = 1 // Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | + MAV_MOUNT_MODE_MAVLINK_TARGETING = 2 // Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | + MAV_MOUNT_MODE_RC_TARGETING = 3 // Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | + MAV_MOUNT_MODE_GPS_POINT = 4 // Load neutral position and start to point to Lat,Lon,Alt | + MAV_MOUNT_MODE_ENUM_END = 5 // | +) -/** @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 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 waypoint/mission data. */ +// // MAV_CMD -const 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| */ -const 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| */ -const 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| */ -const 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| */ -const MAV_CMD_NAV_RETURN_TO_LAUNCH = 20 /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_NAV_LAND = 21 /* Land at location |Empty| Empty| Empty| Desired yaw angle.| Latitude| Longitude| Altitude| */ -const MAV_CMD_NAV_TAKEOFF = 22 /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ -const MAV_CMD_NAV_ROI = 80 /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ -const MAV_CMD_NAV_PATHPLANNING = 81 /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ -const MAV_CMD_NAV_SPLINE_WAYPOINT = 82 /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ -const MAV_CMD_NAV_GUIDED_ENABLE = 92 /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_NAV_LAST = 95 /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_CONDITION_DELAY = 112 /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_CONDITION_CHANGE_ALT = 113 /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ -const MAV_CMD_CONDITION_DISTANCE = 114 /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_CONDITION_YAW = 115 /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ -const MAV_CMD_CONDITION_LAST = 159 /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_SET_MODE = 176 /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_JUMP = 177 /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_CHANGE_SPEED = 178 /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_SET_HOME = 179 /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ -const MAV_CMD_DO_SET_PARAMETER = 180 /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_SET_RELAY = 181 /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_REPEAT_RELAY = 182 /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_SET_SERVO = 183 /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_REPEAT_SERVO = 184 /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ -const MAV_CMD_DO_FLIGHTTERMINATION = 185 /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_RALLY_LAND = 190 /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_GO_AROUND = 191 /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_CONTROL_VIDEO = 200 /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ -const MAV_CMD_DO_SET_ROI = 201 /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ -const MAV_CMD_DO_DIGICAM_CONFIGURE = 202 /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ -const MAV_CMD_DO_DIGICAM_CONTROL = 203 /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ -const MAV_CMD_DO_MOUNT_CONFIGURE = 204 /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ -const MAV_CMD_DO_MOUNT_CONTROL = 205 /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value| */ -const MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206 /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_FENCE_ENABLE = 207 /* Mission command to enable the geofence |enable? (0=disable, 1=enable)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_PARACHUTE = 208 /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_INVERTED_FLIGHT = 210 /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220 /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ -const MAV_CMD_DO_GUIDED_MASTER = 221 /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ -const MAV_CMD_DO_GUIDED_LIMITS = 222 /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, WGS84) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, WGS84) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ -const MAV_CMD_DO_LAST = 240 /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ -const 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| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty| */ -const 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, 5: second magnetometer| 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| */ -const 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| */ -const 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| */ -const MAV_CMD_OVERRIDE_GOTO = 252 /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in 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| */ -const MAV_CMD_MISSION_START = 300 /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ -const MAV_CMD_COMPONENT_ARM_DISARM = 400 /* Arms / Disarms a component |1 to arm, 0 to disarm| */ -const MAV_CMD_START_RX_PAIR = 500 /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ -const MAV_CMD_ENUM_END = 501 /* | */ +/*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 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 waypoint/mission data.*/ +// +const ( + 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 | + MAV_CMD_NAV_RETURN_TO_LAUNCH = 20 // Return to launch location | Empty | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_NAV_LAND = 21 // Land at location | Empty | Empty | Empty | Desired yaw angle. | Latitude | Longitude | Altitude | + MAV_CMD_NAV_TAKEOFF = 22 // Takeoff from ground / hand | Minimum pitch (if airspeed sensor present), desired pitch without sensor | Empty | Empty | Yaw angle (if magnetometer present), ignored without magnetometer | Latitude | Longitude | Altitude | + MAV_CMD_NAV_ROI = 80 // Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | Region of intereset mode. (see MAV_ROI enum) | MISSION index/ target ID. (see MAV_ROI enum) | ROI index (allows a vehicle to manage multiple ROI's) | Empty | x the location of the fixed ROI (see MAV_FRAME) | y | z | + MAV_CMD_NAV_PATHPLANNING = 81 // Control autonomous path planning on the MAV. | 0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning | 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid | Empty | Yaw angle at goal, in compass degrees, [0..360] | Latitude/X of goal | Longitude/Y of goal | Altitude/Z of goal | + MAV_CMD_NAV_SPLINE_WAYPOINT = 82 // Navigate to MISSION using a spline path. | Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing) | Empty | Empty | Empty | Latitude/X of goal | Longitude/Y of goal | Altitude/Z of goal | + MAV_CMD_NAV_GUIDED_ENABLE = 92 // hand control over to an external controller | On / Off (> 0.5f on) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_NAV_LAST = 95 // NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration | Empty | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_CONDITION_DELAY = 112 // Delay mission state machine. | Delay in seconds (decimal) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_CONDITION_CHANGE_ALT = 113 // Ascend/descend at rate. Delay mission state machine until desired altitude reached. | Descent / Ascend rate (m/s) | Empty | Empty | Empty | Empty | Empty | Finish Altitude | + MAV_CMD_CONDITION_DISTANCE = 114 // Delay mission state machine until within desired distance of next NAV point. | Distance (meters) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_CONDITION_YAW = 115 // Reach a certain target angle. | target angle: [0-360], 0 is north | speed during yaw change:[deg per second] | direction: negative: counter clockwise, positive: clockwise [-1,1] | relative offset or absolute angle: [ 1,0] | Empty | Empty | Empty | + MAV_CMD_CONDITION_LAST = 159 // NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration | Empty | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_SET_MODE = 176 // Set system mode. | Mode, as defined by ENUM MAV_MODE | Custom mode - this is system specific, please refer to the individual autopilot specifications for details. | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_JUMP = 177 // Jump to the desired command in the mission list. Repeat this action only the specified number of times | Sequence number | Repeat count | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_CHANGE_SPEED = 178 // Change speed and/or throttle set points. | Speed type (0=Airspeed, 1=Ground Speed) | Speed (m/s, -1 indicates no change) | Throttle ( Percent, -1 indicates no change) | Empty | Empty | Empty | Empty | + MAV_CMD_DO_SET_HOME = 179 // Changes the home location either to the current location or a specified location. | Use current (1=use current location, 0=use specified location) | Empty | Empty | Empty | Latitude | Longitude | Altitude | + MAV_CMD_DO_SET_PARAMETER = 180 // Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. | Parameter number | Parameter value | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_SET_RELAY = 181 // Set a relay to a condition. | Relay number | Setting (1=on, 0=off, others possible depending on system hardware) | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_REPEAT_RELAY = 182 // Cycle a relay on and off for a desired number of cyles with a desired period. | Relay number | Cycle count | Cycle time (seconds, decimal) | Empty | Empty | Empty | Empty | + MAV_CMD_DO_SET_SERVO = 183 // Set a servo to a desired PWM value. | Servo number | PWM (microseconds, 1000 to 2000 typical) | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_REPEAT_SERVO = 184 // Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. | Servo number | PWM (microseconds, 1000 to 2000 typical) | Cycle count | Cycle time (seconds) | Empty | Empty | Empty | + MAV_CMD_DO_FLIGHTTERMINATION = 185 // Terminate flight immediately | Flight termination activated if > 0.5 | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_RALLY_LAND = 190 // Mission command to perform a landing from a rally point. | Break altitude (meters) | Landing speed (m/s) | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_GO_AROUND = 191 // Mission command to safely abort an autonmous landing. | Altitude (meters) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_CONTROL_VIDEO = 200 // Control onboard camera system. | Camera ID (-1 for all) | Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw | Transmission mode: 0: video stream, >0: single images every n seconds (decimal) | Recording: 0: disabled, 1: enabled compressed, 2: enabled raw | Empty | Empty | Empty | + MAV_CMD_DO_SET_ROI = 201 // Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | Region of intereset mode. (see MAV_ROI enum) | MISSION index/ target ID. (see MAV_ROI enum) | ROI index (allows a vehicle to manage multiple ROI's) | Empty | x the location of the fixed ROI (see MAV_FRAME) | y | z | + MAV_CMD_DO_DIGICAM_CONFIGURE = 202 // Mission command to configure an on-board camera controller system. | Modes: P, TV, AV, M, Etc | Shutter speed: Divisor number for one second | Aperture: F stop number | ISO number e.g. 80, 100, 200, Etc | Exposure type enumerator | Command Identity | Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) | + MAV_CMD_DO_DIGICAM_CONTROL = 203 // Mission command to control an on-board camera controller system. | Session control e.g. show/hide lens | Zoom's absolute position | Zooming step value to offset zoom from the current position | Focus Locking, Unlocking or Re-locking | Shooting Command | Command Identity | Empty | + MAV_CMD_DO_MOUNT_CONFIGURE = 204 // Mission command to configure a camera or antenna mount | Mount operation mode (see MAV_MOUNT_MODE enum) | stabilize roll? (1 = yes, 0 = no) | stabilize pitch? (1 = yes, 0 = no) | stabilize yaw? (1 = yes, 0 = no) | Empty | Empty | Empty | + MAV_CMD_DO_MOUNT_CONTROL = 205 // Mission command to control a camera or antenna mount | pitch or lat in degrees, depending on mount mode. | roll or lon in degrees depending on mount mode | yaw or alt (in meters) depending on mount mode | reserved | reserved | reserved | MAV_MOUNT_MODE enum value | + MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206 // Mission command to set CAM_TRIGG_DIST for this flight | Camera trigger distance (meters) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_FENCE_ENABLE = 207 // Mission command to enable the geofence | enable? (0=disable, 1=enable) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_PARACHUTE = 208 // Mission command to trigger a parachute | action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_INVERTED_FLIGHT = 210 // Change to/from inverted flight | inverted (0=normal, 1=inverted) | Empty | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220 // Mission command to control a camera or antenna mount, using a quaternion as reference. | q1 - quaternion param #1, w (1 in null-rotation) | q2 - quaternion param #2, x (0 in null-rotation) | q3 - quaternion param #3, y (0 in null-rotation) | q4 - quaternion param #4, z (0 in null-rotation) | Empty | Empty | Empty | + MAV_CMD_DO_GUIDED_MASTER = 221 // set id of master controller | System ID | Component ID | Empty | Empty | Empty | Empty | Empty | + MAV_CMD_DO_GUIDED_LIMITS = 222 // set limits for external control | timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout | absolute altitude min (in meters, WGS84) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit | absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit | horizontal move limit (in meters, WGS84) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit | Empty | Empty | Empty | + MAV_CMD_DO_LAST = 240 // NOP - This command is only used to mark the upper limit of the DO commands in the enumeration | Empty | Empty | Empty | Empty | Empty | Empty | Empty | + 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 | Accelerometer calibration: 0: no, 1: yes | Compass/Motor interference calibration: 0: no, 1: yes | 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, 5: second magnetometer | 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_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 next item in 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_MISSION_START = 300 // start running a mission | first_item: the first mission item to run | last_item: the last mission item to run (after this item is run, the mission ends) | + MAV_CMD_COMPONENT_ARM_DISARM = 400 // Arms / Disarms a component | 1 to arm, 0 to disarm | + MAV_CMD_START_RX_PAIR = 500 // Starts receiver pairing | 0:Spektrum | 0:Spektrum DSM2, 1:Spektrum DSMX | + MAV_CMD_ENUM_END = 501 // | +) -/** @brief Data stream IDs. A data stream is not a fixed set of messages, but rather a - recommendation to the autopilot software. Individual autopilots may or may not obey - the recommended messages. */ +// // MAV_DATA_STREAM -const MAV_DATA_STREAM_ALL = 0 /* Enable all data streams | */ -const MAV_DATA_STREAM_RAW_SENSORS = 1 /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ -const MAV_DATA_STREAM_EXTENDED_STATUS = 2 /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ -const MAV_DATA_STREAM_RC_CHANNELS = 3 /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ -const MAV_DATA_STREAM_RAW_CONTROLLER = 4 /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ -const MAV_DATA_STREAM_POSITION = 6 /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ -const MAV_DATA_STREAM_EXTRA1 = 10 /* Dependent on the autopilot | */ -const MAV_DATA_STREAM_EXTRA2 = 11 /* Dependent on the autopilot | */ -const MAV_DATA_STREAM_EXTRA3 = 12 /* Dependent on the autopilot | */ -const MAV_DATA_STREAM_ENUM_END = 13 /* | */ +/*Data stream IDs. A data stream is not a fixed set of messages, but rather a + recommendation to the autopilot software. Individual autopilots may or may not obey + the recommended messages.*/ +// +const ( + MAV_DATA_STREAM_ALL = 0 // Enable all data streams | + MAV_DATA_STREAM_RAW_SENSORS = 1 // Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | + MAV_DATA_STREAM_EXTENDED_STATUS = 2 // Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | + MAV_DATA_STREAM_RC_CHANNELS = 3 // Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | + MAV_DATA_STREAM_RAW_CONTROLLER = 4 // Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | + MAV_DATA_STREAM_POSITION = 6 // Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | + MAV_DATA_STREAM_EXTRA1 = 10 // Dependent on the autopilot | + MAV_DATA_STREAM_EXTRA2 = 11 // Dependent on the autopilot | + MAV_DATA_STREAM_EXTRA3 = 12 // Dependent on the autopilot | + MAV_DATA_STREAM_ENUM_END = 13 // | +) -/** @brief The ROI (region of interest) for the vehicle. This can be - be used by the vehicle for camera/vehicle attitude alignment (see - MAV_CMD_NAV_ROI). */ +// // MAV_ROI -const MAV_ROI_NONE = 0 /* No region of interest. | */ -const MAV_ROI_WPNEXT = 1 /* Point toward next MISSION. | */ -const MAV_ROI_WPINDEX = 2 /* Point toward given MISSION. | */ -const MAV_ROI_LOCATION = 3 /* Point toward fixed location. | */ -const MAV_ROI_TARGET = 4 /* Point toward of given id. | */ -const MAV_ROI_ENUM_END = 5 /* | */ +/* The ROI (region of interest) for the vehicle. This can be + be used by the vehicle for camera/vehicle attitude alignment (see + MAV_CMD_NAV_ROI).*/ +// +const ( + MAV_ROI_NONE = 0 // No region of interest. | + MAV_ROI_WPNEXT = 1 // Point toward next MISSION. | + MAV_ROI_WPINDEX = 2 // Point toward given MISSION. | + MAV_ROI_LOCATION = 3 // Point toward fixed location. | + MAV_ROI_TARGET = 4 // Point toward of given id. | + MAV_ROI_ENUM_END = 5 // | +) -/** @brief ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. */ +// // MAV_CMD_ACK -const MAV_CMD_ACK_OK = 1 /* Command / mission item is ok. | */ -const MAV_CMD_ACK_ERR_FAIL = 2 /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ -const MAV_CMD_ACK_ERR_ACCESS_DENIED = 3 /* The system is refusing to accept this command from this source / communication partner. | */ -const MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4 /* Command or mission item is not supported, other commands would be accepted. | */ -const MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5 /* The coordinate frame of this command / mission item is not supported. | */ -const MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6 /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ -const MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7 /* The X or latitude value is out of range. | */ -const MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8 /* The Y or longitude value is out of range. | */ -const MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9 /* The Z or altitude value is out of range. | */ -const MAV_CMD_ACK_ENUM_END = 10 /* | */ +/*ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission.*/ +// +const ( + MAV_CMD_ACK_OK = 1 // Command / mission item is ok. | + MAV_CMD_ACK_ERR_FAIL = 2 // Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | + MAV_CMD_ACK_ERR_ACCESS_DENIED = 3 // The system is refusing to accept this command from this source / communication partner. | + MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4 // Command or mission item is not supported, other commands would be accepted. | + MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5 // The coordinate frame of this command / mission item is not supported. | + MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6 // The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | + MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7 // The X or latitude value is out of range. | + MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8 // The Y or longitude value is out of range. | + MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9 // The Z or altitude value is out of range. | + MAV_CMD_ACK_ENUM_END = 10 // | +) -/** @brief Specifies the datatype of a MAVLink parameter. */ +// // MAV_PARAM_TYPE -const MAV_PARAM_TYPE_UINT8 = 1 /* 8-bit unsigned integer | */ -const MAV_PARAM_TYPE_INT8 = 2 /* 8-bit signed integer | */ -const MAV_PARAM_TYPE_UINT16 = 3 /* 16-bit unsigned integer | */ -const MAV_PARAM_TYPE_INT16 = 4 /* 16-bit signed integer | */ -const MAV_PARAM_TYPE_UINT32 = 5 /* 32-bit unsigned integer | */ -const MAV_PARAM_TYPE_INT32 = 6 /* 32-bit signed integer | */ -const MAV_PARAM_TYPE_UINT64 = 7 /* 64-bit unsigned integer | */ -const MAV_PARAM_TYPE_INT64 = 8 /* 64-bit signed integer | */ -const MAV_PARAM_TYPE_REAL32 = 9 /* 32-bit floating-point | */ -const MAV_PARAM_TYPE_REAL64 = 10 /* 64-bit floating-point | */ -const MAV_PARAM_TYPE_ENUM_END = 11 /* | */ +/*Specifies the datatype of a MAVLink parameter.*/ +// +const ( + MAV_PARAM_TYPE_UINT8 = 1 // 8-bit unsigned integer | + MAV_PARAM_TYPE_INT8 = 2 // 8-bit signed integer | + MAV_PARAM_TYPE_UINT16 = 3 // 16-bit unsigned integer | + MAV_PARAM_TYPE_INT16 = 4 // 16-bit signed integer | + MAV_PARAM_TYPE_UINT32 = 5 // 32-bit unsigned integer | + MAV_PARAM_TYPE_INT32 = 6 // 32-bit signed integer | + MAV_PARAM_TYPE_UINT64 = 7 // 64-bit unsigned integer | + MAV_PARAM_TYPE_INT64 = 8 // 64-bit signed integer | + MAV_PARAM_TYPE_REAL32 = 9 // 32-bit floating-point | + MAV_PARAM_TYPE_REAL64 = 10 // 64-bit floating-point | + MAV_PARAM_TYPE_ENUM_END = 11 // | +) -/** @brief result from a mavlink command */ +// // MAV_RESULT -const MAV_RESULT_ACCEPTED = 0 /* Command ACCEPTED and EXECUTED | */ -const MAV_RESULT_TEMPORARILY_REJECTED = 1 /* Command TEMPORARY REJECTED/DENIED | */ -const MAV_RESULT_DENIED = 2 /* Command PERMANENTLY DENIED | */ -const MAV_RESULT_UNSUPPORTED = 3 /* Command UNKNOWN/UNSUPPORTED | */ -const MAV_RESULT_FAILED = 4 /* Command executed, but failed | */ -const MAV_RESULT_ENUM_END = 5 /* | */ +/*result from a mavlink command*/ +// +const ( + MAV_RESULT_ACCEPTED = 0 // Command ACCEPTED and EXECUTED | + MAV_RESULT_TEMPORARILY_REJECTED = 1 // Command TEMPORARY REJECTED/DENIED | + MAV_RESULT_DENIED = 2 // Command PERMANENTLY DENIED | + MAV_RESULT_UNSUPPORTED = 3 // Command UNKNOWN/UNSUPPORTED | + MAV_RESULT_FAILED = 4 // Command executed, but failed | + MAV_RESULT_ENUM_END = 5 // | +) -/** @brief result in a mavlink mission ack */ +// // MAV_MISSION_RESULT -const MAV_MISSION_ACCEPTED = 0 /* mission accepted OK | */ -const MAV_MISSION_ERROR = 1 /* generic error / not accepting mission commands at all right now | */ -const MAV_MISSION_UNSUPPORTED_FRAME = 2 /* coordinate frame is not supported | */ -const MAV_MISSION_UNSUPPORTED = 3 /* command is not supported | */ -const MAV_MISSION_NO_SPACE = 4 /* mission item exceeds storage space | */ -const MAV_MISSION_INVALID = 5 /* one of the parameters has an invalid value | */ -const MAV_MISSION_INVALID_PARAM1 = 6 /* param1 has an invalid value | */ -const MAV_MISSION_INVALID_PARAM2 = 7 /* param2 has an invalid value | */ -const MAV_MISSION_INVALID_PARAM3 = 8 /* param3 has an invalid value | */ -const MAV_MISSION_INVALID_PARAM4 = 9 /* param4 has an invalid value | */ -const MAV_MISSION_INVALID_PARAM5_X = 10 /* x/param5 has an invalid value | */ -const MAV_MISSION_INVALID_PARAM6_Y = 11 /* y/param6 has an invalid value | */ -const MAV_MISSION_INVALID_PARAM7 = 12 /* param7 has an invalid value | */ -const MAV_MISSION_INVALID_SEQUENCE = 13 /* received waypoint out of sequence | */ -const MAV_MISSION_DENIED = 14 /* not accepting any mission commands from this communication partner | */ -const MAV_MISSION_RESULT_ENUM_END = 15 /* | */ +/*result in a mavlink mission ack*/ +// +const ( + MAV_MISSION_ACCEPTED = 0 // mission accepted OK | + MAV_MISSION_ERROR = 1 // generic error / not accepting mission commands at all right now | + MAV_MISSION_UNSUPPORTED_FRAME = 2 // coordinate frame is not supported | + MAV_MISSION_UNSUPPORTED = 3 // command is not supported | + MAV_MISSION_NO_SPACE = 4 // mission item exceeds storage space | + MAV_MISSION_INVALID = 5 // one of the parameters has an invalid value | + MAV_MISSION_INVALID_PARAM1 = 6 // param1 has an invalid value | + MAV_MISSION_INVALID_PARAM2 = 7 // param2 has an invalid value | + MAV_MISSION_INVALID_PARAM3 = 8 // param3 has an invalid value | + MAV_MISSION_INVALID_PARAM4 = 9 // param4 has an invalid value | + MAV_MISSION_INVALID_PARAM5_X = 10 // x/param5 has an invalid value | + MAV_MISSION_INVALID_PARAM6_Y = 11 // y/param6 has an invalid value | + MAV_MISSION_INVALID_PARAM7 = 12 // param7 has an invalid value | + MAV_MISSION_INVALID_SEQUENCE = 13 // received waypoint out of sequence | + MAV_MISSION_DENIED = 14 // not accepting any mission commands from this communication partner | + MAV_MISSION_RESULT_ENUM_END = 15 // | +) -/** @brief Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. */ +// // MAV_SEVERITY -const MAV_SEVERITY_EMERGENCY = 0 /* System is unusable. This is a "panic" condition. | */ -const MAV_SEVERITY_ALERT = 1 /* Action should be taken immediately. Indicates error in non-critical systems. | */ -const MAV_SEVERITY_CRITICAL = 2 /* Action must be taken immediately. Indicates failure in a primary system. | */ -const MAV_SEVERITY_ERROR = 3 /* Indicates an error in secondary/redundant systems. | */ -const MAV_SEVERITY_WARNING = 4 /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ -const MAV_SEVERITY_NOTICE = 5 /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */ -const MAV_SEVERITY_INFO = 6 /* Normal operational messages. Useful for logging. No action is required for these messages. | */ -const MAV_SEVERITY_DEBUG = 7 /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ -const MAV_SEVERITY_ENUM_END = 8 /* | */ +/*Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/.*/ +// +const ( + MAV_SEVERITY_EMERGENCY = 0 // System is unusable. This is a "panic" condition. | + MAV_SEVERITY_ALERT = 1 // Action should be taken immediately. Indicates error in non-critical systems. | + MAV_SEVERITY_CRITICAL = 2 // Action must be taken immediately. Indicates failure in a primary system. | + MAV_SEVERITY_ERROR = 3 // Indicates an error in secondary/redundant systems. | + MAV_SEVERITY_WARNING = 4 // Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | + MAV_SEVERITY_NOTICE = 5 // An unusual event has occured, though not an error condition. This should be investigated for the root cause. | + MAV_SEVERITY_INFO = 6 // Normal operational messages. Useful for logging. No action is required for these messages. | + MAV_SEVERITY_DEBUG = 7 // Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | + MAV_SEVERITY_ENUM_END = 8 // | +) -/** @brief Power supply status flags (bitmask) */ +// // MAV_POWER_STATUS -const MAV_POWER_STATUS_BRICK_VALID = 1 /* main brick power supply valid | */ -const MAV_POWER_STATUS_SERVO_VALID = 2 /* main servo power supply valid for FMU | */ -const MAV_POWER_STATUS_USB_CONNECTED = 4 /* USB power is connected | */ -const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 /* peripheral supply is in over-current state | */ -const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 /* hi-power peripheral supply is in over-current state | */ -const MAV_POWER_STATUS_CHANGED = 32 /* Power status has changed since boot | */ -const MAV_POWER_STATUS_ENUM_END = 33 /* | */ +/*Power supply status flags (bitmask)*/ +// +const ( + MAV_POWER_STATUS_BRICK_VALID = 1 // main brick power supply valid | + MAV_POWER_STATUS_SERVO_VALID = 2 // main servo power supply valid for FMU | + MAV_POWER_STATUS_USB_CONNECTED = 4 // USB power is connected | + MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 // peripheral supply is in over-current state | + MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 // hi-power peripheral supply is in over-current state | + MAV_POWER_STATUS_CHANGED = 32 // Power status has changed since boot | + MAV_POWER_STATUS_ENUM_END = 33 // | +) -/** @brief SERIAL_CONTROL device types */ +// // SERIAL_CONTROL_DEV -const SERIAL_CONTROL_DEV_TELEM1 = 0 /* First telemetry port | */ -const SERIAL_CONTROL_DEV_TELEM2 = 1 /* Second telemetry port | */ -const SERIAL_CONTROL_DEV_GPS1 = 2 /* First GPS port | */ -const SERIAL_CONTROL_DEV_GPS2 = 3 /* Second GPS port | */ -const SERIAL_CONTROL_DEV_ENUM_END = 4 /* | */ +/*SERIAL_CONTROL device types*/ +// +const ( + SERIAL_CONTROL_DEV_TELEM1 = 0 // First telemetry port | + SERIAL_CONTROL_DEV_TELEM2 = 1 // Second telemetry port | + SERIAL_CONTROL_DEV_GPS1 = 2 // First GPS port | + SERIAL_CONTROL_DEV_GPS2 = 3 // Second GPS port | + SERIAL_CONTROL_DEV_ENUM_END = 4 // | +) -/** @brief SERIAL_CONTROL flags (bitmask) */ +// // SERIAL_CONTROL_FLAG -const SERIAL_CONTROL_FLAG_REPLY = 1 /* Set if this is a reply | */ -const SERIAL_CONTROL_FLAG_RESPOND = 2 /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ -const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ -const SERIAL_CONTROL_FLAG_BLOCKING = 8 /* Block on writes to the serial port | */ -const SERIAL_CONTROL_FLAG_MULTI = 16 /* Send multiple replies until port is drained | */ -const SERIAL_CONTROL_FLAG_ENUM_END = 17 /* | */ +/*SERIAL_CONTROL flags (bitmask)*/ +// +const ( + SERIAL_CONTROL_FLAG_REPLY = 1 // Set if this is a reply | + SERIAL_CONTROL_FLAG_RESPOND = 2 // Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | + SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 // Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | + SERIAL_CONTROL_FLAG_BLOCKING = 8 // Block on writes to the serial port | + SERIAL_CONTROL_FLAG_MULTI = 16 // Send multiple replies until port is drained | + SERIAL_CONTROL_FLAG_ENUM_END = 17 // | +) -/** @brief Enumeration of distance sensor types */ +// // MAV_DISTANCE_SENSOR -const MAV_DISTANCE_SENSOR_LASER = 0 /* Laser altimeter, e.g. LightWare SF02/F or PulsedLight units | */ -const MAV_DISTANCE_SENSOR_ULTRASOUND = 1 /* Ultrasound altimeter, e.g. MaxBotix units | */ -const MAV_DISTANCE_SENSOR_ENUM_END = 2 /* | */ +/*Enumeration of distance sensor types*/ +// +const ( + MAV_DISTANCE_SENSOR_LASER = 0 // Laser altimeter, e.g. LightWare SF02/F or PulsedLight units | + MAV_DISTANCE_SENSOR_ULTRASOUND = 1 // Ultrasound altimeter, e.g. MaxBotix units | + MAV_DISTANCE_SENSOR_ENUM_END = 2 // | +) +// // MESSAGE HEARTBEAT - +// // MAVLINK_MSG_ID_HEARTBEAT 0 +// // MAVLINK_MSG_ID_HEARTBEAT_LEN 9 +// // MAVLINK_MSG_ID_HEARTBEAT_CRC 50 - +// +// type Heartbeat struct { - CUSTOM_MODE uint32 ///< A bitfield for use for autopilot-specific flags. - TYPE uint8 ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - AUTOPILOT uint8 ///< Autopilot type / class. defined in MAV_AUTOPILOT ENUM - BASE_MODE uint8 ///< System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - SYSTEM_STATUS uint8 ///< System status flag, see MAV_STATE ENUM - MAVLINK_VERSION uint8 ///< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version + CUSTOM_MODE uint32 // A bitfield for use for autopilot-specific flags. + TYPE uint8 // Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) + AUTOPILOT uint8 // Autopilot type / class. defined in MAV_AUTOPILOT ENUM + BASE_MODE uint8 // System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h + SYSTEM_STATUS uint8 // System status flag, see MAV_STATE ENUM + MAVLINK_VERSION uint8 // MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version } -func NewHeartbeat(CUSTOM_MODE uint32, TYPE uint8, AUTOPILOT uint8, BASE_MODE uint8, SYSTEM_STATUS uint8, MAVLINK_VERSION uint8) MAVLinkMessage { +// NewHeartbeat returns a new Heartbeat +func NewHeartbeat(CUSTOM_MODE uint32, TYPE uint8, AUTOPILOT uint8, BASE_MODE uint8, SYSTEM_STATUS uint8, MAVLINK_VERSION uint8) *Heartbeat { m := Heartbeat{} m.CUSTOM_MODE = CUSTOM_MODE m.TYPE = TYPE @@ -556,18 +666,22 @@ func NewHeartbeat(CUSTOM_MODE uint32, TYPE uint8, AUTOPILOT uint8, BASE_MODE uin return &m } +// Id returns the Heartbeat Message ID func (*Heartbeat) Id() uint8 { return 0 } +// Len returns the Heartbeat Message Length func (*Heartbeat) Len() uint8 { return 9 } +// Crc returns the Heartbeat Message CRC func (*Heartbeat) Crc() uint8 { return 50 } +// Pack returns a packed byte array which represents a Heartbeat payload func (m *Heartbeat) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.CUSTOM_MODE) @@ -579,6 +693,7 @@ func (m *Heartbeat) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Heartbeat func (m *Heartbeat) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.CUSTOM_MODE) @@ -589,29 +704,36 @@ func (m *Heartbeat) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.MAVLINK_VERSION) } +const () + +// // MESSAGE SYS_STATUS - +// // MAVLINK_MSG_ID_SYS_STATUS 1 +// // MAVLINK_MSG_ID_SYS_STATUS_LEN 31 +// // MAVLINK_MSG_ID_SYS_STATUS_CRC 124 - +// +// type SysStatus struct { - ONBOARD_CONTROL_SENSORS_PRESENT uint32 ///< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - ONBOARD_CONTROL_SENSORS_ENABLED uint32 ///< Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - ONBOARD_CONTROL_SENSORS_HEALTH uint32 ///< Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - LOAD uint16 ///< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - VOLTAGE_BATTERY uint16 ///< Battery voltage, in millivolts (1 = 1 millivolt) - CURRENT_BATTERY int16 ///< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - DROP_RATE_COMM uint16 ///< Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - ERRORS_COMM uint16 ///< Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - ERRORS_COUNT1 uint16 ///< Autopilot-specific errors - ERRORS_COUNT2 uint16 ///< Autopilot-specific errors - ERRORS_COUNT3 uint16 ///< Autopilot-specific errors - ERRORS_COUNT4 uint16 ///< Autopilot-specific errors - BATTERY_REMAINING int8 ///< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery + ONBOARD_CONTROL_SENSORS_PRESENT uint32 // Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + ONBOARD_CONTROL_SENSORS_ENABLED uint32 // Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + ONBOARD_CONTROL_SENSORS_HEALTH uint32 // Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + LOAD uint16 // Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 + VOLTAGE_BATTERY uint16 // Battery voltage, in millivolts (1 = 1 millivolt) + CURRENT_BATTERY int16 // Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + DROP_RATE_COMM uint16 // Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + ERRORS_COMM uint16 // Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + ERRORS_COUNT1 uint16 // Autopilot-specific errors + ERRORS_COUNT2 uint16 // Autopilot-specific errors + ERRORS_COUNT3 uint16 // Autopilot-specific errors + ERRORS_COUNT4 uint16 // Autopilot-specific errors + BATTERY_REMAINING int8 // Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery } -func NewSysStatus(ONBOARD_CONTROL_SENSORS_PRESENT uint32, ONBOARD_CONTROL_SENSORS_ENABLED uint32, ONBOARD_CONTROL_SENSORS_HEALTH uint32, LOAD uint16, VOLTAGE_BATTERY uint16, CURRENT_BATTERY int16, DROP_RATE_COMM uint16, ERRORS_COMM uint16, ERRORS_COUNT1 uint16, ERRORS_COUNT2 uint16, ERRORS_COUNT3 uint16, ERRORS_COUNT4 uint16, BATTERY_REMAINING int8) MAVLinkMessage { +// NewSysStatus returns a new SysStatus +func NewSysStatus(ONBOARD_CONTROL_SENSORS_PRESENT uint32, ONBOARD_CONTROL_SENSORS_ENABLED uint32, ONBOARD_CONTROL_SENSORS_HEALTH uint32, LOAD uint16, VOLTAGE_BATTERY uint16, CURRENT_BATTERY int16, DROP_RATE_COMM uint16, ERRORS_COMM uint16, ERRORS_COUNT1 uint16, ERRORS_COUNT2 uint16, ERRORS_COUNT3 uint16, ERRORS_COUNT4 uint16, BATTERY_REMAINING int8) *SysStatus { m := SysStatus{} m.ONBOARD_CONTROL_SENSORS_PRESENT = ONBOARD_CONTROL_SENSORS_PRESENT m.ONBOARD_CONTROL_SENSORS_ENABLED = ONBOARD_CONTROL_SENSORS_ENABLED @@ -629,18 +751,22 @@ func NewSysStatus(ONBOARD_CONTROL_SENSORS_PRESENT uint32, ONBOARD_CONTROL_SENSOR return &m } +// Id returns the SysStatus Message ID func (*SysStatus) Id() uint8 { return 1 } +// Len returns the SysStatus Message Length func (*SysStatus) Len() uint8 { return 31 } +// Crc returns the SysStatus Message CRC func (*SysStatus) Crc() uint8 { return 124 } +// Pack returns a packed byte array which represents a SysStatus payload func (m *SysStatus) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_PRESENT) @@ -659,6 +785,7 @@ func (m *SysStatus) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SysStatus func (m *SysStatus) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.ONBOARD_CONTROL_SENSORS_PRESENT) @@ -676,36 +803,47 @@ func (m *SysStatus) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.BATTERY_REMAINING) } +const () + +// // MESSAGE SYSTEM_TIME - +// // MAVLINK_MSG_ID_SYSTEM_TIME 2 +// // MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12 +// // MAVLINK_MSG_ID_SYSTEM_TIME_CRC 137 - +// +// type SystemTime struct { - TIME_UNIX_USEC uint64 ///< Timestamp of the master clock in microseconds since UNIX epoch. - TIME_BOOT_MS uint32 ///< Timestamp of the component clock since boot time in milliseconds. + TIME_UNIX_USEC uint64 // Timestamp of the master clock in microseconds since UNIX epoch. + TIME_BOOT_MS uint32 // Timestamp of the component clock since boot time in milliseconds. } -func NewSystemTime(TIME_UNIX_USEC uint64, TIME_BOOT_MS uint32) MAVLinkMessage { +// NewSystemTime returns a new SystemTime +func NewSystemTime(TIME_UNIX_USEC uint64, TIME_BOOT_MS uint32) *SystemTime { m := SystemTime{} m.TIME_UNIX_USEC = TIME_UNIX_USEC m.TIME_BOOT_MS = TIME_BOOT_MS return &m } +// Id returns the SystemTime Message ID func (*SystemTime) Id() uint8 { return 2 } +// Len returns the SystemTime Message Length func (*SystemTime) Len() uint8 { return 12 } +// Crc returns the SystemTime Message CRC func (*SystemTime) Crc() uint8 { return 137 } +// Pack returns a packed byte array which represents a SystemTime payload func (m *SystemTime) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_UNIX_USEC) @@ -713,26 +851,34 @@ func (m *SystemTime) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SystemTime func (m *SystemTime) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_UNIX_USEC) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) } +const () + +// // MESSAGE PING - +// // MAVLINK_MSG_ID_PING 4 +// // MAVLINK_MSG_ID_PING_LEN 14 +// // MAVLINK_MSG_ID_PING_CRC 237 - +// +// type Ping struct { - TIME_USEC uint64 ///< Unix timestamp in microseconds - SEQ uint32 ///< PING sequence - TARGET_SYSTEM uint8 ///< 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - TARGET_COMPONENT uint8 ///< 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + TIME_USEC uint64 // Unix timestamp in microseconds + SEQ uint32 // PING sequence + TARGET_SYSTEM uint8 // 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system + TARGET_COMPONENT uint8 // 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system } -func NewPing(TIME_USEC uint64, SEQ uint32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewPing returns a new Ping +func NewPing(TIME_USEC uint64, SEQ uint32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *Ping { m := Ping{} m.TIME_USEC = TIME_USEC m.SEQ = SEQ @@ -741,18 +887,22 @@ func NewPing(TIME_USEC uint64, SEQ uint32, TARGET_SYSTEM uint8, TARGET_COMPONENT return &m } +// Id returns the Ping Message ID func (*Ping) Id() uint8 { return 4 } +// Len returns the Ping Message Length func (*Ping) Len() uint8 { return 14 } +// Crc returns the Ping Message CRC func (*Ping) Crc() uint8 { return 237 } +// Pack returns a packed byte array which represents a Ping payload func (m *Ping) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -762,6 +912,7 @@ func (m *Ping) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Ping func (m *Ping) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -770,20 +921,27 @@ func (m *Ping) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE CHANGE_OPERATOR_CONTROL - +// // MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5 +// // MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28 +// // MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC 217 - +// +// type ChangeOperatorControl struct { - TARGET_SYSTEM uint8 ///< System the GCS requests control for - CONTROL_REQUEST uint8 ///< 0: request control of this MAV, 1: Release control of this MAV - VERSION uint8 ///< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - PASSKEY [25]uint8 ///< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + TARGET_SYSTEM uint8 // System the GCS requests control for + CONTROL_REQUEST uint8 // 0: request control of this MAV, 1: Release control of this MAV + VERSION uint8 // 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + PASSKEY [25]uint8 // Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" } -func NewChangeOperatorControl(TARGET_SYSTEM uint8, CONTROL_REQUEST uint8, VERSION uint8, PASSKEY [25]uint8) MAVLinkMessage { +// NewChangeOperatorControl returns a new ChangeOperatorControl +func NewChangeOperatorControl(TARGET_SYSTEM uint8, CONTROL_REQUEST uint8, VERSION uint8, PASSKEY [25]uint8) *ChangeOperatorControl { m := ChangeOperatorControl{} m.TARGET_SYSTEM = TARGET_SYSTEM m.CONTROL_REQUEST = CONTROL_REQUEST @@ -792,18 +950,22 @@ func NewChangeOperatorControl(TARGET_SYSTEM uint8, CONTROL_REQUEST uint8, VERSIO return &m } +// Id returns the ChangeOperatorControl Message ID func (*ChangeOperatorControl) Id() uint8 { return 5 } +// Len returns the ChangeOperatorControl Message Length func (*ChangeOperatorControl) Len() uint8 { return 28 } +// Crc returns the ChangeOperatorControl Message CRC func (*ChangeOperatorControl) Crc() uint8 { return 217 } +// Pack returns a packed byte array which represents a ChangeOperatorControl payload func (m *ChangeOperatorControl) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -813,6 +975,7 @@ func (m *ChangeOperatorControl) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ChangeOperatorControl func (m *ChangeOperatorControl) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) @@ -821,21 +984,28 @@ func (m *ChangeOperatorControl) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.PASSKEY) } -const MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_passkey_LEN = 25 +const ( + MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_passkey_LEN = 25 +) +// // MESSAGE CHANGE_OPERATOR_CONTROL_ACK - +// // MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6 +// // MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3 +// // MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC 104 - +// +// type ChangeOperatorControlAck struct { - GCS_SYSTEM_ID uint8 ///< ID of the GCS this message - CONTROL_REQUEST uint8 ///< 0: request control of this MAV, 1: Release control of this MAV - ACK uint8 ///< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + GCS_SYSTEM_ID uint8 // ID of the GCS this message + CONTROL_REQUEST uint8 // 0: request control of this MAV, 1: Release control of this MAV + ACK uint8 // 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control } -func NewChangeOperatorControlAck(GCS_SYSTEM_ID uint8, CONTROL_REQUEST uint8, ACK uint8) MAVLinkMessage { +// NewChangeOperatorControlAck returns a new ChangeOperatorControlAck +func NewChangeOperatorControlAck(GCS_SYSTEM_ID uint8, CONTROL_REQUEST uint8, ACK uint8) *ChangeOperatorControlAck { m := ChangeOperatorControlAck{} m.GCS_SYSTEM_ID = GCS_SYSTEM_ID m.CONTROL_REQUEST = CONTROL_REQUEST @@ -843,18 +1013,22 @@ func NewChangeOperatorControlAck(GCS_SYSTEM_ID uint8, CONTROL_REQUEST uint8, ACK return &m } +// Id returns the ChangeOperatorControlAck Message ID func (*ChangeOperatorControlAck) Id() uint8 { return 6 } +// Len returns the ChangeOperatorControlAck Message Length func (*ChangeOperatorControlAck) Len() uint8 { return 3 } +// Crc returns the ChangeOperatorControlAck Message CRC func (*ChangeOperatorControlAck) Crc() uint8 { return 104 } +// Pack returns a packed byte array which represents a ChangeOperatorControlAck payload func (m *ChangeOperatorControlAck) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.GCS_SYSTEM_ID) @@ -863,6 +1037,7 @@ func (m *ChangeOperatorControlAck) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ChangeOperatorControlAck func (m *ChangeOperatorControlAck) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.GCS_SYSTEM_ID) @@ -870,60 +1045,79 @@ func (m *ChangeOperatorControlAck) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ACK) } +const () + +// // MESSAGE AUTH_KEY - +// // MAVLINK_MSG_ID_AUTH_KEY 7 +// // MAVLINK_MSG_ID_AUTH_KEY_LEN 32 +// // MAVLINK_MSG_ID_AUTH_KEY_CRC 119 - +// +// type AuthKey struct { - KEY [32]uint8 ///< key + KEY [32]uint8 // key } -func NewAuthKey(KEY [32]uint8) MAVLinkMessage { +// NewAuthKey returns a new AuthKey +func NewAuthKey(KEY [32]uint8) *AuthKey { m := AuthKey{} m.KEY = KEY return &m } +// Id returns the AuthKey Message ID func (*AuthKey) Id() uint8 { return 7 } +// Len returns the AuthKey Message Length func (*AuthKey) Len() uint8 { return 32 } +// Crc returns the AuthKey Message CRC func (*AuthKey) Crc() uint8 { return 119 } +// Pack returns a packed byte array which represents a AuthKey payload func (m *AuthKey) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.KEY) return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the AuthKey func (m *AuthKey) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.KEY) } -const MAVLINK_MSG_AUTH_KEY_FIELD_key_LEN = 32 +const ( + MAVLINK_MSG_AUTH_KEY_FIELD_key_LEN = 32 +) +// // MESSAGE SET_MODE - +// // MAVLINK_MSG_ID_SET_MODE 11 +// // MAVLINK_MSG_ID_SET_MODE_LEN 6 +// // MAVLINK_MSG_ID_SET_MODE_CRC 89 - +// +// type SetMode struct { - CUSTOM_MODE uint32 ///< The new autopilot-specific mode. This field can be ignored by an autopilot. - TARGET_SYSTEM uint8 ///< The system setting the mode - BASE_MODE uint8 ///< The new base mode + CUSTOM_MODE uint32 // The new autopilot-specific mode. This field can be ignored by an autopilot. + TARGET_SYSTEM uint8 // The system setting the mode + BASE_MODE uint8 // The new base mode } -func NewSetMode(CUSTOM_MODE uint32, TARGET_SYSTEM uint8, BASE_MODE uint8) MAVLinkMessage { +// NewSetMode returns a new SetMode +func NewSetMode(CUSTOM_MODE uint32, TARGET_SYSTEM uint8, BASE_MODE uint8) *SetMode { m := SetMode{} m.CUSTOM_MODE = CUSTOM_MODE m.TARGET_SYSTEM = TARGET_SYSTEM @@ -931,18 +1125,22 @@ func NewSetMode(CUSTOM_MODE uint32, TARGET_SYSTEM uint8, BASE_MODE uint8) MAVLin return &m } +// Id returns the SetMode Message ID func (*SetMode) Id() uint8 { return 11 } +// Len returns the SetMode Message Length func (*SetMode) Len() uint8 { return 6 } +// Crc returns the SetMode Message CRC func (*SetMode) Crc() uint8 { return 89 } +// Pack returns a packed byte array which represents a SetMode payload func (m *SetMode) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.CUSTOM_MODE) @@ -951,6 +1149,7 @@ func (m *SetMode) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetMode func (m *SetMode) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.CUSTOM_MODE) @@ -958,20 +1157,27 @@ func (m *SetMode) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.BASE_MODE) } +const () + +// // MESSAGE PARAM_REQUEST_READ - +// // MAVLINK_MSG_ID_PARAM_REQUEST_READ 20 +// // MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20 +// // MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC 214 - +// +// type ParamRequestRead struct { - PARAM_INDEX int16 ///< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - PARAM_ID [16]uint8 ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + PARAM_INDEX int16 // Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + PARAM_ID [16]uint8 // Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string } -func NewParamRequestRead(PARAM_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, PARAM_ID [16]uint8) MAVLinkMessage { +// NewParamRequestRead returns a new ParamRequestRead +func NewParamRequestRead(PARAM_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, PARAM_ID [16]uint8) *ParamRequestRead { m := ParamRequestRead{} m.PARAM_INDEX = PARAM_INDEX m.TARGET_SYSTEM = TARGET_SYSTEM @@ -980,18 +1186,22 @@ func NewParamRequestRead(PARAM_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONEN return &m } +// Id returns the ParamRequestRead Message ID func (*ParamRequestRead) Id() uint8 { return 20 } +// Len returns the ParamRequestRead Message Length func (*ParamRequestRead) Len() uint8 { return 20 } +// Crc returns the ParamRequestRead Message CRC func (*ParamRequestRead) Crc() uint8 { return 214 } +// Pack returns a packed byte array which represents a ParamRequestRead payload func (m *ParamRequestRead) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.PARAM_INDEX) @@ -1001,6 +1211,7 @@ func (m *ParamRequestRead) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ParamRequestRead func (m *ParamRequestRead) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.PARAM_INDEX) @@ -1009,38 +1220,49 @@ func (m *ParamRequestRead) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.PARAM_ID) } -const MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_param_id_LEN = 16 +const ( + MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_param_id_LEN = 16 +) +// // MESSAGE PARAM_REQUEST_LIST - +// // MAVLINK_MSG_ID_PARAM_REQUEST_LIST 21 +// // MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2 +// // MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC 159 - +// +// type ParamRequestList struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewParamRequestList(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewParamRequestList returns a new ParamRequestList +func NewParamRequestList(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *ParamRequestList { m := ParamRequestList{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT return &m } +// Id returns the ParamRequestList Message ID func (*ParamRequestList) Id() uint8 { return 21 } +// Len returns the ParamRequestList Message Length func (*ParamRequestList) Len() uint8 { return 2 } +// Crc returns the ParamRequestList Message CRC func (*ParamRequestList) Crc() uint8 { return 159 } +// Pack returns a packed byte array which represents a ParamRequestList payload func (m *ParamRequestList) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -1048,27 +1270,35 @@ func (m *ParamRequestList) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ParamRequestList func (m *ParamRequestList) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE PARAM_VALUE - +// // MAVLINK_MSG_ID_PARAM_VALUE 22 +// // MAVLINK_MSG_ID_PARAM_VALUE_LEN 25 +// // MAVLINK_MSG_ID_PARAM_VALUE_CRC 220 - +// +// type ParamValue struct { - PARAM_VALUE float32 ///< Onboard parameter value - PARAM_COUNT uint16 ///< Total number of onboard parameters - PARAM_INDEX uint16 ///< Index of this onboard parameter - PARAM_ID [16]uint8 ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - PARAM_TYPE uint8 ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + PARAM_VALUE float32 // Onboard parameter value + PARAM_COUNT uint16 // Total number of onboard parameters + PARAM_INDEX uint16 // Index of this onboard parameter + PARAM_ID [16]uint8 // Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + PARAM_TYPE uint8 // Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. } -func NewParamValue(PARAM_VALUE float32, PARAM_COUNT uint16, PARAM_INDEX uint16, PARAM_ID [16]uint8, PARAM_TYPE uint8) MAVLinkMessage { +// NewParamValue returns a new ParamValue +func NewParamValue(PARAM_VALUE float32, PARAM_COUNT uint16, PARAM_INDEX uint16, PARAM_ID [16]uint8, PARAM_TYPE uint8) *ParamValue { m := ParamValue{} m.PARAM_VALUE = PARAM_VALUE m.PARAM_COUNT = PARAM_COUNT @@ -1078,18 +1308,22 @@ func NewParamValue(PARAM_VALUE float32, PARAM_COUNT uint16, PARAM_INDEX uint16, return &m } +// Id returns the ParamValue Message ID func (*ParamValue) Id() uint8 { return 22 } +// Len returns the ParamValue Message Length func (*ParamValue) Len() uint8 { return 25 } +// Crc returns the ParamValue Message CRC func (*ParamValue) Crc() uint8 { return 220 } +// Pack returns a packed byte array which represents a ParamValue payload func (m *ParamValue) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.PARAM_VALUE) @@ -1100,6 +1334,7 @@ func (m *ParamValue) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ParamValue func (m *ParamValue) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.PARAM_VALUE) @@ -1109,23 +1344,30 @@ func (m *ParamValue) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.PARAM_TYPE) } -const MAVLINK_MSG_PARAM_VALUE_FIELD_param_id_LEN = 16 +const ( + MAVLINK_MSG_PARAM_VALUE_FIELD_param_id_LEN = 16 +) +// // MESSAGE PARAM_SET - +// // MAVLINK_MSG_ID_PARAM_SET 23 +// // MAVLINK_MSG_ID_PARAM_SET_LEN 23 +// // MAVLINK_MSG_ID_PARAM_SET_CRC 168 - +// +// type ParamSet struct { - PARAM_VALUE float32 ///< Onboard parameter value - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - PARAM_ID [16]uint8 ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - PARAM_TYPE uint8 ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + PARAM_VALUE float32 // Onboard parameter value + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + PARAM_ID [16]uint8 // Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + PARAM_TYPE uint8 // Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. } -func NewParamSet(PARAM_VALUE float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, PARAM_ID [16]uint8, PARAM_TYPE uint8) MAVLinkMessage { +// NewParamSet returns a new ParamSet +func NewParamSet(PARAM_VALUE float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, PARAM_ID [16]uint8, PARAM_TYPE uint8) *ParamSet { m := ParamSet{} m.PARAM_VALUE = PARAM_VALUE m.TARGET_SYSTEM = TARGET_SYSTEM @@ -1135,18 +1377,22 @@ func NewParamSet(PARAM_VALUE float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint return &m } +// Id returns the ParamSet Message ID func (*ParamSet) Id() uint8 { return 23 } +// Len returns the ParamSet Message Length func (*ParamSet) Len() uint8 { return 23 } +// Crc returns the ParamSet Message CRC func (*ParamSet) Crc() uint8 { return 168 } +// Pack returns a packed byte array which represents a ParamSet payload func (m *ParamSet) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.PARAM_VALUE) @@ -1157,6 +1403,7 @@ func (m *ParamSet) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ParamSet func (m *ParamSet) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.PARAM_VALUE) @@ -1166,28 +1413,35 @@ func (m *ParamSet) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.PARAM_TYPE) } -const MAVLINK_MSG_PARAM_SET_FIELD_param_id_LEN = 16 +const ( + MAVLINK_MSG_PARAM_SET_FIELD_param_id_LEN = 16 +) +// // MESSAGE GPS_RAW_INT - +// // MAVLINK_MSG_ID_GPS_RAW_INT 24 +// // MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30 +// // MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24 - +// +// type GpsRawInt struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - LAT int32 ///< Latitude (WGS84), in degrees * 1E7 - LON int32 ///< Longitude (WGS84), in degrees * 1E7 - ALT int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) - EPH uint16 ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - EPV uint16 ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - VEL uint16 ///< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - COG uint16 ///< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - FIX_TYPE uint8 ///< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - SATELLITES_VISIBLE uint8 ///< Number of satellites visible. If unknown, set to 255 + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + LAT int32 // Latitude (WGS84), in degrees * 1E7 + LON int32 // Longitude (WGS84), in degrees * 1E7 + ALT int32 // Altitude (WGS84), in meters * 1000 (positive for up) + EPH uint16 // GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + EPV uint16 // GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + VEL uint16 // GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + COG uint16 // Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + FIX_TYPE uint8 // 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + SATELLITES_VISIBLE uint8 // Number of satellites visible. If unknown, set to 255 } -func NewGpsRawInt(TIME_USEC uint64, LAT int32, LON int32, ALT int32, EPH uint16, EPV uint16, VEL uint16, COG uint16, FIX_TYPE uint8, SATELLITES_VISIBLE uint8) MAVLinkMessage { +// NewGpsRawInt returns a new GpsRawInt +func NewGpsRawInt(TIME_USEC uint64, LAT int32, LON int32, ALT int32, EPH uint16, EPV uint16, VEL uint16, COG uint16, FIX_TYPE uint8, SATELLITES_VISIBLE uint8) *GpsRawInt { m := GpsRawInt{} m.TIME_USEC = TIME_USEC m.LAT = LAT @@ -1202,18 +1456,22 @@ func NewGpsRawInt(TIME_USEC uint64, LAT int32, LON int32, ALT int32, EPH uint16, return &m } +// Id returns the GpsRawInt Message ID func (*GpsRawInt) Id() uint8 { return 24 } +// Len returns the GpsRawInt Message Length func (*GpsRawInt) Len() uint8 { return 30 } +// Crc returns the GpsRawInt Message CRC func (*GpsRawInt) Crc() uint8 { return 24 } +// Pack returns a packed byte array which represents a GpsRawInt payload func (m *GpsRawInt) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -1229,6 +1487,7 @@ func (m *GpsRawInt) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GpsRawInt func (m *GpsRawInt) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -1243,22 +1502,29 @@ func (m *GpsRawInt) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.SATELLITES_VISIBLE) } +const () + +// // MESSAGE GPS_STATUS - +// // MAVLINK_MSG_ID_GPS_STATUS 25 +// // MAVLINK_MSG_ID_GPS_STATUS_LEN 101 +// // MAVLINK_MSG_ID_GPS_STATUS_CRC 23 - +// +// type GpsStatus struct { - SATELLITES_VISIBLE uint8 ///< Number of satellites visible - SATELLITE_PRN [20]uint8 ///< Global satellite ID - SATELLITE_USED [20]uint8 ///< 0: Satellite not used, 1: used for localization - SATELLITE_ELEVATION [20]uint8 ///< Elevation (0: right on top of receiver, 90: on the horizon) of satellite - SATELLITE_AZIMUTH [20]uint8 ///< Direction of satellite, 0: 0 deg, 255: 360 deg. - SATELLITE_SNR [20]uint8 ///< Signal to noise ratio of satellite + SATELLITES_VISIBLE uint8 // Number of satellites visible + SATELLITE_PRN [20]uint8 // Global satellite ID + SATELLITE_USED [20]uint8 // 0: Satellite not used, 1: used for localization + SATELLITE_ELEVATION [20]uint8 // Elevation (0: right on top of receiver, 90: on the horizon) of satellite + SATELLITE_AZIMUTH [20]uint8 // Direction of satellite, 0: 0 deg, 255: 360 deg. + SATELLITE_SNR [20]uint8 // Signal to noise ratio of satellite } -func NewGpsStatus(SATELLITES_VISIBLE uint8, SATELLITE_PRN [20]uint8, SATELLITE_USED [20]uint8, SATELLITE_ELEVATION [20]uint8, SATELLITE_AZIMUTH [20]uint8, SATELLITE_SNR [20]uint8) MAVLinkMessage { +// NewGpsStatus returns a new GpsStatus +func NewGpsStatus(SATELLITES_VISIBLE uint8, SATELLITE_PRN [20]uint8, SATELLITE_USED [20]uint8, SATELLITE_ELEVATION [20]uint8, SATELLITE_AZIMUTH [20]uint8, SATELLITE_SNR [20]uint8) *GpsStatus { m := GpsStatus{} m.SATELLITES_VISIBLE = SATELLITES_VISIBLE m.SATELLITE_PRN = SATELLITE_PRN @@ -1269,18 +1535,22 @@ func NewGpsStatus(SATELLITES_VISIBLE uint8, SATELLITE_PRN [20]uint8, SATELLITE_U return &m } +// Id returns the GpsStatus Message ID func (*GpsStatus) Id() uint8 { return 25 } +// Len returns the GpsStatus Message Length func (*GpsStatus) Len() uint8 { return 101 } +// Crc returns the GpsStatus Message CRC func (*GpsStatus) Crc() uint8 { return 23 } +// Pack returns a packed byte array which represents a GpsStatus payload func (m *GpsStatus) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SATELLITES_VISIBLE) @@ -1292,6 +1562,7 @@ func (m *GpsStatus) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GpsStatus func (m *GpsStatus) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SATELLITES_VISIBLE) @@ -1302,32 +1573,39 @@ func (m *GpsStatus) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.SATELLITE_SNR) } -const MAVLINK_MSG_GPS_STATUS_FIELD_satellite_prn_LEN = 20 -const MAVLINK_MSG_GPS_STATUS_FIELD_satellite_used_LEN = 20 -const MAVLINK_MSG_GPS_STATUS_FIELD_satellite_elevation_LEN = 20 -const MAVLINK_MSG_GPS_STATUS_FIELD_satellite_azimuth_LEN = 20 -const MAVLINK_MSG_GPS_STATUS_FIELD_satellite_snr_LEN = 20 +const ( + MAVLINK_MSG_GPS_STATUS_FIELD_satellite_prn_LEN = 20 + MAVLINK_MSG_GPS_STATUS_FIELD_satellite_used_LEN = 20 + MAVLINK_MSG_GPS_STATUS_FIELD_satellite_elevation_LEN = 20 + MAVLINK_MSG_GPS_STATUS_FIELD_satellite_azimuth_LEN = 20 + MAVLINK_MSG_GPS_STATUS_FIELD_satellite_snr_LEN = 20 +) +// // MESSAGE SCALED_IMU - +// // MAVLINK_MSG_ID_SCALED_IMU 26 +// // MAVLINK_MSG_ID_SCALED_IMU_LEN 22 +// // MAVLINK_MSG_ID_SCALED_IMU_CRC 170 - +// +// type ScaledImu struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - XACC int16 ///< X acceleration (mg) - YACC int16 ///< Y acceleration (mg) - ZACC int16 ///< Z acceleration (mg) - XGYRO int16 ///< Angular speed around X axis (millirad /sec) - YGYRO int16 ///< Angular speed around Y axis (millirad /sec) - ZGYRO int16 ///< Angular speed around Z axis (millirad /sec) - XMAG int16 ///< X Magnetic field (milli tesla) - YMAG int16 ///< Y Magnetic field (milli tesla) - ZMAG int16 ///< Z Magnetic field (milli tesla) + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + XACC int16 // X acceleration (mg) + YACC int16 // Y acceleration (mg) + ZACC int16 // Z acceleration (mg) + XGYRO int16 // Angular speed around X axis (millirad /sec) + YGYRO int16 // Angular speed around Y axis (millirad /sec) + ZGYRO int16 // Angular speed around Z axis (millirad /sec) + XMAG int16 // X Magnetic field (milli tesla) + YMAG int16 // Y Magnetic field (milli tesla) + ZMAG int16 // Z Magnetic field (milli tesla) } -func NewScaledImu(TIME_BOOT_MS uint32, XACC int16, YACC int16, ZACC int16, XGYRO int16, YGYRO int16, ZGYRO int16, XMAG int16, YMAG int16, ZMAG int16) MAVLinkMessage { +// NewScaledImu returns a new ScaledImu +func NewScaledImu(TIME_BOOT_MS uint32, XACC int16, YACC int16, ZACC int16, XGYRO int16, YGYRO int16, ZGYRO int16, XMAG int16, YMAG int16, ZMAG int16) *ScaledImu { m := ScaledImu{} m.TIME_BOOT_MS = TIME_BOOT_MS m.XACC = XACC @@ -1342,18 +1620,22 @@ func NewScaledImu(TIME_BOOT_MS uint32, XACC int16, YACC int16, ZACC int16, XGYRO return &m } +// Id returns the ScaledImu Message ID func (*ScaledImu) Id() uint8 { return 26 } +// Len returns the ScaledImu Message Length func (*ScaledImu) Len() uint8 { return 22 } +// Crc returns the ScaledImu Message CRC func (*ScaledImu) Crc() uint8 { return 170 } +// Pack returns a packed byte array which represents a ScaledImu payload func (m *ScaledImu) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1369,6 +1651,7 @@ func (m *ScaledImu) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ScaledImu func (m *ScaledImu) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1383,26 +1666,33 @@ func (m *ScaledImu) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ZMAG) } +const () + +// // MESSAGE RAW_IMU - +// // MAVLINK_MSG_ID_RAW_IMU 27 +// // MAVLINK_MSG_ID_RAW_IMU_LEN 26 +// // MAVLINK_MSG_ID_RAW_IMU_CRC 144 - +// +// type RawImu struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - XACC int16 ///< X acceleration (raw) - YACC int16 ///< Y acceleration (raw) - ZACC int16 ///< Z acceleration (raw) - XGYRO int16 ///< Angular speed around X axis (raw) - YGYRO int16 ///< Angular speed around Y axis (raw) - ZGYRO int16 ///< Angular speed around Z axis (raw) - XMAG int16 ///< X Magnetic field (raw) - YMAG int16 ///< Y Magnetic field (raw) - ZMAG int16 ///< Z Magnetic field (raw) + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + XACC int16 // X acceleration (raw) + YACC int16 // Y acceleration (raw) + ZACC int16 // Z acceleration (raw) + XGYRO int16 // Angular speed around X axis (raw) + YGYRO int16 // Angular speed around Y axis (raw) + ZGYRO int16 // Angular speed around Z axis (raw) + XMAG int16 // X Magnetic field (raw) + YMAG int16 // Y Magnetic field (raw) + ZMAG int16 // Z Magnetic field (raw) } -func NewRawImu(TIME_USEC uint64, XACC int16, YACC int16, ZACC int16, XGYRO int16, YGYRO int16, ZGYRO int16, XMAG int16, YMAG int16, ZMAG int16) MAVLinkMessage { +// NewRawImu returns a new RawImu +func NewRawImu(TIME_USEC uint64, XACC int16, YACC int16, ZACC int16, XGYRO int16, YGYRO int16, ZGYRO int16, XMAG int16, YMAG int16, ZMAG int16) *RawImu { m := RawImu{} m.TIME_USEC = TIME_USEC m.XACC = XACC @@ -1417,18 +1707,22 @@ func NewRawImu(TIME_USEC uint64, XACC int16, YACC int16, ZACC int16, XGYRO int16 return &m } +// Id returns the RawImu Message ID func (*RawImu) Id() uint8 { return 27 } +// Len returns the RawImu Message Length func (*RawImu) Len() uint8 { return 26 } +// Crc returns the RawImu Message CRC func (*RawImu) Crc() uint8 { return 144 } +// Pack returns a packed byte array which represents a RawImu payload func (m *RawImu) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -1444,6 +1738,7 @@ func (m *RawImu) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RawImu func (m *RawImu) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -1458,21 +1753,28 @@ func (m *RawImu) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ZMAG) } +const () + +// // MESSAGE RAW_PRESSURE - +// // MAVLINK_MSG_ID_RAW_PRESSURE 28 +// // MAVLINK_MSG_ID_RAW_PRESSURE_LEN 16 +// // MAVLINK_MSG_ID_RAW_PRESSURE_CRC 67 - +// +// type RawPressure struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - PRESS_ABS int16 ///< Absolute pressure (raw) - PRESS_DIFF1 int16 ///< Differential pressure 1 (raw) - PRESS_DIFF2 int16 ///< Differential pressure 2 (raw) - TEMPERATURE int16 ///< Raw Temperature measurement (raw) + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + PRESS_ABS int16 // Absolute pressure (raw) + PRESS_DIFF1 int16 // Differential pressure 1 (raw) + PRESS_DIFF2 int16 // Differential pressure 2 (raw) + TEMPERATURE int16 // Raw Temperature measurement (raw) } -func NewRawPressure(TIME_USEC uint64, PRESS_ABS int16, PRESS_DIFF1 int16, PRESS_DIFF2 int16, TEMPERATURE int16) MAVLinkMessage { +// NewRawPressure returns a new RawPressure +func NewRawPressure(TIME_USEC uint64, PRESS_ABS int16, PRESS_DIFF1 int16, PRESS_DIFF2 int16, TEMPERATURE int16) *RawPressure { m := RawPressure{} m.TIME_USEC = TIME_USEC m.PRESS_ABS = PRESS_ABS @@ -1482,18 +1784,22 @@ func NewRawPressure(TIME_USEC uint64, PRESS_ABS int16, PRESS_DIFF1 int16, PRESS_ return &m } +// Id returns the RawPressure Message ID func (*RawPressure) Id() uint8 { return 28 } +// Len returns the RawPressure Message Length func (*RawPressure) Len() uint8 { return 16 } +// Crc returns the RawPressure Message CRC func (*RawPressure) Crc() uint8 { return 67 } +// Pack returns a packed byte array which represents a RawPressure payload func (m *RawPressure) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -1504,6 +1810,7 @@ func (m *RawPressure) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RawPressure func (m *RawPressure) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -1513,20 +1820,27 @@ func (m *RawPressure) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TEMPERATURE) } +const () + +// // MESSAGE SCALED_PRESSURE - +// // MAVLINK_MSG_ID_SCALED_PRESSURE 29 +// // MAVLINK_MSG_ID_SCALED_PRESSURE_LEN 14 +// // MAVLINK_MSG_ID_SCALED_PRESSURE_CRC 115 - +// +// type ScaledPressure struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - PRESS_ABS float32 ///< Absolute pressure (hectopascal) - PRESS_DIFF float32 ///< Differential pressure 1 (hectopascal) - TEMPERATURE int16 ///< Temperature measurement (0.01 degrees celsius) + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + PRESS_ABS float32 // Absolute pressure (hectopascal) + PRESS_DIFF float32 // Differential pressure 1 (hectopascal) + TEMPERATURE int16 // Temperature measurement (0.01 degrees celsius) } -func NewScaledPressure(TIME_BOOT_MS uint32, PRESS_ABS float32, PRESS_DIFF float32, TEMPERATURE int16) MAVLinkMessage { +// NewScaledPressure returns a new ScaledPressure +func NewScaledPressure(TIME_BOOT_MS uint32, PRESS_ABS float32, PRESS_DIFF float32, TEMPERATURE int16) *ScaledPressure { m := ScaledPressure{} m.TIME_BOOT_MS = TIME_BOOT_MS m.PRESS_ABS = PRESS_ABS @@ -1535,18 +1849,22 @@ func NewScaledPressure(TIME_BOOT_MS uint32, PRESS_ABS float32, PRESS_DIFF float3 return &m } +// Id returns the ScaledPressure Message ID func (*ScaledPressure) Id() uint8 { return 29 } +// Len returns the ScaledPressure Message Length func (*ScaledPressure) Len() uint8 { return 14 } +// Crc returns the ScaledPressure Message CRC func (*ScaledPressure) Crc() uint8 { return 115 } +// Pack returns a packed byte array which represents a ScaledPressure payload func (m *ScaledPressure) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1556,6 +1874,7 @@ func (m *ScaledPressure) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ScaledPressure func (m *ScaledPressure) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1564,23 +1883,30 @@ func (m *ScaledPressure) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TEMPERATURE) } +const () + +// // MESSAGE ATTITUDE - +// // MAVLINK_MSG_ID_ATTITUDE 30 +// // MAVLINK_MSG_ID_ATTITUDE_LEN 28 +// // MAVLINK_MSG_ID_ATTITUDE_CRC 39 - +// +// type Attitude struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - ROLL float32 ///< Roll angle (rad, -pi..+pi) - PITCH float32 ///< Pitch angle (rad, -pi..+pi) - YAW float32 ///< Yaw angle (rad, -pi..+pi) - ROLLSPEED float32 ///< Roll angular speed (rad/s) - PITCHSPEED float32 ///< Pitch angular speed (rad/s) - YAWSPEED float32 ///< Yaw angular speed (rad/s) + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + ROLL float32 // Roll angle (rad, -pi..+pi) + PITCH float32 // Pitch angle (rad, -pi..+pi) + YAW float32 // Yaw angle (rad, -pi..+pi) + ROLLSPEED float32 // Roll angular speed (rad/s) + PITCHSPEED float32 // Pitch angular speed (rad/s) + YAWSPEED float32 // Yaw angular speed (rad/s) } -func NewAttitude(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32) MAVLinkMessage { +// NewAttitude returns a new Attitude +func NewAttitude(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32) *Attitude { m := Attitude{} m.TIME_BOOT_MS = TIME_BOOT_MS m.ROLL = ROLL @@ -1592,18 +1918,22 @@ func NewAttitude(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, return &m } +// Id returns the Attitude Message ID func (*Attitude) Id() uint8 { return 30 } +// Len returns the Attitude Message Length func (*Attitude) Len() uint8 { return 28 } +// Crc returns the Attitude Message CRC func (*Attitude) Crc() uint8 { return 39 } +// Pack returns a packed byte array which represents a Attitude payload func (m *Attitude) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1616,6 +1946,7 @@ func (m *Attitude) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Attitude func (m *Attitude) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1627,24 +1958,31 @@ func (m *Attitude) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.YAWSPEED) } +const () + +// // MESSAGE ATTITUDE_QUATERNION - +// // MAVLINK_MSG_ID_ATTITUDE_QUATERNION 31 +// // MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32 +// // MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC 246 - +// +// type AttitudeQuaternion struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - Q1 float32 ///< Quaternion component 1, w (1 in null-rotation) - Q2 float32 ///< Quaternion component 2, x (0 in null-rotation) - Q3 float32 ///< Quaternion component 3, y (0 in null-rotation) - Q4 float32 ///< Quaternion component 4, z (0 in null-rotation) - ROLLSPEED float32 ///< Roll angular speed (rad/s) - PITCHSPEED float32 ///< Pitch angular speed (rad/s) - YAWSPEED float32 ///< Yaw angular speed (rad/s) + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + Q1 float32 // Quaternion component 1, w (1 in null-rotation) + Q2 float32 // Quaternion component 2, x (0 in null-rotation) + Q3 float32 // Quaternion component 3, y (0 in null-rotation) + Q4 float32 // Quaternion component 4, z (0 in null-rotation) + ROLLSPEED float32 // Roll angular speed (rad/s) + PITCHSPEED float32 // Pitch angular speed (rad/s) + YAWSPEED float32 // Yaw angular speed (rad/s) } -func NewAttitudeQuaternion(TIME_BOOT_MS uint32, Q1 float32, Q2 float32, Q3 float32, Q4 float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32) MAVLinkMessage { +// NewAttitudeQuaternion returns a new AttitudeQuaternion +func NewAttitudeQuaternion(TIME_BOOT_MS uint32, Q1 float32, Q2 float32, Q3 float32, Q4 float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32) *AttitudeQuaternion { m := AttitudeQuaternion{} m.TIME_BOOT_MS = TIME_BOOT_MS m.Q1 = Q1 @@ -1657,18 +1995,22 @@ func NewAttitudeQuaternion(TIME_BOOT_MS uint32, Q1 float32, Q2 float32, Q3 float return &m } +// Id returns the AttitudeQuaternion Message ID func (*AttitudeQuaternion) Id() uint8 { return 31 } +// Len returns the AttitudeQuaternion Message Length func (*AttitudeQuaternion) Len() uint8 { return 32 } +// Crc returns the AttitudeQuaternion Message CRC func (*AttitudeQuaternion) Crc() uint8 { return 246 } +// Pack returns a packed byte array which represents a AttitudeQuaternion payload func (m *AttitudeQuaternion) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1682,6 +2024,7 @@ func (m *AttitudeQuaternion) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the AttitudeQuaternion func (m *AttitudeQuaternion) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1694,23 +2037,30 @@ func (m *AttitudeQuaternion) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.YAWSPEED) } +const () + +// // MESSAGE LOCAL_POSITION_NED - +// // MAVLINK_MSG_ID_LOCAL_POSITION_NED 32 +// // MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28 +// // MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC 185 - +// +// type LocalPositionNed struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - X float32 ///< X Position - Y float32 ///< Y Position - Z float32 ///< Z Position - VX float32 ///< X Speed - VY float32 ///< Y Speed - VZ float32 ///< Z Speed + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + X float32 // X Position + Y float32 // Y Position + Z float32 // Z Position + VX float32 // X Speed + VY float32 // Y Speed + VZ float32 // Z Speed } -func NewLocalPositionNed(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, VX float32, VY float32, VZ float32) MAVLinkMessage { +// NewLocalPositionNed returns a new LocalPositionNed +func NewLocalPositionNed(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, VX float32, VY float32, VZ float32) *LocalPositionNed { m := LocalPositionNed{} m.TIME_BOOT_MS = TIME_BOOT_MS m.X = X @@ -1722,18 +2072,22 @@ func NewLocalPositionNed(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, V return &m } +// Id returns the LocalPositionNed Message ID func (*LocalPositionNed) Id() uint8 { return 32 } +// Len returns the LocalPositionNed Message Length func (*LocalPositionNed) Len() uint8 { return 28 } +// Crc returns the LocalPositionNed Message CRC func (*LocalPositionNed) Crc() uint8 { return 185 } +// Pack returns a packed byte array which represents a LocalPositionNed payload func (m *LocalPositionNed) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1746,6 +2100,7 @@ func (m *LocalPositionNed) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LocalPositionNed func (m *LocalPositionNed) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1757,25 +2112,32 @@ func (m *LocalPositionNed) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.VZ) } +const () + +// // MESSAGE GLOBAL_POSITION_INT - +// // MAVLINK_MSG_ID_GLOBAL_POSITION_INT 33 +// // MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28 +// // MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC 104 - +// +// type GlobalPositionInt struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - LAT int32 ///< Latitude, expressed as * 1E7 - LON int32 ///< Longitude, expressed as * 1E7 - ALT int32 ///< Altitude in meters, expressed as * 1000 (millimeters), above MSL - RELATIVE_ALT int32 ///< Altitude above ground in meters, expressed as * 1000 (millimeters) - VX int16 ///< Ground X Speed (Latitude), expressed as m/s * 100 - VY int16 ///< Ground Y Speed (Longitude), expressed as m/s * 100 - VZ int16 ///< Ground Z Speed (Altitude), expressed as m/s * 100 - HDG uint16 ///< Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + LAT int32 // Latitude, expressed as * 1E7 + LON int32 // Longitude, expressed as * 1E7 + ALT int32 // Altitude in meters, expressed as * 1000 (millimeters), above MSL + RELATIVE_ALT int32 // Altitude above ground in meters, expressed as * 1000 (millimeters) + VX int16 // Ground X Speed (Latitude), expressed as m/s * 100 + VY int16 // Ground Y Speed (Longitude), expressed as m/s * 100 + VZ int16 // Ground Z Speed (Altitude), expressed as m/s * 100 + HDG uint16 // Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX } -func NewGlobalPositionInt(TIME_BOOT_MS uint32, LAT int32, LON int32, ALT int32, RELATIVE_ALT int32, VX int16, VY int16, VZ int16, HDG uint16) MAVLinkMessage { +// NewGlobalPositionInt returns a new GlobalPositionInt +func NewGlobalPositionInt(TIME_BOOT_MS uint32, LAT int32, LON int32, ALT int32, RELATIVE_ALT int32, VX int16, VY int16, VZ int16, HDG uint16) *GlobalPositionInt { m := GlobalPositionInt{} m.TIME_BOOT_MS = TIME_BOOT_MS m.LAT = LAT @@ -1789,18 +2151,22 @@ func NewGlobalPositionInt(TIME_BOOT_MS uint32, LAT int32, LON int32, ALT int32, return &m } +// Id returns the GlobalPositionInt Message ID func (*GlobalPositionInt) Id() uint8 { return 33 } +// Len returns the GlobalPositionInt Message Length func (*GlobalPositionInt) Len() uint8 { return 28 } +// Crc returns the GlobalPositionInt Message CRC func (*GlobalPositionInt) Crc() uint8 { return 104 } +// Pack returns a packed byte array which represents a GlobalPositionInt payload func (m *GlobalPositionInt) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1815,6 +2181,7 @@ func (m *GlobalPositionInt) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GlobalPositionInt func (m *GlobalPositionInt) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1828,27 +2195,34 @@ func (m *GlobalPositionInt) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.HDG) } +const () + +// // MESSAGE RC_CHANNELS_SCALED - +// // MAVLINK_MSG_ID_RC_CHANNELS_SCALED 34 +// // MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22 +// // MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC 237 - +// +// type RcChannelsScaled struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - CHAN1_SCALED int16 ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN2_SCALED int16 ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN3_SCALED int16 ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN4_SCALED int16 ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN5_SCALED int16 ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN6_SCALED int16 ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN7_SCALED int16 ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - CHAN8_SCALED int16 ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - PORT uint8 ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - RSSI uint8 ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + CHAN1_SCALED int16 // RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN2_SCALED int16 // RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN3_SCALED int16 // RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN4_SCALED int16 // RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN5_SCALED int16 // RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN6_SCALED int16 // RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN7_SCALED int16 // RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + CHAN8_SCALED int16 // RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + PORT uint8 // Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + RSSI uint8 // Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. } -func NewRcChannelsScaled(TIME_BOOT_MS uint32, CHAN1_SCALED int16, CHAN2_SCALED int16, CHAN3_SCALED int16, CHAN4_SCALED int16, CHAN5_SCALED int16, CHAN6_SCALED int16, CHAN7_SCALED int16, CHAN8_SCALED int16, PORT uint8, RSSI uint8) MAVLinkMessage { +// NewRcChannelsScaled returns a new RcChannelsScaled +func NewRcChannelsScaled(TIME_BOOT_MS uint32, CHAN1_SCALED int16, CHAN2_SCALED int16, CHAN3_SCALED int16, CHAN4_SCALED int16, CHAN5_SCALED int16, CHAN6_SCALED int16, CHAN7_SCALED int16, CHAN8_SCALED int16, PORT uint8, RSSI uint8) *RcChannelsScaled { m := RcChannelsScaled{} m.TIME_BOOT_MS = TIME_BOOT_MS m.CHAN1_SCALED = CHAN1_SCALED @@ -1864,18 +2238,22 @@ func NewRcChannelsScaled(TIME_BOOT_MS uint32, CHAN1_SCALED int16, CHAN2_SCALED i return &m } +// Id returns the RcChannelsScaled Message ID func (*RcChannelsScaled) Id() uint8 { return 34 } +// Len returns the RcChannelsScaled Message Length func (*RcChannelsScaled) Len() uint8 { return 22 } +// Crc returns the RcChannelsScaled Message CRC func (*RcChannelsScaled) Crc() uint8 { return 237 } +// Pack returns a packed byte array which represents a RcChannelsScaled payload func (m *RcChannelsScaled) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1892,6 +2270,7 @@ func (m *RcChannelsScaled) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RcChannelsScaled func (m *RcChannelsScaled) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1907,27 +2286,34 @@ func (m *RcChannelsScaled) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.RSSI) } +const () + +// // MESSAGE RC_CHANNELS_RAW - +// // MAVLINK_MSG_ID_RC_CHANNELS_RAW 35 +// // MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22 +// // MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC 244 - +// +// type RcChannelsRaw struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - CHAN1_RAW uint16 ///< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN2_RAW uint16 ///< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN3_RAW uint16 ///< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN4_RAW uint16 ///< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN5_RAW uint16 ///< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN6_RAW uint16 ///< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN7_RAW uint16 ///< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN8_RAW uint16 ///< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - PORT uint8 ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - RSSI uint8 ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + CHAN1_RAW uint16 // RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN2_RAW uint16 // RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN3_RAW uint16 // RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN4_RAW uint16 // RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN5_RAW uint16 // RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN6_RAW uint16 // RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN7_RAW uint16 // RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN8_RAW uint16 // RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + PORT uint8 // Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + RSSI uint8 // Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. } -func NewRcChannelsRaw(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, PORT uint8, RSSI uint8) MAVLinkMessage { +// NewRcChannelsRaw returns a new RcChannelsRaw +func NewRcChannelsRaw(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, PORT uint8, RSSI uint8) *RcChannelsRaw { m := RcChannelsRaw{} m.TIME_BOOT_MS = TIME_BOOT_MS m.CHAN1_RAW = CHAN1_RAW @@ -1943,18 +2329,22 @@ func NewRcChannelsRaw(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, C return &m } +// Id returns the RcChannelsRaw Message ID func (*RcChannelsRaw) Id() uint8 { return 35 } +// Len returns the RcChannelsRaw Message Length func (*RcChannelsRaw) Len() uint8 { return 22 } +// Crc returns the RcChannelsRaw Message CRC func (*RcChannelsRaw) Crc() uint8 { return 244 } +// Pack returns a packed byte array which represents a RcChannelsRaw payload func (m *RcChannelsRaw) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -1971,6 +2361,7 @@ func (m *RcChannelsRaw) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RcChannelsRaw func (m *RcChannelsRaw) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -1986,26 +2377,33 @@ func (m *RcChannelsRaw) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.RSSI) } +const () + +// // MESSAGE SERVO_OUTPUT_RAW - +// // MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 36 +// // MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 21 +// // MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC 222 - +// +// type ServoOutputRaw struct { - TIME_USEC uint32 ///< Timestamp (microseconds since system boot) - SERVO1_RAW uint16 ///< Servo output 1 value, in microseconds - SERVO2_RAW uint16 ///< Servo output 2 value, in microseconds - SERVO3_RAW uint16 ///< Servo output 3 value, in microseconds - SERVO4_RAW uint16 ///< Servo output 4 value, in microseconds - SERVO5_RAW uint16 ///< Servo output 5 value, in microseconds - SERVO6_RAW uint16 ///< Servo output 6 value, in microseconds - SERVO7_RAW uint16 ///< Servo output 7 value, in microseconds - SERVO8_RAW uint16 ///< Servo output 8 value, in microseconds - PORT uint8 ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. + TIME_USEC uint32 // Timestamp (microseconds since system boot) + SERVO1_RAW uint16 // Servo output 1 value, in microseconds + SERVO2_RAW uint16 // Servo output 2 value, in microseconds + SERVO3_RAW uint16 // Servo output 3 value, in microseconds + SERVO4_RAW uint16 // Servo output 4 value, in microseconds + SERVO5_RAW uint16 // Servo output 5 value, in microseconds + SERVO6_RAW uint16 // Servo output 6 value, in microseconds + SERVO7_RAW uint16 // Servo output 7 value, in microseconds + SERVO8_RAW uint16 // Servo output 8 value, in microseconds + PORT uint8 // Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. } -func NewServoOutputRaw(TIME_USEC uint32, SERVO1_RAW uint16, SERVO2_RAW uint16, SERVO3_RAW uint16, SERVO4_RAW uint16, SERVO5_RAW uint16, SERVO6_RAW uint16, SERVO7_RAW uint16, SERVO8_RAW uint16, PORT uint8) MAVLinkMessage { +// NewServoOutputRaw returns a new ServoOutputRaw +func NewServoOutputRaw(TIME_USEC uint32, SERVO1_RAW uint16, SERVO2_RAW uint16, SERVO3_RAW uint16, SERVO4_RAW uint16, SERVO5_RAW uint16, SERVO6_RAW uint16, SERVO7_RAW uint16, SERVO8_RAW uint16, PORT uint8) *ServoOutputRaw { m := ServoOutputRaw{} m.TIME_USEC = TIME_USEC m.SERVO1_RAW = SERVO1_RAW @@ -2020,18 +2418,22 @@ func NewServoOutputRaw(TIME_USEC uint32, SERVO1_RAW uint16, SERVO2_RAW uint16, S return &m } +// Id returns the ServoOutputRaw Message ID func (*ServoOutputRaw) Id() uint8 { return 36 } +// Len returns the ServoOutputRaw Message Length func (*ServoOutputRaw) Len() uint8 { return 21 } +// Crc returns the ServoOutputRaw Message CRC func (*ServoOutputRaw) Crc() uint8 { return 222 } +// Pack returns a packed byte array which represents a ServoOutputRaw payload func (m *ServoOutputRaw) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -2047,6 +2449,7 @@ func (m *ServoOutputRaw) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ServoOutputRaw func (m *ServoOutputRaw) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -2061,20 +2464,27 @@ func (m *ServoOutputRaw) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.PORT) } +const () + +// // MESSAGE MISSION_REQUEST_PARTIAL_LIST - +// // MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37 +// // MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6 +// // MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC 212 - +// +// type MissionRequestPartialList struct { - START_INDEX int16 ///< Start index, 0 by default - END_INDEX int16 ///< End index, -1 by default (-1: send list to end). Else a valid index of the list - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + START_INDEX int16 // Start index, 0 by default + END_INDEX int16 // End index, -1 by default (-1: send list to end). Else a valid index of the list + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionRequestPartialList(START_INDEX int16, END_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionRequestPartialList returns a new MissionRequestPartialList +func NewMissionRequestPartialList(START_INDEX int16, END_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionRequestPartialList { m := MissionRequestPartialList{} m.START_INDEX = START_INDEX m.END_INDEX = END_INDEX @@ -2083,18 +2493,22 @@ func NewMissionRequestPartialList(START_INDEX int16, END_INDEX int16, TARGET_SYS return &m } +// Id returns the MissionRequestPartialList Message ID func (*MissionRequestPartialList) Id() uint8 { return 37 } +// Len returns the MissionRequestPartialList Message Length func (*MissionRequestPartialList) Len() uint8 { return 6 } +// Crc returns the MissionRequestPartialList Message CRC func (*MissionRequestPartialList) Crc() uint8 { return 212 } +// Pack returns a packed byte array which represents a MissionRequestPartialList payload func (m *MissionRequestPartialList) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.START_INDEX) @@ -2104,6 +2518,7 @@ func (m *MissionRequestPartialList) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionRequestPartialList func (m *MissionRequestPartialList) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.START_INDEX) @@ -2112,20 +2527,27 @@ func (m *MissionRequestPartialList) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_WRITE_PARTIAL_LIST - +// // MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST 38 +// // MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 6 +// // MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC 9 - +// +// type MissionWritePartialList struct { - START_INDEX int16 ///< Start index, 0 by default and smaller / equal to the largest index of the current onboard list. - END_INDEX int16 ///< End index, equal or greater than start index. - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + START_INDEX int16 // Start index, 0 by default and smaller / equal to the largest index of the current onboard list. + END_INDEX int16 // End index, equal or greater than start index. + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionWritePartialList(START_INDEX int16, END_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionWritePartialList returns a new MissionWritePartialList +func NewMissionWritePartialList(START_INDEX int16, END_INDEX int16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionWritePartialList { m := MissionWritePartialList{} m.START_INDEX = START_INDEX m.END_INDEX = END_INDEX @@ -2134,18 +2556,22 @@ func NewMissionWritePartialList(START_INDEX int16, END_INDEX int16, TARGET_SYSTE return &m } +// Id returns the MissionWritePartialList Message ID func (*MissionWritePartialList) Id() uint8 { return 38 } +// Len returns the MissionWritePartialList Message Length func (*MissionWritePartialList) Len() uint8 { return 6 } +// Crc returns the MissionWritePartialList Message CRC func (*MissionWritePartialList) Crc() uint8 { return 9 } +// Pack returns a packed byte array which represents a MissionWritePartialList payload func (m *MissionWritePartialList) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.START_INDEX) @@ -2155,6 +2581,7 @@ func (m *MissionWritePartialList) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionWritePartialList func (m *MissionWritePartialList) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.START_INDEX) @@ -2163,30 +2590,37 @@ func (m *MissionWritePartialList) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_ITEM - +// // MAVLINK_MSG_ID_MISSION_ITEM 39 +// // MAVLINK_MSG_ID_MISSION_ITEM_LEN 37 +// // MAVLINK_MSG_ID_MISSION_ITEM_CRC 254 - +// +// type MissionItem struct { - PARAM1 float32 ///< PARAM1, see MAV_CMD enum - PARAM2 float32 ///< PARAM2, see MAV_CMD enum - PARAM3 float32 ///< PARAM3, see MAV_CMD enum - PARAM4 float32 ///< PARAM4, see MAV_CMD enum - X float32 ///< PARAM5 / local: x position, global: latitude - Y float32 ///< PARAM6 / y position: global: longitude - Z float32 ///< PARAM7 / z position: global: altitude (relative or absolute, depending on frame. - SEQ uint16 ///< Sequence - COMMAND uint16 ///< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - FRAME uint8 ///< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - CURRENT uint8 ///< false:0, true:1 - AUTOCONTINUE uint8 ///< autocontinue to next wp + PARAM1 float32 // PARAM1, see MAV_CMD enum + PARAM2 float32 // PARAM2, see MAV_CMD enum + PARAM3 float32 // PARAM3, see MAV_CMD enum + PARAM4 float32 // PARAM4, see MAV_CMD enum + X float32 // PARAM5 / local: x position, global: latitude + Y float32 // PARAM6 / y position: global: longitude + Z float32 // PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + SEQ uint16 // Sequence + COMMAND uint16 // The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + FRAME uint8 // The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + CURRENT uint8 // false:0, true:1 + AUTOCONTINUE uint8 // autocontinue to next wp } -func NewMissionItem(PARAM1 float32, PARAM2 float32, PARAM3 float32, PARAM4 float32, X float32, Y float32, Z float32, SEQ uint16, COMMAND uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, FRAME uint8, CURRENT uint8, AUTOCONTINUE uint8) MAVLinkMessage { +// NewMissionItem returns a new MissionItem +func NewMissionItem(PARAM1 float32, PARAM2 float32, PARAM3 float32, PARAM4 float32, X float32, Y float32, Z float32, SEQ uint16, COMMAND uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, FRAME uint8, CURRENT uint8, AUTOCONTINUE uint8) *MissionItem { m := MissionItem{} m.PARAM1 = PARAM1 m.PARAM2 = PARAM2 @@ -2205,18 +2639,22 @@ func NewMissionItem(PARAM1 float32, PARAM2 float32, PARAM3 float32, PARAM4 float return &m } +// Id returns the MissionItem Message ID func (*MissionItem) Id() uint8 { return 39 } +// Len returns the MissionItem Message Length func (*MissionItem) Len() uint8 { return 37 } +// Crc returns the MissionItem Message CRC func (*MissionItem) Crc() uint8 { return 254 } +// Pack returns a packed byte array which represents a MissionItem payload func (m *MissionItem) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.PARAM1) @@ -2236,6 +2674,7 @@ func (m *MissionItem) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionItem func (m *MissionItem) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.PARAM1) @@ -2254,19 +2693,26 @@ func (m *MissionItem) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.AUTOCONTINUE) } +const () + +// // MESSAGE MISSION_REQUEST - +// // MAVLINK_MSG_ID_MISSION_REQUEST 40 +// // MAVLINK_MSG_ID_MISSION_REQUEST_LEN 4 +// // MAVLINK_MSG_ID_MISSION_REQUEST_CRC 230 - +// +// type MissionRequest struct { - SEQ uint16 ///< Sequence - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + SEQ uint16 // Sequence + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionRequest(SEQ uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionRequest returns a new MissionRequest +func NewMissionRequest(SEQ uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionRequest { m := MissionRequest{} m.SEQ = SEQ m.TARGET_SYSTEM = TARGET_SYSTEM @@ -2274,18 +2720,22 @@ func NewMissionRequest(SEQ uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) return &m } +// Id returns the MissionRequest Message ID func (*MissionRequest) Id() uint8 { return 40 } +// Len returns the MissionRequest Message Length func (*MissionRequest) Len() uint8 { return 4 } +// Crc returns the MissionRequest Message CRC func (*MissionRequest) Crc() uint8 { return 230 } +// Pack returns a packed byte array which represents a MissionRequest payload func (m *MissionRequest) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SEQ) @@ -2294,6 +2744,7 @@ func (m *MissionRequest) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionRequest func (m *MissionRequest) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SEQ) @@ -2301,19 +2752,26 @@ func (m *MissionRequest) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_SET_CURRENT - +// // MAVLINK_MSG_ID_MISSION_SET_CURRENT 41 +// // MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4 +// // MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC 28 - +// +// type MissionSetCurrent struct { - SEQ uint16 ///< Sequence - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + SEQ uint16 // Sequence + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionSetCurrent(SEQ uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionSetCurrent returns a new MissionSetCurrent +func NewMissionSetCurrent(SEQ uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionSetCurrent { m := MissionSetCurrent{} m.SEQ = SEQ m.TARGET_SYSTEM = TARGET_SYSTEM @@ -2321,18 +2779,22 @@ func NewMissionSetCurrent(SEQ uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint return &m } +// Id returns the MissionSetCurrent Message ID func (*MissionSetCurrent) Id() uint8 { return 41 } +// Len returns the MissionSetCurrent Message Length func (*MissionSetCurrent) Len() uint8 { return 4 } +// Crc returns the MissionSetCurrent Message CRC func (*MissionSetCurrent) Crc() uint8 { return 28 } +// Pack returns a packed byte array which represents a MissionSetCurrent payload func (m *MissionSetCurrent) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SEQ) @@ -2341,6 +2803,7 @@ func (m *MissionSetCurrent) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionSetCurrent func (m *MissionSetCurrent) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SEQ) @@ -2348,75 +2811,98 @@ func (m *MissionSetCurrent) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_CURRENT - +// // MAVLINK_MSG_ID_MISSION_CURRENT 42 +// // MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2 +// // MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28 - +// +// type MissionCurrent struct { - SEQ uint16 ///< Sequence + SEQ uint16 // Sequence } -func NewMissionCurrent(SEQ uint16) MAVLinkMessage { +// NewMissionCurrent returns a new MissionCurrent +func NewMissionCurrent(SEQ uint16) *MissionCurrent { m := MissionCurrent{} m.SEQ = SEQ return &m } +// Id returns the MissionCurrent Message ID func (*MissionCurrent) Id() uint8 { return 42 } +// Len returns the MissionCurrent Message Length func (*MissionCurrent) Len() uint8 { return 2 } +// Crc returns the MissionCurrent Message CRC func (*MissionCurrent) Crc() uint8 { return 28 } +// Pack returns a packed byte array which represents a MissionCurrent payload func (m *MissionCurrent) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SEQ) return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionCurrent func (m *MissionCurrent) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SEQ) } +const () + +// // MESSAGE MISSION_REQUEST_LIST - +// // MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43 +// // MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 2 +// // MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC 132 - +// +// type MissionRequestList struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionRequestList(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionRequestList returns a new MissionRequestList +func NewMissionRequestList(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionRequestList { m := MissionRequestList{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT return &m } +// Id returns the MissionRequestList Message ID func (*MissionRequestList) Id() uint8 { return 43 } +// Len returns the MissionRequestList Message Length func (*MissionRequestList) Len() uint8 { return 2 } +// Crc returns the MissionRequestList Message CRC func (*MissionRequestList) Crc() uint8 { return 132 } +// Pack returns a packed byte array which represents a MissionRequestList payload func (m *MissionRequestList) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -2424,25 +2910,33 @@ func (m *MissionRequestList) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionRequestList func (m *MissionRequestList) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_COUNT - +// // MAVLINK_MSG_ID_MISSION_COUNT 44 +// // MAVLINK_MSG_ID_MISSION_COUNT_LEN 4 +// // MAVLINK_MSG_ID_MISSION_COUNT_CRC 221 - +// +// type MissionCount struct { - COUNT uint16 ///< Number of mission items in the sequence - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + COUNT uint16 // Number of mission items in the sequence + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionCount(COUNT uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionCount returns a new MissionCount +func NewMissionCount(COUNT uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionCount { m := MissionCount{} m.COUNT = COUNT m.TARGET_SYSTEM = TARGET_SYSTEM @@ -2450,18 +2944,22 @@ func NewMissionCount(COUNT uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) return &m } +// Id returns the MissionCount Message ID func (*MissionCount) Id() uint8 { return 44 } +// Len returns the MissionCount Message Length func (*MissionCount) Len() uint8 { return 4 } +// Crc returns the MissionCount Message CRC func (*MissionCount) Crc() uint8 { return 221 } +// Pack returns a packed byte array which represents a MissionCount payload func (m *MissionCount) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.COUNT) @@ -2470,6 +2968,7 @@ func (m *MissionCount) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionCount func (m *MissionCount) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.COUNT) @@ -2477,36 +2976,47 @@ func (m *MissionCount) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_CLEAR_ALL - +// // MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45 +// // MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2 +// // MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC 232 - +// +// type MissionClearAll struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewMissionClearAll(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewMissionClearAll returns a new MissionClearAll +func NewMissionClearAll(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *MissionClearAll { m := MissionClearAll{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT return &m } +// Id returns the MissionClearAll Message ID func (*MissionClearAll) Id() uint8 { return 45 } +// Len returns the MissionClearAll Message Length func (*MissionClearAll) Len() uint8 { return 2 } +// Crc returns the MissionClearAll Message CRC func (*MissionClearAll) Crc() uint8 { return 232 } +// Pack returns a packed byte array which represents a MissionClearAll payload func (m *MissionClearAll) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -2514,64 +3024,84 @@ func (m *MissionClearAll) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionClearAll func (m *MissionClearAll) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE MISSION_ITEM_REACHED - +// // MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46 +// // MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2 +// // MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC 11 - +// +// type MissionItemReached struct { - SEQ uint16 ///< Sequence + SEQ uint16 // Sequence } -func NewMissionItemReached(SEQ uint16) MAVLinkMessage { +// NewMissionItemReached returns a new MissionItemReached +func NewMissionItemReached(SEQ uint16) *MissionItemReached { m := MissionItemReached{} m.SEQ = SEQ return &m } +// Id returns the MissionItemReached Message ID func (*MissionItemReached) Id() uint8 { return 46 } +// Len returns the MissionItemReached Message Length func (*MissionItemReached) Len() uint8 { return 2 } +// Crc returns the MissionItemReached Message CRC func (*MissionItemReached) Crc() uint8 { return 11 } +// Pack returns a packed byte array which represents a MissionItemReached payload func (m *MissionItemReached) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SEQ) return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionItemReached func (m *MissionItemReached) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SEQ) } +const () + +// // MESSAGE MISSION_ACK - +// // MAVLINK_MSG_ID_MISSION_ACK 47 +// // MAVLINK_MSG_ID_MISSION_ACK_LEN 3 +// // MAVLINK_MSG_ID_MISSION_ACK_CRC 153 - +// +// type MissionAck struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - TYPE uint8 ///< See MAV_MISSION_RESULT enum + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + TYPE uint8 // See MAV_MISSION_RESULT enum } -func NewMissionAck(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, TYPE uint8) MAVLinkMessage { +// NewMissionAck returns a new MissionAck +func NewMissionAck(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, TYPE uint8) *MissionAck { m := MissionAck{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT @@ -2579,18 +3109,22 @@ func NewMissionAck(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, TYPE uint8) MAVL return &m } +// Id returns the MissionAck Message ID func (*MissionAck) Id() uint8 { return 47 } +// Len returns the MissionAck Message Length func (*MissionAck) Len() uint8 { return 3 } +// Crc returns the MissionAck Message CRC func (*MissionAck) Crc() uint8 { return 153 } +// Pack returns a packed byte array which represents a MissionAck payload func (m *MissionAck) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -2599,6 +3133,7 @@ func (m *MissionAck) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MissionAck func (m *MissionAck) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) @@ -2606,20 +3141,27 @@ func (m *MissionAck) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TYPE) } +const () + +// // MESSAGE SET_GPS_GLOBAL_ORIGIN - +// // MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN 48 +// // MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN 13 +// // MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC 41 - +// +// type SetGpsGlobalOrigin struct { - LATITUDE int32 ///< Latitude (WGS84), in degrees * 1E7 - LONGITUDE int32 ///< Longitude (WGS84, in degrees * 1E7 - ALTITUDE int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) - TARGET_SYSTEM uint8 ///< System ID + LATITUDE int32 // Latitude (WGS84), in degrees * 1E7 + LONGITUDE int32 // Longitude (WGS84, in degrees * 1E7 + ALTITUDE int32 // Altitude (WGS84), in meters * 1000 (positive for up) + TARGET_SYSTEM uint8 // System ID } -func NewSetGpsGlobalOrigin(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, TARGET_SYSTEM uint8) MAVLinkMessage { +// NewSetGpsGlobalOrigin returns a new SetGpsGlobalOrigin +func NewSetGpsGlobalOrigin(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, TARGET_SYSTEM uint8) *SetGpsGlobalOrigin { m := SetGpsGlobalOrigin{} m.LATITUDE = LATITUDE m.LONGITUDE = LONGITUDE @@ -2628,18 +3170,22 @@ func NewSetGpsGlobalOrigin(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, TARG return &m } +// Id returns the SetGpsGlobalOrigin Message ID func (*SetGpsGlobalOrigin) Id() uint8 { return 48 } +// Len returns the SetGpsGlobalOrigin Message Length func (*SetGpsGlobalOrigin) Len() uint8 { return 13 } +// Crc returns the SetGpsGlobalOrigin Message CRC func (*SetGpsGlobalOrigin) Crc() uint8 { return 41 } +// Pack returns a packed byte array which represents a SetGpsGlobalOrigin payload func (m *SetGpsGlobalOrigin) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LATITUDE) @@ -2649,6 +3195,7 @@ func (m *SetGpsGlobalOrigin) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetGpsGlobalOrigin func (m *SetGpsGlobalOrigin) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LATITUDE) @@ -2657,19 +3204,26 @@ func (m *SetGpsGlobalOrigin) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) } +const () + +// // MESSAGE GPS_GLOBAL_ORIGIN - +// // MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49 +// // MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12 +// // MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC 39 - +// +// type GpsGlobalOrigin struct { - LATITUDE int32 ///< Latitude (WGS84), in degrees * 1E7 - LONGITUDE int32 ///< Longitude (WGS84), in degrees * 1E7 - ALTITUDE int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) + LATITUDE int32 // Latitude (WGS84), in degrees * 1E7 + LONGITUDE int32 // Longitude (WGS84), in degrees * 1E7 + ALTITUDE int32 // Altitude (WGS84), in meters * 1000 (positive for up) } -func NewGpsGlobalOrigin(LATITUDE int32, LONGITUDE int32, ALTITUDE int32) MAVLinkMessage { +// NewGpsGlobalOrigin returns a new GpsGlobalOrigin +func NewGpsGlobalOrigin(LATITUDE int32, LONGITUDE int32, ALTITUDE int32) *GpsGlobalOrigin { m := GpsGlobalOrigin{} m.LATITUDE = LATITUDE m.LONGITUDE = LONGITUDE @@ -2677,18 +3231,22 @@ func NewGpsGlobalOrigin(LATITUDE int32, LONGITUDE int32, ALTITUDE int32) MAVLink return &m } +// Id returns the GpsGlobalOrigin Message ID func (*GpsGlobalOrigin) Id() uint8 { return 49 } +// Len returns the GpsGlobalOrigin Message Length func (*GpsGlobalOrigin) Len() uint8 { return 12 } +// Crc returns the GpsGlobalOrigin Message CRC func (*GpsGlobalOrigin) Crc() uint8 { return 39 } +// Pack returns a packed byte array which represents a GpsGlobalOrigin payload func (m *GpsGlobalOrigin) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LATITUDE) @@ -2697,6 +3255,7 @@ func (m *GpsGlobalOrigin) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GpsGlobalOrigin func (m *GpsGlobalOrigin) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LATITUDE) @@ -2704,23 +3263,30 @@ func (m *GpsGlobalOrigin) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ALTITUDE) } +const () + +// // MESSAGE SET_LOCAL_POSITION_SETPOINT - +// // MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT 50 +// // MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_LEN 19 +// // MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT_CRC 214 - +// +// type SetLocalPositionSetpoint struct { - X float32 ///< x position - Y float32 ///< y position - Z float32 ///< z position - YAW float32 ///< Desired yaw angle - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - COORDINATE_FRAME uint8 ///< Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU + X float32 // x position + Y float32 // y position + Z float32 // z position + YAW float32 // Desired yaw angle + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + COORDINATE_FRAME uint8 // Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU } -func NewSetLocalPositionSetpoint(X float32, Y float32, Z float32, YAW float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, COORDINATE_FRAME uint8) MAVLinkMessage { +// NewSetLocalPositionSetpoint returns a new SetLocalPositionSetpoint +func NewSetLocalPositionSetpoint(X float32, Y float32, Z float32, YAW float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, COORDINATE_FRAME uint8) *SetLocalPositionSetpoint { m := SetLocalPositionSetpoint{} m.X = X m.Y = Y @@ -2732,18 +3298,22 @@ func NewSetLocalPositionSetpoint(X float32, Y float32, Z float32, YAW float32, T return &m } +// Id returns the SetLocalPositionSetpoint Message ID func (*SetLocalPositionSetpoint) Id() uint8 { return 50 } +// Len returns the SetLocalPositionSetpoint Message Length func (*SetLocalPositionSetpoint) Len() uint8 { return 19 } +// Crc returns the SetLocalPositionSetpoint Message CRC func (*SetLocalPositionSetpoint) Crc() uint8 { return 214 } +// Pack returns a packed byte array which represents a SetLocalPositionSetpoint payload func (m *SetLocalPositionSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.X) @@ -2756,6 +3326,7 @@ func (m *SetLocalPositionSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetLocalPositionSetpoint func (m *SetLocalPositionSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.X) @@ -2767,21 +3338,28 @@ func (m *SetLocalPositionSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.COORDINATE_FRAME) } +const () + +// // MESSAGE LOCAL_POSITION_SETPOINT - +// // MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT 51 +// // MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_LEN 17 +// // MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_CRC 223 - +// +// type LocalPositionSetpoint struct { - X float32 ///< x position - Y float32 ///< y position - Z float32 ///< z position - YAW float32 ///< Desired yaw angle - COORDINATE_FRAME uint8 ///< Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU + X float32 // x position + Y float32 // y position + Z float32 // z position + YAW float32 // Desired yaw angle + COORDINATE_FRAME uint8 // Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU } -func NewLocalPositionSetpoint(X float32, Y float32, Z float32, YAW float32, COORDINATE_FRAME uint8) MAVLinkMessage { +// NewLocalPositionSetpoint returns a new LocalPositionSetpoint +func NewLocalPositionSetpoint(X float32, Y float32, Z float32, YAW float32, COORDINATE_FRAME uint8) *LocalPositionSetpoint { m := LocalPositionSetpoint{} m.X = X m.Y = Y @@ -2791,18 +3369,22 @@ func NewLocalPositionSetpoint(X float32, Y float32, Z float32, YAW float32, COOR return &m } +// Id returns the LocalPositionSetpoint Message ID func (*LocalPositionSetpoint) Id() uint8 { return 51 } +// Len returns the LocalPositionSetpoint Message Length func (*LocalPositionSetpoint) Len() uint8 { return 17 } +// Crc returns the LocalPositionSetpoint Message CRC func (*LocalPositionSetpoint) Crc() uint8 { return 223 } +// Pack returns a packed byte array which represents a LocalPositionSetpoint payload func (m *LocalPositionSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.X) @@ -2813,6 +3395,7 @@ func (m *LocalPositionSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LocalPositionSetpoint func (m *LocalPositionSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.X) @@ -2822,21 +3405,28 @@ func (m *LocalPositionSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.COORDINATE_FRAME) } +const () + +// // MESSAGE GLOBAL_POSITION_SETPOINT_INT - +// // MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT 52 +// // MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_LEN 15 +// // MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT_CRC 141 - +// +// type GlobalPositionSetpointInt struct { - LATITUDE int32 ///< Latitude (WGS84), in degrees * 1E7 - LONGITUDE int32 ///< Longitude (WGS84), in degrees * 1E7 - ALTITUDE int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) - YAW int16 ///< Desired yaw angle in degrees * 100 - COORDINATE_FRAME uint8 ///< Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT + LATITUDE int32 // Latitude (WGS84), in degrees * 1E7 + LONGITUDE int32 // Longitude (WGS84), in degrees * 1E7 + ALTITUDE int32 // Altitude (WGS84), in meters * 1000 (positive for up) + YAW int16 // Desired yaw angle in degrees * 100 + COORDINATE_FRAME uint8 // Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT } -func NewGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, YAW int16, COORDINATE_FRAME uint8) MAVLinkMessage { +// NewGlobalPositionSetpointInt returns a new GlobalPositionSetpointInt +func NewGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, YAW int16, COORDINATE_FRAME uint8) *GlobalPositionSetpointInt { m := GlobalPositionSetpointInt{} m.LATITUDE = LATITUDE m.LONGITUDE = LONGITUDE @@ -2846,18 +3436,22 @@ func NewGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE int3 return &m } +// Id returns the GlobalPositionSetpointInt Message ID func (*GlobalPositionSetpointInt) Id() uint8 { return 52 } +// Len returns the GlobalPositionSetpointInt Message Length func (*GlobalPositionSetpointInt) Len() uint8 { return 15 } +// Crc returns the GlobalPositionSetpointInt Message CRC func (*GlobalPositionSetpointInt) Crc() uint8 { return 141 } +// Pack returns a packed byte array which represents a GlobalPositionSetpointInt payload func (m *GlobalPositionSetpointInt) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LATITUDE) @@ -2868,6 +3462,7 @@ func (m *GlobalPositionSetpointInt) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GlobalPositionSetpointInt func (m *GlobalPositionSetpointInt) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LATITUDE) @@ -2877,21 +3472,28 @@ func (m *GlobalPositionSetpointInt) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.COORDINATE_FRAME) } +const () + +// // MESSAGE SET_GLOBAL_POSITION_SETPOINT_INT - +// // MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT 53 +// // MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_LEN 15 +// // MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT_CRC 33 - +// +// type SetGlobalPositionSetpointInt struct { - LATITUDE int32 ///< Latitude (WGS84), in degrees * 1E7 - LONGITUDE int32 ///< Longitude (WGS84), in degrees * 1E7 - ALTITUDE int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) - YAW int16 ///< Desired yaw angle in degrees * 100 - COORDINATE_FRAME uint8 ///< Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT + LATITUDE int32 // Latitude (WGS84), in degrees * 1E7 + LONGITUDE int32 // Longitude (WGS84), in degrees * 1E7 + ALTITUDE int32 // Altitude (WGS84), in meters * 1000 (positive for up) + YAW int16 // Desired yaw angle in degrees * 100 + COORDINATE_FRAME uint8 // Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT } -func NewSetGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, YAW int16, COORDINATE_FRAME uint8) MAVLinkMessage { +// NewSetGlobalPositionSetpointInt returns a new SetGlobalPositionSetpointInt +func NewSetGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE int32, YAW int16, COORDINATE_FRAME uint8) *SetGlobalPositionSetpointInt { m := SetGlobalPositionSetpointInt{} m.LATITUDE = LATITUDE m.LONGITUDE = LONGITUDE @@ -2901,18 +3503,22 @@ func NewSetGlobalPositionSetpointInt(LATITUDE int32, LONGITUDE int32, ALTITUDE i return &m } +// Id returns the SetGlobalPositionSetpointInt Message ID func (*SetGlobalPositionSetpointInt) Id() uint8 { return 53 } +// Len returns the SetGlobalPositionSetpointInt Message Length func (*SetGlobalPositionSetpointInt) Len() uint8 { return 15 } +// Crc returns the SetGlobalPositionSetpointInt Message CRC func (*SetGlobalPositionSetpointInt) Crc() uint8 { return 33 } +// Pack returns a packed byte array which represents a SetGlobalPositionSetpointInt payload func (m *SetGlobalPositionSetpointInt) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LATITUDE) @@ -2923,6 +3529,7 @@ func (m *SetGlobalPositionSetpointInt) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetGlobalPositionSetpointInt func (m *SetGlobalPositionSetpointInt) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LATITUDE) @@ -2932,25 +3539,32 @@ func (m *SetGlobalPositionSetpointInt) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.COORDINATE_FRAME) } +const () + +// // MESSAGE SAFETY_SET_ALLOWED_AREA - +// // MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA 54 +// // MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27 +// // MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC 15 - +// +// type SafetySetAllowedArea struct { - P1X float32 ///< x position 1 / Latitude 1 - P1Y float32 ///< y position 1 / Longitude 1 - P1Z float32 ///< z position 1 / Altitude 1 - P2X float32 ///< x position 2 / Latitude 2 - P2Y float32 ///< y position 2 / Longitude 2 - P2Z float32 ///< z position 2 / Altitude 2 - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - FRAME uint8 ///< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + P1X float32 // x position 1 / Latitude 1 + P1Y float32 // y position 1 / Longitude 1 + P1Z float32 // z position 1 / Altitude 1 + P2X float32 // x position 2 / Latitude 2 + P2Y float32 // y position 2 / Longitude 2 + P2Z float32 // z position 2 / Altitude 2 + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + FRAME uint8 // Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. } -func NewSafetySetAllowedArea(P1X float32, P1Y float32, P1Z float32, P2X float32, P2Y float32, P2Z float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, FRAME uint8) MAVLinkMessage { +// NewSafetySetAllowedArea returns a new SafetySetAllowedArea +func NewSafetySetAllowedArea(P1X float32, P1Y float32, P1Z float32, P2X float32, P2Y float32, P2Z float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, FRAME uint8) *SafetySetAllowedArea { m := SafetySetAllowedArea{} m.P1X = P1X m.P1Y = P1Y @@ -2964,18 +3578,22 @@ func NewSafetySetAllowedArea(P1X float32, P1Y float32, P1Z float32, P2X float32, return &m } +// Id returns the SafetySetAllowedArea Message ID func (*SafetySetAllowedArea) Id() uint8 { return 54 } +// Len returns the SafetySetAllowedArea Message Length func (*SafetySetAllowedArea) Len() uint8 { return 27 } +// Crc returns the SafetySetAllowedArea Message CRC func (*SafetySetAllowedArea) Crc() uint8 { return 15 } +// Pack returns a packed byte array which represents a SafetySetAllowedArea payload func (m *SafetySetAllowedArea) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.P1X) @@ -2990,6 +3608,7 @@ func (m *SafetySetAllowedArea) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SafetySetAllowedArea func (m *SafetySetAllowedArea) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.P1X) @@ -3003,23 +3622,30 @@ func (m *SafetySetAllowedArea) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FRAME) } +const () + +// // MESSAGE SAFETY_ALLOWED_AREA - +// // MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA 55 +// // MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25 +// // MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC 3 - +// +// type SafetyAllowedArea struct { - P1X float32 ///< x position 1 / Latitude 1 - P1Y float32 ///< y position 1 / Longitude 1 - P1Z float32 ///< z position 1 / Altitude 1 - P2X float32 ///< x position 2 / Latitude 2 - P2Y float32 ///< y position 2 / Longitude 2 - P2Z float32 ///< z position 2 / Altitude 2 - FRAME uint8 ///< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + P1X float32 // x position 1 / Latitude 1 + P1Y float32 // y position 1 / Longitude 1 + P1Z float32 // z position 1 / Altitude 1 + P2X float32 // x position 2 / Latitude 2 + P2Y float32 // y position 2 / Longitude 2 + P2Z float32 // z position 2 / Altitude 2 + FRAME uint8 // Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. } -func NewSafetyAllowedArea(P1X float32, P1Y float32, P1Z float32, P2X float32, P2Y float32, P2Z float32, FRAME uint8) MAVLinkMessage { +// NewSafetyAllowedArea returns a new SafetyAllowedArea +func NewSafetyAllowedArea(P1X float32, P1Y float32, P1Z float32, P2X float32, P2Y float32, P2Z float32, FRAME uint8) *SafetyAllowedArea { m := SafetyAllowedArea{} m.P1X = P1X m.P1Y = P1Y @@ -3031,18 +3657,22 @@ func NewSafetyAllowedArea(P1X float32, P1Y float32, P1Z float32, P2X float32, P2 return &m } +// Id returns the SafetyAllowedArea Message ID func (*SafetyAllowedArea) Id() uint8 { return 55 } +// Len returns the SafetyAllowedArea Message Length func (*SafetyAllowedArea) Len() uint8 { return 25 } +// Crc returns the SafetyAllowedArea Message CRC func (*SafetyAllowedArea) Crc() uint8 { return 3 } +// Pack returns a packed byte array which represents a SafetyAllowedArea payload func (m *SafetyAllowedArea) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.P1X) @@ -3055,6 +3685,7 @@ func (m *SafetyAllowedArea) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SafetyAllowedArea func (m *SafetyAllowedArea) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.P1X) @@ -3066,22 +3697,29 @@ func (m *SafetyAllowedArea) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FRAME) } +const () + +// // MESSAGE SET_ROLL_PITCH_YAW_THRUST - +// // MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST 56 +// // MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_LEN 18 +// // MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST_CRC 100 - +// +// type SetRollPitchYawThrust struct { - ROLL float32 ///< Desired roll angle in radians - PITCH float32 ///< Desired pitch angle in radians - YAW float32 ///< Desired yaw angle in radians - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + ROLL float32 // Desired roll angle in radians + PITCH float32 // Desired pitch angle in radians + YAW float32 // Desired yaw angle in radians + THRUST float32 // Collective thrust, normalized to 0 .. 1 + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewSetRollPitchYawThrust(ROLL float32, PITCH float32, YAW float32, THRUST float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewSetRollPitchYawThrust returns a new SetRollPitchYawThrust +func NewSetRollPitchYawThrust(ROLL float32, PITCH float32, YAW float32, THRUST float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *SetRollPitchYawThrust { m := SetRollPitchYawThrust{} m.ROLL = ROLL m.PITCH = PITCH @@ -3092,18 +3730,22 @@ func NewSetRollPitchYawThrust(ROLL float32, PITCH float32, YAW float32, THRUST f return &m } +// Id returns the SetRollPitchYawThrust Message ID func (*SetRollPitchYawThrust) Id() uint8 { return 56 } +// Len returns the SetRollPitchYawThrust Message Length func (*SetRollPitchYawThrust) Len() uint8 { return 18 } +// Crc returns the SetRollPitchYawThrust Message CRC func (*SetRollPitchYawThrust) Crc() uint8 { return 100 } +// Pack returns a packed byte array which represents a SetRollPitchYawThrust payload func (m *SetRollPitchYawThrust) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.ROLL) @@ -3115,6 +3757,7 @@ func (m *SetRollPitchYawThrust) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetRollPitchYawThrust func (m *SetRollPitchYawThrust) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.ROLL) @@ -3125,22 +3768,29 @@ func (m *SetRollPitchYawThrust) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE SET_ROLL_PITCH_YAW_SPEED_THRUST - +// // MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST 57 +// // MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_LEN 18 +// // MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST_CRC 24 - +// +// type SetRollPitchYawSpeedThrust struct { - ROLL_SPEED float32 ///< Desired roll angular speed in rad/s - PITCH_SPEED float32 ///< Desired pitch angular speed in rad/s - YAW_SPEED float32 ///< Desired yaw angular speed in rad/s - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + ROLL_SPEED float32 // Desired roll angular speed in rad/s + PITCH_SPEED float32 // Desired pitch angular speed in rad/s + YAW_SPEED float32 // Desired yaw angular speed in rad/s + THRUST float32 // Collective thrust, normalized to 0 .. 1 + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewSetRollPitchYawSpeedThrust(ROLL_SPEED float32, PITCH_SPEED float32, YAW_SPEED float32, THRUST float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewSetRollPitchYawSpeedThrust returns a new SetRollPitchYawSpeedThrust +func NewSetRollPitchYawSpeedThrust(ROLL_SPEED float32, PITCH_SPEED float32, YAW_SPEED float32, THRUST float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *SetRollPitchYawSpeedThrust { m := SetRollPitchYawSpeedThrust{} m.ROLL_SPEED = ROLL_SPEED m.PITCH_SPEED = PITCH_SPEED @@ -3151,18 +3801,22 @@ func NewSetRollPitchYawSpeedThrust(ROLL_SPEED float32, PITCH_SPEED float32, YAW_ return &m } +// Id returns the SetRollPitchYawSpeedThrust Message ID func (*SetRollPitchYawSpeedThrust) Id() uint8 { return 57 } +// Len returns the SetRollPitchYawSpeedThrust Message Length func (*SetRollPitchYawSpeedThrust) Len() uint8 { return 18 } +// Crc returns the SetRollPitchYawSpeedThrust Message CRC func (*SetRollPitchYawSpeedThrust) Crc() uint8 { return 24 } +// Pack returns a packed byte array which represents a SetRollPitchYawSpeedThrust payload func (m *SetRollPitchYawSpeedThrust) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.ROLL_SPEED) @@ -3174,6 +3828,7 @@ func (m *SetRollPitchYawSpeedThrust) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetRollPitchYawSpeedThrust func (m *SetRollPitchYawSpeedThrust) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.ROLL_SPEED) @@ -3184,21 +3839,28 @@ func (m *SetRollPitchYawSpeedThrust) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE ROLL_PITCH_YAW_THRUST_SETPOINT - +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT 58 +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_LEN 20 +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT_CRC 239 - +// +// type RollPitchYawThrustSetpoint struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot - ROLL float32 ///< Desired roll angle in radians - PITCH float32 ///< Desired pitch angle in radians - YAW float32 ///< Desired yaw angle in radians - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot + ROLL float32 // Desired roll angle in radians + PITCH float32 // Desired pitch angle in radians + YAW float32 // Desired yaw angle in radians + THRUST float32 // Collective thrust, normalized to 0 .. 1 } -func NewRollPitchYawThrustSetpoint(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, THRUST float32) MAVLinkMessage { +// NewRollPitchYawThrustSetpoint returns a new RollPitchYawThrustSetpoint +func NewRollPitchYawThrustSetpoint(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, THRUST float32) *RollPitchYawThrustSetpoint { m := RollPitchYawThrustSetpoint{} m.TIME_BOOT_MS = TIME_BOOT_MS m.ROLL = ROLL @@ -3208,18 +3870,22 @@ func NewRollPitchYawThrustSetpoint(TIME_BOOT_MS uint32, ROLL float32, PITCH floa return &m } +// Id returns the RollPitchYawThrustSetpoint Message ID func (*RollPitchYawThrustSetpoint) Id() uint8 { return 58 } +// Len returns the RollPitchYawThrustSetpoint Message Length func (*RollPitchYawThrustSetpoint) Len() uint8 { return 20 } +// Crc returns the RollPitchYawThrustSetpoint Message CRC func (*RollPitchYawThrustSetpoint) Crc() uint8 { return 239 } +// Pack returns a packed byte array which represents a RollPitchYawThrustSetpoint payload func (m *RollPitchYawThrustSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -3230,6 +3896,7 @@ func (m *RollPitchYawThrustSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RollPitchYawThrustSetpoint func (m *RollPitchYawThrustSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -3239,21 +3906,28 @@ func (m *RollPitchYawThrustSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.THRUST) } +const () + +// // MESSAGE ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT - +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT 59 +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_LEN 20 +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT_CRC 238 - +// +// type RollPitchYawSpeedThrustSetpoint struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot - ROLL_SPEED float32 ///< Desired roll angular speed in rad/s - PITCH_SPEED float32 ///< Desired pitch angular speed in rad/s - YAW_SPEED float32 ///< Desired yaw angular speed in rad/s - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot + ROLL_SPEED float32 // Desired roll angular speed in rad/s + PITCH_SPEED float32 // Desired pitch angular speed in rad/s + YAW_SPEED float32 // Desired yaw angular speed in rad/s + THRUST float32 // Collective thrust, normalized to 0 .. 1 } -func NewRollPitchYawSpeedThrustSetpoint(TIME_BOOT_MS uint32, ROLL_SPEED float32, PITCH_SPEED float32, YAW_SPEED float32, THRUST float32) MAVLinkMessage { +// NewRollPitchYawSpeedThrustSetpoint returns a new RollPitchYawSpeedThrustSetpoint +func NewRollPitchYawSpeedThrustSetpoint(TIME_BOOT_MS uint32, ROLL_SPEED float32, PITCH_SPEED float32, YAW_SPEED float32, THRUST float32) *RollPitchYawSpeedThrustSetpoint { m := RollPitchYawSpeedThrustSetpoint{} m.TIME_BOOT_MS = TIME_BOOT_MS m.ROLL_SPEED = ROLL_SPEED @@ -3263,18 +3937,22 @@ func NewRollPitchYawSpeedThrustSetpoint(TIME_BOOT_MS uint32, ROLL_SPEED float32, return &m } +// Id returns the RollPitchYawSpeedThrustSetpoint Message ID func (*RollPitchYawSpeedThrustSetpoint) Id() uint8 { return 59 } +// Len returns the RollPitchYawSpeedThrustSetpoint Message Length func (*RollPitchYawSpeedThrustSetpoint) Len() uint8 { return 20 } +// Crc returns the RollPitchYawSpeedThrustSetpoint Message CRC func (*RollPitchYawSpeedThrustSetpoint) Crc() uint8 { return 238 } +// Pack returns a packed byte array which represents a RollPitchYawSpeedThrustSetpoint payload func (m *RollPitchYawSpeedThrustSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -3285,6 +3963,7 @@ func (m *RollPitchYawSpeedThrustSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RollPitchYawSpeedThrustSetpoint func (m *RollPitchYawSpeedThrustSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -3294,21 +3973,28 @@ func (m *RollPitchYawSpeedThrustSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.THRUST) } +const () + +// // MESSAGE SET_QUAD_MOTORS_SETPOINT - +// // MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT 60 +// // MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN 9 +// // MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_CRC 30 - +// +// type SetQuadMotorsSetpoint struct { - MOTOR_FRONT_NW uint16 ///< Front motor in + configuration, front left motor in x configuration - MOTOR_RIGHT_NE uint16 ///< Right motor in + configuration, front right motor in x configuration - MOTOR_BACK_SE uint16 ///< Back motor in + configuration, back right motor in x configuration - MOTOR_LEFT_SW uint16 ///< Left motor in + configuration, back left motor in x configuration - TARGET_SYSTEM uint8 ///< System ID of the system that should set these motor commands + MOTOR_FRONT_NW uint16 // Front motor in + configuration, front left motor in x configuration + MOTOR_RIGHT_NE uint16 // Right motor in + configuration, front right motor in x configuration + MOTOR_BACK_SE uint16 // Back motor in + configuration, back right motor in x configuration + MOTOR_LEFT_SW uint16 // Left motor in + configuration, back left motor in x configuration + TARGET_SYSTEM uint8 // System ID of the system that should set these motor commands } -func NewSetQuadMotorsSetpoint(MOTOR_FRONT_NW uint16, MOTOR_RIGHT_NE uint16, MOTOR_BACK_SE uint16, MOTOR_LEFT_SW uint16, TARGET_SYSTEM uint8) MAVLinkMessage { +// NewSetQuadMotorsSetpoint returns a new SetQuadMotorsSetpoint +func NewSetQuadMotorsSetpoint(MOTOR_FRONT_NW uint16, MOTOR_RIGHT_NE uint16, MOTOR_BACK_SE uint16, MOTOR_LEFT_SW uint16, TARGET_SYSTEM uint8) *SetQuadMotorsSetpoint { m := SetQuadMotorsSetpoint{} m.MOTOR_FRONT_NW = MOTOR_FRONT_NW m.MOTOR_RIGHT_NE = MOTOR_RIGHT_NE @@ -3318,18 +4004,22 @@ func NewSetQuadMotorsSetpoint(MOTOR_FRONT_NW uint16, MOTOR_RIGHT_NE uint16, MOTO return &m } +// Id returns the SetQuadMotorsSetpoint Message ID func (*SetQuadMotorsSetpoint) Id() uint8 { return 60 } +// Len returns the SetQuadMotorsSetpoint Message Length func (*SetQuadMotorsSetpoint) Len() uint8 { return 9 } +// Crc returns the SetQuadMotorsSetpoint Message CRC func (*SetQuadMotorsSetpoint) Crc() uint8 { return 30 } +// Pack returns a packed byte array which represents a SetQuadMotorsSetpoint payload func (m *SetQuadMotorsSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.MOTOR_FRONT_NW) @@ -3340,6 +4030,7 @@ func (m *SetQuadMotorsSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetQuadMotorsSetpoint func (m *SetQuadMotorsSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.MOTOR_FRONT_NW) @@ -3349,22 +4040,29 @@ func (m *SetQuadMotorsSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) } +const () + +// // MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST - +// // MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST 61 +// // MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN 34 +// // MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_CRC 240 - +// +// type SetQuadSwarmRollPitchYawThrust struct { - ROLL [4]int16 ///< Desired roll angle in radians +-PI (+-INT16_MAX) - PITCH [4]int16 ///< Desired pitch angle in radians +-PI (+-INT16_MAX) - YAW [4]int16 ///< Desired yaw angle in radians, scaled to int16 +-PI (+-INT16_MAX) - THRUST [4]uint16 ///< Collective thrust, scaled to uint16 (0..UINT16_MAX) - GROUP uint8 ///< ID of the quadrotor group (0 - 255, up to 256 groups supported) - MODE uint8 ///< ID of the flight mode (0 - 255, up to 256 modes supported) + ROLL [4]int16 // Desired roll angle in radians +-PI (+-INT16_MAX) + PITCH [4]int16 // Desired pitch angle in radians +-PI (+-INT16_MAX) + YAW [4]int16 // Desired yaw angle in radians, scaled to int16 +-PI (+-INT16_MAX) + THRUST [4]uint16 // Collective thrust, scaled to uint16 (0..UINT16_MAX) + GROUP uint8 // ID of the quadrotor group (0 - 255, up to 256 groups supported) + MODE uint8 // ID of the flight mode (0 - 255, up to 256 modes supported) } -func NewSetQuadSwarmRollPitchYawThrust(ROLL [4]int16, PITCH [4]int16, YAW [4]int16, THRUST [4]uint16, GROUP uint8, MODE uint8) MAVLinkMessage { +// NewSetQuadSwarmRollPitchYawThrust returns a new SetQuadSwarmRollPitchYawThrust +func NewSetQuadSwarmRollPitchYawThrust(ROLL [4]int16, PITCH [4]int16, YAW [4]int16, THRUST [4]uint16, GROUP uint8, MODE uint8) *SetQuadSwarmRollPitchYawThrust { m := SetQuadSwarmRollPitchYawThrust{} m.ROLL = ROLL m.PITCH = PITCH @@ -3375,18 +4073,22 @@ func NewSetQuadSwarmRollPitchYawThrust(ROLL [4]int16, PITCH [4]int16, YAW [4]int return &m } +// Id returns the SetQuadSwarmRollPitchYawThrust Message ID func (*SetQuadSwarmRollPitchYawThrust) Id() uint8 { return 61 } +// Len returns the SetQuadSwarmRollPitchYawThrust Message Length func (*SetQuadSwarmRollPitchYawThrust) Len() uint8 { return 34 } +// Crc returns the SetQuadSwarmRollPitchYawThrust Message CRC func (*SetQuadSwarmRollPitchYawThrust) Crc() uint8 { return 240 } +// Pack returns a packed byte array which represents a SetQuadSwarmRollPitchYawThrust payload func (m *SetQuadSwarmRollPitchYawThrust) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.ROLL) @@ -3398,6 +4100,7 @@ func (m *SetQuadSwarmRollPitchYawThrust) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetQuadSwarmRollPitchYawThrust func (m *SetQuadSwarmRollPitchYawThrust) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.ROLL) @@ -3408,29 +4111,36 @@ func (m *SetQuadSwarmRollPitchYawThrust) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.MODE) } -const MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_roll_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_pitch_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_yaw_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_thrust_LEN = 4 +const ( + MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_roll_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_pitch_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_yaw_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_thrust_LEN = 4 +) +// // MESSAGE NAV_CONTROLLER_OUTPUT - +// // MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT 62 +// // MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26 +// // MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC 183 - +// +// type NavControllerOutput struct { - NAV_ROLL float32 ///< Current desired roll in degrees - NAV_PITCH float32 ///< Current desired pitch in degrees - ALT_ERROR float32 ///< Current altitude error in meters - ASPD_ERROR float32 ///< Current airspeed error in meters/second - XTRACK_ERROR float32 ///< Current crosstrack error on x-y plane in meters - NAV_BEARING int16 ///< Current desired heading in degrees - TARGET_BEARING int16 ///< Bearing to current MISSION/target in degrees - WP_DIST uint16 ///< Distance to active MISSION in meters + NAV_ROLL float32 // Current desired roll in degrees + NAV_PITCH float32 // Current desired pitch in degrees + ALT_ERROR float32 // Current altitude error in meters + ASPD_ERROR float32 // Current airspeed error in meters/second + XTRACK_ERROR float32 // Current crosstrack error on x-y plane in meters + NAV_BEARING int16 // Current desired heading in degrees + TARGET_BEARING int16 // Bearing to current MISSION/target in degrees + WP_DIST uint16 // Distance to active MISSION in meters } -func NewNavControllerOutput(NAV_ROLL float32, NAV_PITCH float32, ALT_ERROR float32, ASPD_ERROR float32, XTRACK_ERROR float32, NAV_BEARING int16, TARGET_BEARING int16, WP_DIST uint16) MAVLinkMessage { +// NewNavControllerOutput returns a new NavControllerOutput +func NewNavControllerOutput(NAV_ROLL float32, NAV_PITCH float32, ALT_ERROR float32, ASPD_ERROR float32, XTRACK_ERROR float32, NAV_BEARING int16, TARGET_BEARING int16, WP_DIST uint16) *NavControllerOutput { m := NavControllerOutput{} m.NAV_ROLL = NAV_ROLL m.NAV_PITCH = NAV_PITCH @@ -3443,18 +4153,22 @@ func NewNavControllerOutput(NAV_ROLL float32, NAV_PITCH float32, ALT_ERROR float return &m } +// Id returns the NavControllerOutput Message ID func (*NavControllerOutput) Id() uint8 { return 62 } +// Len returns the NavControllerOutput Message Length func (*NavControllerOutput) Len() uint8 { return 26 } +// Crc returns the NavControllerOutput Message CRC func (*NavControllerOutput) Crc() uint8 { return 183 } +// Pack returns a packed byte array which represents a NavControllerOutput payload func (m *NavControllerOutput) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.NAV_ROLL) @@ -3468,6 +4182,7 @@ func (m *NavControllerOutput) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the NavControllerOutput func (m *NavControllerOutput) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.NAV_ROLL) @@ -3480,25 +4195,32 @@ func (m *NavControllerOutput) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.WP_DIST) } +const () + +// // MESSAGE SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST - +// // MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST 63 +// // MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN 46 +// // MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_CRC 130 - +// +// type SetQuadSwarmLedRollPitchYawThrust struct { - ROLL [4]int16 ///< Desired roll angle in radians +-PI (+-INT16_MAX) - PITCH [4]int16 ///< Desired pitch angle in radians +-PI (+-INT16_MAX) - YAW [4]int16 ///< Desired yaw angle in radians, scaled to int16 +-PI (+-INT16_MAX) - THRUST [4]uint16 ///< Collective thrust, scaled to uint16 (0..UINT16_MAX) - GROUP uint8 ///< ID of the quadrotor group (0 - 255, up to 256 groups supported) - MODE uint8 ///< ID of the flight mode (0 - 255, up to 256 modes supported) - LED_RED [4]uint8 ///< RGB red channel (0-255) - LED_BLUE [4]uint8 ///< RGB green channel (0-255) - LED_GREEN [4]uint8 ///< RGB blue channel (0-255) + ROLL [4]int16 // Desired roll angle in radians +-PI (+-INT16_MAX) + PITCH [4]int16 // Desired pitch angle in radians +-PI (+-INT16_MAX) + YAW [4]int16 // Desired yaw angle in radians, scaled to int16 +-PI (+-INT16_MAX) + THRUST [4]uint16 // Collective thrust, scaled to uint16 (0..UINT16_MAX) + GROUP uint8 // ID of the quadrotor group (0 - 255, up to 256 groups supported) + MODE uint8 // ID of the flight mode (0 - 255, up to 256 modes supported) + LED_RED [4]uint8 // RGB red channel (0-255) + LED_BLUE [4]uint8 // RGB green channel (0-255) + LED_GREEN [4]uint8 // RGB blue channel (0-255) } -func NewSetQuadSwarmLedRollPitchYawThrust(ROLL [4]int16, PITCH [4]int16, YAW [4]int16, THRUST [4]uint16, GROUP uint8, MODE uint8, LED_RED [4]uint8, LED_BLUE [4]uint8, LED_GREEN [4]uint8) MAVLinkMessage { +// NewSetQuadSwarmLedRollPitchYawThrust returns a new SetQuadSwarmLedRollPitchYawThrust +func NewSetQuadSwarmLedRollPitchYawThrust(ROLL [4]int16, PITCH [4]int16, YAW [4]int16, THRUST [4]uint16, GROUP uint8, MODE uint8, LED_RED [4]uint8, LED_BLUE [4]uint8, LED_GREEN [4]uint8) *SetQuadSwarmLedRollPitchYawThrust { m := SetQuadSwarmLedRollPitchYawThrust{} m.ROLL = ROLL m.PITCH = PITCH @@ -3512,18 +4234,22 @@ func NewSetQuadSwarmLedRollPitchYawThrust(ROLL [4]int16, PITCH [4]int16, YAW [4] return &m } +// Id returns the SetQuadSwarmLedRollPitchYawThrust Message ID func (*SetQuadSwarmLedRollPitchYawThrust) Id() uint8 { return 63 } +// Len returns the SetQuadSwarmLedRollPitchYawThrust Message Length func (*SetQuadSwarmLedRollPitchYawThrust) Len() uint8 { return 46 } +// Crc returns the SetQuadSwarmLedRollPitchYawThrust Message CRC func (*SetQuadSwarmLedRollPitchYawThrust) Crc() uint8 { return 130 } +// Pack returns a packed byte array which represents a SetQuadSwarmLedRollPitchYawThrust payload func (m *SetQuadSwarmLedRollPitchYawThrust) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.ROLL) @@ -3538,6 +4264,7 @@ func (m *SetQuadSwarmLedRollPitchYawThrust) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SetQuadSwarmLedRollPitchYawThrust func (m *SetQuadSwarmLedRollPitchYawThrust) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.ROLL) @@ -3551,33 +4278,40 @@ func (m *SetQuadSwarmLedRollPitchYawThrust) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.LED_GREEN) } -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_roll_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_pitch_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_yaw_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_thrust_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_led_red_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_led_blue_LEN = 4 -const MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_led_green_LEN = 4 +const ( + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_roll_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_pitch_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_yaw_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_thrust_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_led_red_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_led_blue_LEN = 4 + MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_led_green_LEN = 4 +) +// // MESSAGE STATE_CORRECTION - +// // MAVLINK_MSG_ID_STATE_CORRECTION 64 +// // MAVLINK_MSG_ID_STATE_CORRECTION_LEN 36 +// // MAVLINK_MSG_ID_STATE_CORRECTION_CRC 130 - +// +// type StateCorrection struct { - XERR float32 ///< x position error - YERR float32 ///< y position error - ZERR float32 ///< z position error - ROLLERR float32 ///< roll error (radians) - PITCHERR float32 ///< pitch error (radians) - YAWERR float32 ///< yaw error (radians) - VXERR float32 ///< x velocity - VYERR float32 ///< y velocity - VZERR float32 ///< z velocity + XERR float32 // x position error + YERR float32 // y position error + ZERR float32 // z position error + ROLLERR float32 // roll error (radians) + PITCHERR float32 // pitch error (radians) + YAWERR float32 // yaw error (radians) + VXERR float32 // x velocity + VYERR float32 // y velocity + VZERR float32 // z velocity } -func NewStateCorrection(XERR float32, YERR float32, ZERR float32, ROLLERR float32, PITCHERR float32, YAWERR float32, VXERR float32, VYERR float32, VZERR float32) MAVLinkMessage { +// NewStateCorrection returns a new StateCorrection +func NewStateCorrection(XERR float32, YERR float32, ZERR float32, ROLLERR float32, PITCHERR float32, YAWERR float32, VXERR float32, VYERR float32, VZERR float32) *StateCorrection { m := StateCorrection{} m.XERR = XERR m.YERR = YERR @@ -3591,18 +4325,22 @@ func NewStateCorrection(XERR float32, YERR float32, ZERR float32, ROLLERR float3 return &m } +// Id returns the StateCorrection Message ID func (*StateCorrection) Id() uint8 { return 64 } +// Len returns the StateCorrection Message Length func (*StateCorrection) Len() uint8 { return 36 } +// Crc returns the StateCorrection Message CRC func (*StateCorrection) Crc() uint8 { return 130 } +// Pack returns a packed byte array which represents a StateCorrection payload func (m *StateCorrection) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.XERR) @@ -3617,6 +4355,7 @@ func (m *StateCorrection) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the StateCorrection func (m *StateCorrection) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.XERR) @@ -3630,37 +4369,44 @@ func (m *StateCorrection) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.VZERR) } +const () + +// // MESSAGE RC_CHANNELS - +// // MAVLINK_MSG_ID_RC_CHANNELS 65 +// // MAVLINK_MSG_ID_RC_CHANNELS_LEN 42 +// // MAVLINK_MSG_ID_RC_CHANNELS_CRC 118 - +// +// type RcChannels struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - CHAN1_RAW uint16 ///< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN2_RAW uint16 ///< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN3_RAW uint16 ///< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN4_RAW uint16 ///< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN5_RAW uint16 ///< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN6_RAW uint16 ///< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN7_RAW uint16 ///< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN8_RAW uint16 ///< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN9_RAW uint16 ///< RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN10_RAW uint16 ///< RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN11_RAW uint16 ///< RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN12_RAW uint16 ///< RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN13_RAW uint16 ///< RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN14_RAW uint16 ///< RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN15_RAW uint16 ///< RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN16_RAW uint16 ///< RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN17_RAW uint16 ///< RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHAN18_RAW uint16 ///< RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - CHANCOUNT uint8 ///< Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. - RSSI uint8 ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + CHAN1_RAW uint16 // RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN2_RAW uint16 // RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN3_RAW uint16 // RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN4_RAW uint16 // RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN5_RAW uint16 // RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN6_RAW uint16 // RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN7_RAW uint16 // RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN8_RAW uint16 // RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN9_RAW uint16 // RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN10_RAW uint16 // RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN11_RAW uint16 // RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN12_RAW uint16 // RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN13_RAW uint16 // RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN14_RAW uint16 // RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN15_RAW uint16 // RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN16_RAW uint16 // RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN17_RAW uint16 // RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHAN18_RAW uint16 // RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + CHANCOUNT uint8 // Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + RSSI uint8 // Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. } -func NewRcChannels(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, CHAN9_RAW uint16, CHAN10_RAW uint16, CHAN11_RAW uint16, CHAN12_RAW uint16, CHAN13_RAW uint16, CHAN14_RAW uint16, CHAN15_RAW uint16, CHAN16_RAW uint16, CHAN17_RAW uint16, CHAN18_RAW uint16, CHANCOUNT uint8, RSSI uint8) MAVLinkMessage { +// NewRcChannels returns a new RcChannels +func NewRcChannels(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, CHAN9_RAW uint16, CHAN10_RAW uint16, CHAN11_RAW uint16, CHAN12_RAW uint16, CHAN13_RAW uint16, CHAN14_RAW uint16, CHAN15_RAW uint16, CHAN16_RAW uint16, CHAN17_RAW uint16, CHAN18_RAW uint16, CHANCOUNT uint8, RSSI uint8) *RcChannels { m := RcChannels{} m.TIME_BOOT_MS = TIME_BOOT_MS m.CHAN1_RAW = CHAN1_RAW @@ -3686,18 +4432,22 @@ func NewRcChannels(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN return &m } +// Id returns the RcChannels Message ID func (*RcChannels) Id() uint8 { return 65 } +// Len returns the RcChannels Message Length func (*RcChannels) Len() uint8 { return 42 } +// Crc returns the RcChannels Message CRC func (*RcChannels) Crc() uint8 { return 118 } +// Pack returns a packed byte array which represents a RcChannels payload func (m *RcChannels) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -3724,6 +4474,7 @@ func (m *RcChannels) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RcChannels func (m *RcChannels) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -3749,21 +4500,28 @@ func (m *RcChannels) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.RSSI) } +const () + +// // MESSAGE REQUEST_DATA_STREAM - +// // MAVLINK_MSG_ID_REQUEST_DATA_STREAM 66 +// // MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN 6 +// // MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC 148 - +// +// type RequestDataStream struct { - REQ_MESSAGE_RATE uint16 ///< The requested interval between two messages of this type - TARGET_SYSTEM uint8 ///< The target requested to send the message stream. - TARGET_COMPONENT uint8 ///< The target requested to send the message stream. - REQ_STREAM_ID uint8 ///< The ID of the requested data stream - START_STOP uint8 ///< 1 to start sending, 0 to stop sending. + REQ_MESSAGE_RATE uint16 // The requested interval between two messages of this type + TARGET_SYSTEM uint8 // The target requested to send the message stream. + TARGET_COMPONENT uint8 // The target requested to send the message stream. + REQ_STREAM_ID uint8 // The ID of the requested data stream + START_STOP uint8 // 1 to start sending, 0 to stop sending. } -func NewRequestDataStream(REQ_MESSAGE_RATE uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, REQ_STREAM_ID uint8, START_STOP uint8) MAVLinkMessage { +// NewRequestDataStream returns a new RequestDataStream +func NewRequestDataStream(REQ_MESSAGE_RATE uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, REQ_STREAM_ID uint8, START_STOP uint8) *RequestDataStream { m := RequestDataStream{} m.REQ_MESSAGE_RATE = REQ_MESSAGE_RATE m.TARGET_SYSTEM = TARGET_SYSTEM @@ -3773,18 +4531,22 @@ func NewRequestDataStream(REQ_MESSAGE_RATE uint16, TARGET_SYSTEM uint8, TARGET_C return &m } +// Id returns the RequestDataStream Message ID func (*RequestDataStream) Id() uint8 { return 66 } +// Len returns the RequestDataStream Message Length func (*RequestDataStream) Len() uint8 { return 6 } +// Crc returns the RequestDataStream Message CRC func (*RequestDataStream) Crc() uint8 { return 148 } +// Pack returns a packed byte array which represents a RequestDataStream payload func (m *RequestDataStream) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.REQ_MESSAGE_RATE) @@ -3795,6 +4557,7 @@ func (m *RequestDataStream) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RequestDataStream func (m *RequestDataStream) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.REQ_MESSAGE_RATE) @@ -3804,19 +4567,26 @@ func (m *RequestDataStream) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.START_STOP) } +const () + +// // MESSAGE DATA_STREAM - +// // MAVLINK_MSG_ID_DATA_STREAM 67 +// // MAVLINK_MSG_ID_DATA_STREAM_LEN 4 +// // MAVLINK_MSG_ID_DATA_STREAM_CRC 21 - +// +// type DataStream struct { - MESSAGE_RATE uint16 ///< The requested interval between two messages of this type - STREAM_ID uint8 ///< The ID of the requested data stream - ON_OFF uint8 ///< 1 stream is enabled, 0 stream is stopped. + MESSAGE_RATE uint16 // The requested interval between two messages of this type + STREAM_ID uint8 // The ID of the requested data stream + ON_OFF uint8 // 1 stream is enabled, 0 stream is stopped. } -func NewDataStream(MESSAGE_RATE uint16, STREAM_ID uint8, ON_OFF uint8) MAVLinkMessage { +// NewDataStream returns a new DataStream +func NewDataStream(MESSAGE_RATE uint16, STREAM_ID uint8, ON_OFF uint8) *DataStream { m := DataStream{} m.MESSAGE_RATE = MESSAGE_RATE m.STREAM_ID = STREAM_ID @@ -3824,18 +4594,22 @@ func NewDataStream(MESSAGE_RATE uint16, STREAM_ID uint8, ON_OFF uint8) MAVLinkMe return &m } +// Id returns the DataStream Message ID func (*DataStream) Id() uint8 { return 67 } +// Len returns the DataStream Message Length func (*DataStream) Len() uint8 { return 4 } +// Crc returns the DataStream Message CRC func (*DataStream) Crc() uint8 { return 21 } +// Pack returns a packed byte array which represents a DataStream payload func (m *DataStream) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.MESSAGE_RATE) @@ -3844,6 +4618,7 @@ func (m *DataStream) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the DataStream func (m *DataStream) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.MESSAGE_RATE) @@ -3851,22 +4626,29 @@ func (m *DataStream) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ON_OFF) } +const () + +// // MESSAGE MANUAL_CONTROL - +// // MAVLINK_MSG_ID_MANUAL_CONTROL 69 +// // MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11 +// // MAVLINK_MSG_ID_MANUAL_CONTROL_CRC 243 - +// +// type ManualControl struct { - X int16 ///< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. - Y int16 ///< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. - Z int16 ///< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. - R int16 ///< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. - BUTTONS uint16 ///< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. - TARGET uint8 ///< The system to be controlled. + X int16 // X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + Y int16 // Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + Z int16 // Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. + R int16 // R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + BUTTONS uint16 // A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + TARGET uint8 // The system to be controlled. } -func NewManualControl(X int16, Y int16, Z int16, R int16, BUTTONS uint16, TARGET uint8) MAVLinkMessage { +// NewManualControl returns a new ManualControl +func NewManualControl(X int16, Y int16, Z int16, R int16, BUTTONS uint16, TARGET uint8) *ManualControl { m := ManualControl{} m.X = X m.Y = Y @@ -3877,18 +4659,22 @@ func NewManualControl(X int16, Y int16, Z int16, R int16, BUTTONS uint16, TARGET return &m } +// Id returns the ManualControl Message ID func (*ManualControl) Id() uint8 { return 69 } +// Len returns the ManualControl Message Length func (*ManualControl) Len() uint8 { return 11 } +// Crc returns the ManualControl Message CRC func (*ManualControl) Crc() uint8 { return 243 } +// Pack returns a packed byte array which represents a ManualControl payload func (m *ManualControl) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.X) @@ -3900,6 +4686,7 @@ func (m *ManualControl) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ManualControl func (m *ManualControl) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.X) @@ -3910,26 +4697,33 @@ func (m *ManualControl) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET) } +const () + +// // MESSAGE RC_CHANNELS_OVERRIDE - +// // MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70 +// // MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18 +// // MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124 - +// +// type RcChannelsOverride struct { - CHAN1_RAW uint16 ///< RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN2_RAW uint16 ///< RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN3_RAW uint16 ///< RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN4_RAW uint16 ///< RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN5_RAW uint16 ///< RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN6_RAW uint16 ///< RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN7_RAW uint16 ///< RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. - CHAN8_RAW uint16 ///< RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + CHAN1_RAW uint16 // RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN2_RAW uint16 // RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN3_RAW uint16 // RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN4_RAW uint16 // RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN5_RAW uint16 // RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN6_RAW uint16 // RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN7_RAW uint16 // RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. + CHAN8_RAW uint16 // RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewRcChannelsOverride(CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewRcChannelsOverride returns a new RcChannelsOverride +func NewRcChannelsOverride(CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *RcChannelsOverride { m := RcChannelsOverride{} m.CHAN1_RAW = CHAN1_RAW m.CHAN2_RAW = CHAN2_RAW @@ -3944,18 +4738,22 @@ func NewRcChannelsOverride(CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, return &m } +// Id returns the RcChannelsOverride Message ID func (*RcChannelsOverride) Id() uint8 { return 70 } +// Len returns the RcChannelsOverride Message Length func (*RcChannelsOverride) Len() uint8 { return 18 } +// Crc returns the RcChannelsOverride Message CRC func (*RcChannelsOverride) Crc() uint8 { return 124 } +// Pack returns a packed byte array which represents a RcChannelsOverride payload func (m *RcChannelsOverride) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.CHAN1_RAW) @@ -3971,6 +4769,7 @@ func (m *RcChannelsOverride) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RcChannelsOverride func (m *RcChannelsOverride) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.CHAN1_RAW) @@ -3985,22 +4784,29 @@ func (m *RcChannelsOverride) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE VFR_HUD - +// // MAVLINK_MSG_ID_VFR_HUD 74 +// // MAVLINK_MSG_ID_VFR_HUD_LEN 20 +// // MAVLINK_MSG_ID_VFR_HUD_CRC 20 - +// +// type VfrHud struct { - AIRSPEED float32 ///< Current airspeed in m/s - GROUNDSPEED float32 ///< Current ground speed in m/s - ALT float32 ///< Current altitude (MSL), in meters - CLIMB float32 ///< Current climb rate in meters/second - HEADING int16 ///< Current heading in degrees, in compass units (0..360, 0=north) - THROTTLE uint16 ///< Current throttle setting in integer percent, 0 to 100 + AIRSPEED float32 // Current airspeed in m/s + GROUNDSPEED float32 // Current ground speed in m/s + ALT float32 // Current altitude (MSL), in meters + CLIMB float32 // Current climb rate in meters/second + HEADING int16 // Current heading in degrees, in compass units (0..360, 0=north) + THROTTLE uint16 // Current throttle setting in integer percent, 0 to 100 } -func NewVfrHud(AIRSPEED float32, GROUNDSPEED float32, ALT float32, CLIMB float32, HEADING int16, THROTTLE uint16) MAVLinkMessage { +// NewVfrHud returns a new VfrHud +func NewVfrHud(AIRSPEED float32, GROUNDSPEED float32, ALT float32, CLIMB float32, HEADING int16, THROTTLE uint16) *VfrHud { m := VfrHud{} m.AIRSPEED = AIRSPEED m.GROUNDSPEED = GROUNDSPEED @@ -4011,18 +4817,22 @@ func NewVfrHud(AIRSPEED float32, GROUNDSPEED float32, ALT float32, CLIMB float32 return &m } +// Id returns the VfrHud Message ID func (*VfrHud) Id() uint8 { return 74 } +// Len returns the VfrHud Message Length func (*VfrHud) Len() uint8 { return 20 } +// Crc returns the VfrHud Message CRC func (*VfrHud) Crc() uint8 { return 20 } +// Pack returns a packed byte array which represents a VfrHud payload func (m *VfrHud) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.AIRSPEED) @@ -4034,6 +4844,7 @@ func (m *VfrHud) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the VfrHud func (m *VfrHud) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.AIRSPEED) @@ -4044,27 +4855,34 @@ func (m *VfrHud) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.THROTTLE) } +const () + +// // MESSAGE COMMAND_LONG - +// // MAVLINK_MSG_ID_COMMAND_LONG 76 +// // MAVLINK_MSG_ID_COMMAND_LONG_LEN 33 +// // MAVLINK_MSG_ID_COMMAND_LONG_CRC 152 - +// +// type CommandLong struct { - PARAM1 float32 ///< Parameter 1, as defined by MAV_CMD enum. - PARAM2 float32 ///< Parameter 2, as defined by MAV_CMD enum. - PARAM3 float32 ///< Parameter 3, as defined by MAV_CMD enum. - PARAM4 float32 ///< Parameter 4, as defined by MAV_CMD enum. - PARAM5 float32 ///< Parameter 5, as defined by MAV_CMD enum. - PARAM6 float32 ///< Parameter 6, as defined by MAV_CMD enum. - PARAM7 float32 ///< Parameter 7, as defined by MAV_CMD enum. - COMMAND uint16 ///< Command ID, as defined by MAV_CMD enum. - TARGET_SYSTEM uint8 ///< System which should execute the command - TARGET_COMPONENT uint8 ///< Component which should execute the command, 0 for all components - CONFIRMATION uint8 ///< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + PARAM1 float32 // Parameter 1, as defined by MAV_CMD enum. + PARAM2 float32 // Parameter 2, as defined by MAV_CMD enum. + PARAM3 float32 // Parameter 3, as defined by MAV_CMD enum. + PARAM4 float32 // Parameter 4, as defined by MAV_CMD enum. + PARAM5 float32 // Parameter 5, as defined by MAV_CMD enum. + PARAM6 float32 // Parameter 6, as defined by MAV_CMD enum. + PARAM7 float32 // Parameter 7, as defined by MAV_CMD enum. + COMMAND uint16 // Command ID, as defined by MAV_CMD enum. + TARGET_SYSTEM uint8 // System which should execute the command + TARGET_COMPONENT uint8 // Component which should execute the command, 0 for all components + CONFIRMATION uint8 // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) } -func NewCommandLong(PARAM1 float32, PARAM2 float32, PARAM3 float32, PARAM4 float32, PARAM5 float32, PARAM6 float32, PARAM7 float32, COMMAND uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, CONFIRMATION uint8) MAVLinkMessage { +// NewCommandLong returns a new CommandLong +func NewCommandLong(PARAM1 float32, PARAM2 float32, PARAM3 float32, PARAM4 float32, PARAM5 float32, PARAM6 float32, PARAM7 float32, COMMAND uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, CONFIRMATION uint8) *CommandLong { m := CommandLong{} m.PARAM1 = PARAM1 m.PARAM2 = PARAM2 @@ -4080,18 +4898,22 @@ func NewCommandLong(PARAM1 float32, PARAM2 float32, PARAM3 float32, PARAM4 float return &m } +// Id returns the CommandLong Message ID func (*CommandLong) Id() uint8 { return 76 } +// Len returns the CommandLong Message Length func (*CommandLong) Len() uint8 { return 33 } +// Crc returns the CommandLong Message CRC func (*CommandLong) Crc() uint8 { return 152 } +// Pack returns a packed byte array which represents a CommandLong payload func (m *CommandLong) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.PARAM1) @@ -4108,6 +4930,7 @@ func (m *CommandLong) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the CommandLong func (m *CommandLong) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.PARAM1) @@ -4123,36 +4946,47 @@ func (m *CommandLong) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.CONFIRMATION) } +const () + +// // MESSAGE COMMAND_ACK - +// // MAVLINK_MSG_ID_COMMAND_ACK 77 +// // MAVLINK_MSG_ID_COMMAND_ACK_LEN 3 +// // MAVLINK_MSG_ID_COMMAND_ACK_CRC 143 - +// +// type CommandAck struct { - COMMAND uint16 ///< Command ID, as defined by MAV_CMD enum. - RESULT uint8 ///< See MAV_RESULT enum + COMMAND uint16 // Command ID, as defined by MAV_CMD enum. + RESULT uint8 // See MAV_RESULT enum } -func NewCommandAck(COMMAND uint16, RESULT uint8) MAVLinkMessage { +// NewCommandAck returns a new CommandAck +func NewCommandAck(COMMAND uint16, RESULT uint8) *CommandAck { m := CommandAck{} m.COMMAND = COMMAND m.RESULT = RESULT return &m } +// Id returns the CommandAck Message ID func (*CommandAck) Id() uint8 { return 77 } +// Len returns the CommandAck Message Length func (*CommandAck) Len() uint8 { return 3 } +// Crc returns the CommandAck Message CRC func (*CommandAck) Crc() uint8 { return 143 } +// Pack returns a packed byte array which represents a CommandAck payload func (m *CommandAck) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.COMMAND) @@ -4160,27 +4994,35 @@ func (m *CommandAck) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the CommandAck func (m *CommandAck) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.COMMAND) binary.Read(data, binary.LittleEndian, &m.RESULT) } +const () + +// // MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT - +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT 80 +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN 20 +// // MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_CRC 127 - +// +// type RollPitchYawRatesThrustSetpoint struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot - ROLL_RATE float32 ///< Desired roll rate in radians per second - PITCH_RATE float32 ///< Desired pitch rate in radians per second - YAW_RATE float32 ///< Desired yaw rate in radians per second - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot + ROLL_RATE float32 // Desired roll rate in radians per second + PITCH_RATE float32 // Desired pitch rate in radians per second + YAW_RATE float32 // Desired yaw rate in radians per second + THRUST float32 // Collective thrust, normalized to 0 .. 1 } -func NewRollPitchYawRatesThrustSetpoint(TIME_BOOT_MS uint32, ROLL_RATE float32, PITCH_RATE float32, YAW_RATE float32, THRUST float32) MAVLinkMessage { +// NewRollPitchYawRatesThrustSetpoint returns a new RollPitchYawRatesThrustSetpoint +func NewRollPitchYawRatesThrustSetpoint(TIME_BOOT_MS uint32, ROLL_RATE float32, PITCH_RATE float32, YAW_RATE float32, THRUST float32) *RollPitchYawRatesThrustSetpoint { m := RollPitchYawRatesThrustSetpoint{} m.TIME_BOOT_MS = TIME_BOOT_MS m.ROLL_RATE = ROLL_RATE @@ -4190,18 +5032,22 @@ func NewRollPitchYawRatesThrustSetpoint(TIME_BOOT_MS uint32, ROLL_RATE float32, return &m } +// Id returns the RollPitchYawRatesThrustSetpoint Message ID func (*RollPitchYawRatesThrustSetpoint) Id() uint8 { return 80 } +// Len returns the RollPitchYawRatesThrustSetpoint Message Length func (*RollPitchYawRatesThrustSetpoint) Len() uint8 { return 20 } +// Crc returns the RollPitchYawRatesThrustSetpoint Message CRC func (*RollPitchYawRatesThrustSetpoint) Crc() uint8 { return 127 } +// Pack returns a packed byte array which represents a RollPitchYawRatesThrustSetpoint payload func (m *RollPitchYawRatesThrustSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -4212,6 +5058,7 @@ func (m *RollPitchYawRatesThrustSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RollPitchYawRatesThrustSetpoint func (m *RollPitchYawRatesThrustSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -4221,23 +5068,30 @@ func (m *RollPitchYawRatesThrustSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.THRUST) } +const () + +// // MESSAGE MANUAL_SETPOINT - +// // MAVLINK_MSG_ID_MANUAL_SETPOINT 81 +// // MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22 +// // MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC 106 - +// +// type ManualSetpoint struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot - ROLL float32 ///< Desired roll rate in radians per second - PITCH float32 ///< Desired pitch rate in radians per second - YAW float32 ///< Desired yaw rate in radians per second - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 - MODE_SWITCH uint8 ///< Flight mode switch position, 0.. 255 - MANUAL_OVERRIDE_SWITCH uint8 ///< Override mode switch position, 0.. 255 + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot + ROLL float32 // Desired roll rate in radians per second + PITCH float32 // Desired pitch rate in radians per second + YAW float32 // Desired yaw rate in radians per second + THRUST float32 // Collective thrust, normalized to 0 .. 1 + MODE_SWITCH uint8 // Flight mode switch position, 0.. 255 + MANUAL_OVERRIDE_SWITCH uint8 // Override mode switch position, 0.. 255 } -func NewManualSetpoint(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, THRUST float32, MODE_SWITCH uint8, MANUAL_OVERRIDE_SWITCH uint8) MAVLinkMessage { +// NewManualSetpoint returns a new ManualSetpoint +func NewManualSetpoint(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW float32, THRUST float32, MODE_SWITCH uint8, MANUAL_OVERRIDE_SWITCH uint8) *ManualSetpoint { m := ManualSetpoint{} m.TIME_BOOT_MS = TIME_BOOT_MS m.ROLL = ROLL @@ -4249,18 +5103,22 @@ func NewManualSetpoint(TIME_BOOT_MS uint32, ROLL float32, PITCH float32, YAW flo return &m } +// Id returns the ManualSetpoint Message ID func (*ManualSetpoint) Id() uint8 { return 81 } +// Len returns the ManualSetpoint Message Length func (*ManualSetpoint) Len() uint8 { return 22 } +// Crc returns the ManualSetpoint Message CRC func (*ManualSetpoint) Crc() uint8 { return 106 } +// Pack returns a packed byte array which represents a ManualSetpoint payload func (m *ManualSetpoint) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -4273,6 +5131,7 @@ func (m *ManualSetpoint) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ManualSetpoint func (m *ManualSetpoint) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -4284,25 +5143,32 @@ func (m *ManualSetpoint) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.MANUAL_OVERRIDE_SWITCH) } +const () + +// // MESSAGE ATTITUDE_SETPOINT_EXTERNAL - +// // MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL 82 +// // MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_LEN 39 +// // MAVLINK_MSG_ID_ATTITUDE_SETPOINT_EXTERNAL_CRC 147 - +// +// type AttitudeSetpointExternal struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot - Q [4]float32 ///< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - BODY_ROLL_RATE float32 ///< Body roll rate in radians per second - BODY_PITCH_RATE float32 ///< Body roll rate in radians per second - BODY_YAW_RATE float32 ///< Body roll rate in radians per second - THRUST float32 ///< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - TYPE_MASK uint8 ///< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot + Q [4]float32 // Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + BODY_ROLL_RATE float32 // Body roll rate in radians per second + BODY_PITCH_RATE float32 // Body roll rate in radians per second + BODY_YAW_RATE float32 // Body roll rate in radians per second + THRUST float32 // Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + TYPE_MASK uint8 // Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude } -func NewAttitudeSetpointExternal(TIME_BOOT_MS uint32, Q [4]float32, BODY_ROLL_RATE float32, BODY_PITCH_RATE float32, BODY_YAW_RATE float32, THRUST float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, TYPE_MASK uint8) MAVLinkMessage { +// NewAttitudeSetpointExternal returns a new AttitudeSetpointExternal +func NewAttitudeSetpointExternal(TIME_BOOT_MS uint32, Q [4]float32, BODY_ROLL_RATE float32, BODY_PITCH_RATE float32, BODY_YAW_RATE float32, THRUST float32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, TYPE_MASK uint8) *AttitudeSetpointExternal { m := AttitudeSetpointExternal{} m.TIME_BOOT_MS = TIME_BOOT_MS m.Q = Q @@ -4316,18 +5182,22 @@ func NewAttitudeSetpointExternal(TIME_BOOT_MS uint32, Q [4]float32, BODY_ROLL_RA return &m } +// Id returns the AttitudeSetpointExternal Message ID func (*AttitudeSetpointExternal) Id() uint8 { return 82 } +// Len returns the AttitudeSetpointExternal Message Length func (*AttitudeSetpointExternal) Len() uint8 { return 39 } +// Crc returns the AttitudeSetpointExternal Message CRC func (*AttitudeSetpointExternal) Crc() uint8 { return 147 } +// Pack returns a packed byte array which represents a AttitudeSetpointExternal payload func (m *AttitudeSetpointExternal) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -4342,6 +5212,7 @@ func (m *AttitudeSetpointExternal) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the AttitudeSetpointExternal func (m *AttitudeSetpointExternal) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -4355,32 +5226,39 @@ func (m *AttitudeSetpointExternal) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TYPE_MASK) } -const MAVLINK_MSG_ATTITUDE_SETPOINT_EXTERNAL_FIELD_q_LEN = 4 +const ( + MAVLINK_MSG_ATTITUDE_SETPOINT_EXTERNAL_FIELD_q_LEN = 4 +) +// // MESSAGE LOCAL_NED_POSITION_SETPOINT_EXTERNAL - +// // MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL 83 +// // MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_LEN 45 +// // MAVLINK_MSG_ID_LOCAL_NED_POSITION_SETPOINT_EXTERNAL_CRC 211 - +// +// type LocalNedPositionSetpointExternal struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot - X float32 ///< X Position in NED frame in meters - Y float32 ///< Y Position in NED frame in meters - Z float32 ///< Z Position in NED frame in meters (note, altitude is negative in NED) - VX float32 ///< X velocity in NED frame in meter / s - VY float32 ///< Y velocity in NED frame in meter / s - VZ float32 ///< Z velocity in NED frame in meter / s - AFX float32 ///< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - AFY float32 ///< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - AFZ float32 ///< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - TYPE_MASK uint16 ///< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - COORDINATE_FRAME uint8 ///< Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7 + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot + X float32 // X Position in NED frame in meters + Y float32 // Y Position in NED frame in meters + Z float32 // Z Position in NED frame in meters (note, altitude is negative in NED) + VX float32 // X velocity in NED frame in meter / s + VY float32 // Y velocity in NED frame in meter / s + VZ float32 // Z velocity in NED frame in meter / s + AFX float32 // X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + AFY float32 // Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + AFZ float32 // Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + TYPE_MASK uint16 // Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + COORDINATE_FRAME uint8 // Valid options are: MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_OFFSET_NED = 5, MAV_FRAME_BODY_NED = 6, MAV_FRAME_BODY_OFFSET_NED = 7 } -func NewLocalNedPositionSetpointExternal(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, VX float32, VY float32, VZ float32, AFX float32, AFY float32, AFZ float32, TYPE_MASK uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, COORDINATE_FRAME uint8) MAVLinkMessage { +// NewLocalNedPositionSetpointExternal returns a new LocalNedPositionSetpointExternal +func NewLocalNedPositionSetpointExternal(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, VX float32, VY float32, VZ float32, AFX float32, AFY float32, AFZ float32, TYPE_MASK uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, COORDINATE_FRAME uint8) *LocalNedPositionSetpointExternal { m := LocalNedPositionSetpointExternal{} m.TIME_BOOT_MS = TIME_BOOT_MS m.X = X @@ -4399,18 +5277,22 @@ func NewLocalNedPositionSetpointExternal(TIME_BOOT_MS uint32, X float32, Y float return &m } +// Id returns the LocalNedPositionSetpointExternal Message ID func (*LocalNedPositionSetpointExternal) Id() uint8 { return 83 } +// Len returns the LocalNedPositionSetpointExternal Message Length func (*LocalNedPositionSetpointExternal) Len() uint8 { return 45 } +// Crc returns the LocalNedPositionSetpointExternal Message CRC func (*LocalNedPositionSetpointExternal) Crc() uint8 { return 211 } +// Pack returns a packed byte array which represents a LocalNedPositionSetpointExternal payload func (m *LocalNedPositionSetpointExternal) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -4430,6 +5312,7 @@ func (m *LocalNedPositionSetpointExternal) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LocalNedPositionSetpointExternal func (m *LocalNedPositionSetpointExternal) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -4448,29 +5331,36 @@ func (m *LocalNedPositionSetpointExternal) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.COORDINATE_FRAME) } +const () + +// // MESSAGE GLOBAL_POSITION_SETPOINT_EXTERNAL_INT - +// // MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT 84 +// // MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_LEN 44 +// // MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_EXTERNAL_INT_CRC 198 - +// +// type GlobalPositionSetpointExternalInt struct { - TIME_BOOT_MS uint32 ///< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - LAT_INT int32 ///< X Position in WGS84 frame in 1e7 * meters - LON_INT int32 ///< Y Position in WGS84 frame in 1e7 * meters - ALT float32 ///< Altitude in WGS84, not AMSL - VX float32 ///< X velocity in NED frame in meter / s - VY float32 ///< Y velocity in NED frame in meter / s - VZ float32 ///< Z velocity in NED frame in meter / s - AFX float32 ///< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - AFY float32 ///< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - AFZ float32 ///< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - TYPE_MASK uint16 ///< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + TIME_BOOT_MS uint32 // Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + LAT_INT int32 // X Position in WGS84 frame in 1e7 * meters + LON_INT int32 // Y Position in WGS84 frame in 1e7 * meters + ALT float32 // Altitude in WGS84, not AMSL + VX float32 // X velocity in NED frame in meter / s + VY float32 // Y velocity in NED frame in meter / s + VZ float32 // Z velocity in NED frame in meter / s + AFX float32 // X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + AFY float32 // Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + AFZ float32 // Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + TYPE_MASK uint16 // Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewGlobalPositionSetpointExternalInt(TIME_BOOT_MS uint32, LAT_INT int32, LON_INT int32, ALT float32, VX float32, VY float32, VZ float32, AFX float32, AFY float32, AFZ float32, TYPE_MASK uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewGlobalPositionSetpointExternalInt returns a new GlobalPositionSetpointExternalInt +func NewGlobalPositionSetpointExternalInt(TIME_BOOT_MS uint32, LAT_INT int32, LON_INT int32, ALT float32, VX float32, VY float32, VZ float32, AFX float32, AFY float32, AFZ float32, TYPE_MASK uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *GlobalPositionSetpointExternalInt { m := GlobalPositionSetpointExternalInt{} m.TIME_BOOT_MS = TIME_BOOT_MS m.LAT_INT = LAT_INT @@ -4488,18 +5378,22 @@ func NewGlobalPositionSetpointExternalInt(TIME_BOOT_MS uint32, LAT_INT int32, LO return &m } +// Id returns the GlobalPositionSetpointExternalInt Message ID func (*GlobalPositionSetpointExternalInt) Id() uint8 { return 84 } +// Len returns the GlobalPositionSetpointExternalInt Message Length func (*GlobalPositionSetpointExternalInt) Len() uint8 { return 44 } +// Crc returns the GlobalPositionSetpointExternalInt Message CRC func (*GlobalPositionSetpointExternalInt) Crc() uint8 { return 198 } +// Pack returns a packed byte array which represents a GlobalPositionSetpointExternalInt payload func (m *GlobalPositionSetpointExternalInt) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -4518,6 +5412,7 @@ func (m *GlobalPositionSetpointExternalInt) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GlobalPositionSetpointExternalInt func (m *GlobalPositionSetpointExternalInt) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -4535,23 +5430,30 @@ func (m *GlobalPositionSetpointExternalInt) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET - +// // MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89 +// // MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28 +// // MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC 231 - +// +// type LocalPositionNedSystemGlobalOffset struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - X float32 ///< X Position - Y float32 ///< Y Position - Z float32 ///< Z Position - ROLL float32 ///< Roll - PITCH float32 ///< Pitch - YAW float32 ///< Yaw + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + X float32 // X Position + Y float32 // Y Position + Z float32 // Z Position + ROLL float32 // Roll + PITCH float32 // Pitch + YAW float32 // Yaw } -func NewLocalPositionNedSystemGlobalOffset(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) MAVLinkMessage { +// NewLocalPositionNedSystemGlobalOffset returns a new LocalPositionNedSystemGlobalOffset +func NewLocalPositionNedSystemGlobalOffset(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) *LocalPositionNedSystemGlobalOffset { m := LocalPositionNedSystemGlobalOffset{} m.TIME_BOOT_MS = TIME_BOOT_MS m.X = X @@ -4563,18 +5465,22 @@ func NewLocalPositionNedSystemGlobalOffset(TIME_BOOT_MS uint32, X float32, Y flo return &m } +// Id returns the LocalPositionNedSystemGlobalOffset Message ID func (*LocalPositionNedSystemGlobalOffset) Id() uint8 { return 89 } +// Len returns the LocalPositionNedSystemGlobalOffset Message Length func (*LocalPositionNedSystemGlobalOffset) Len() uint8 { return 28 } +// Crc returns the LocalPositionNedSystemGlobalOffset Message CRC func (*LocalPositionNedSystemGlobalOffset) Crc() uint8 { return 231 } +// Pack returns a packed byte array which represents a LocalPositionNedSystemGlobalOffset payload func (m *LocalPositionNedSystemGlobalOffset) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -4587,6 +5493,7 @@ func (m *LocalPositionNedSystemGlobalOffset) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LocalPositionNedSystemGlobalOffset func (m *LocalPositionNedSystemGlobalOffset) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -4598,32 +5505,39 @@ func (m *LocalPositionNedSystemGlobalOffset) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.YAW) } +const () + +// // MESSAGE HIL_STATE - +// // MAVLINK_MSG_ID_HIL_STATE 90 +// // MAVLINK_MSG_ID_HIL_STATE_LEN 56 +// // MAVLINK_MSG_ID_HIL_STATE_CRC 183 - +// +// type HilState struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - ROLL float32 ///< Roll angle (rad) - PITCH float32 ///< Pitch angle (rad) - YAW float32 ///< Yaw angle (rad) - ROLLSPEED float32 ///< Body frame roll / phi angular speed (rad/s) - PITCHSPEED float32 ///< Body frame pitch / theta angular speed (rad/s) - YAWSPEED float32 ///< Body frame yaw / psi angular speed (rad/s) - LAT int32 ///< Latitude, expressed as * 1E7 - LON int32 ///< Longitude, expressed as * 1E7 - ALT int32 ///< Altitude in meters, expressed as * 1000 (millimeters) - VX int16 ///< Ground X Speed (Latitude), expressed as m/s * 100 - VY int16 ///< Ground Y Speed (Longitude), expressed as m/s * 100 - VZ int16 ///< Ground Z Speed (Altitude), expressed as m/s * 100 - XACC int16 ///< X acceleration (mg) - YACC int16 ///< Y acceleration (mg) - ZACC int16 ///< Z acceleration (mg) + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + ROLL float32 // Roll angle (rad) + PITCH float32 // Pitch angle (rad) + YAW float32 // Yaw angle (rad) + ROLLSPEED float32 // Body frame roll / phi angular speed (rad/s) + PITCHSPEED float32 // Body frame pitch / theta angular speed (rad/s) + YAWSPEED float32 // Body frame yaw / psi angular speed (rad/s) + LAT int32 // Latitude, expressed as * 1E7 + LON int32 // Longitude, expressed as * 1E7 + ALT int32 // Altitude in meters, expressed as * 1000 (millimeters) + VX int16 // Ground X Speed (Latitude), expressed as m/s * 100 + VY int16 // Ground Y Speed (Longitude), expressed as m/s * 100 + VZ int16 // Ground Z Speed (Altitude), expressed as m/s * 100 + XACC int16 // X acceleration (mg) + YACC int16 // Y acceleration (mg) + ZACC int16 // Z acceleration (mg) } -func NewHilState(TIME_USEC uint64, ROLL float32, PITCH float32, YAW float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32, LAT int32, LON int32, ALT int32, VX int16, VY int16, VZ int16, XACC int16, YACC int16, ZACC int16) MAVLinkMessage { +// NewHilState returns a new HilState +func NewHilState(TIME_USEC uint64, ROLL float32, PITCH float32, YAW float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32, LAT int32, LON int32, ALT int32, VX int16, VY int16, VZ int16, XACC int16, YACC int16, ZACC int16) *HilState { m := HilState{} m.TIME_USEC = TIME_USEC m.ROLL = ROLL @@ -4644,18 +5558,22 @@ func NewHilState(TIME_USEC uint64, ROLL float32, PITCH float32, YAW float32, ROL return &m } +// Id returns the HilState Message ID func (*HilState) Id() uint8 { return 90 } +// Len returns the HilState Message Length func (*HilState) Len() uint8 { return 56 } +// Crc returns the HilState Message CRC func (*HilState) Crc() uint8 { return 183 } +// Pack returns a packed byte array which represents a HilState payload func (m *HilState) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -4677,6 +5595,7 @@ func (m *HilState) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilState func (m *HilState) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -4697,27 +5616,34 @@ func (m *HilState) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ZACC) } +const () + +// // MESSAGE HIL_CONTROLS - +// // MAVLINK_MSG_ID_HIL_CONTROLS 91 +// // MAVLINK_MSG_ID_HIL_CONTROLS_LEN 42 +// // MAVLINK_MSG_ID_HIL_CONTROLS_CRC 63 - +// +// type HilControls struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - ROLL_AILERONS float32 ///< Control output -1 .. 1 - PITCH_ELEVATOR float32 ///< Control output -1 .. 1 - YAW_RUDDER float32 ///< Control output -1 .. 1 - THROTTLE float32 ///< Throttle 0 .. 1 - AUX1 float32 ///< Aux 1, -1 .. 1 - AUX2 float32 ///< Aux 2, -1 .. 1 - AUX3 float32 ///< Aux 3, -1 .. 1 - AUX4 float32 ///< Aux 4, -1 .. 1 - MODE uint8 ///< System mode (MAV_MODE) - NAV_MODE uint8 ///< Navigation mode (MAV_NAV_MODE) + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + ROLL_AILERONS float32 // Control output -1 .. 1 + PITCH_ELEVATOR float32 // Control output -1 .. 1 + YAW_RUDDER float32 // Control output -1 .. 1 + THROTTLE float32 // Throttle 0 .. 1 + AUX1 float32 // Aux 1, -1 .. 1 + AUX2 float32 // Aux 2, -1 .. 1 + AUX3 float32 // Aux 3, -1 .. 1 + AUX4 float32 // Aux 4, -1 .. 1 + MODE uint8 // System mode (MAV_MODE) + NAV_MODE uint8 // Navigation mode (MAV_NAV_MODE) } -func NewHilControls(TIME_USEC uint64, ROLL_AILERONS float32, PITCH_ELEVATOR float32, YAW_RUDDER float32, THROTTLE float32, AUX1 float32, AUX2 float32, AUX3 float32, AUX4 float32, MODE uint8, NAV_MODE uint8) MAVLinkMessage { +// NewHilControls returns a new HilControls +func NewHilControls(TIME_USEC uint64, ROLL_AILERONS float32, PITCH_ELEVATOR float32, YAW_RUDDER float32, THROTTLE float32, AUX1 float32, AUX2 float32, AUX3 float32, AUX4 float32, MODE uint8, NAV_MODE uint8) *HilControls { m := HilControls{} m.TIME_USEC = TIME_USEC m.ROLL_AILERONS = ROLL_AILERONS @@ -4733,18 +5659,22 @@ func NewHilControls(TIME_USEC uint64, ROLL_AILERONS float32, PITCH_ELEVATOR floa return &m } +// Id returns the HilControls Message ID func (*HilControls) Id() uint8 { return 91 } +// Len returns the HilControls Message Length func (*HilControls) Len() uint8 { return 42 } +// Crc returns the HilControls Message CRC func (*HilControls) Crc() uint8 { return 63 } +// Pack returns a packed byte array which represents a HilControls payload func (m *HilControls) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -4761,6 +5691,7 @@ func (m *HilControls) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilControls func (m *HilControls) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -4776,30 +5707,37 @@ func (m *HilControls) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.NAV_MODE) } +const () + +// // MESSAGE HIL_RC_INPUTS_RAW - +// // MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92 +// // MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33 +// // MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54 - +// +// type HilRcInputsRaw struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - CHAN1_RAW uint16 ///< RC channel 1 value, in microseconds - CHAN2_RAW uint16 ///< RC channel 2 value, in microseconds - CHAN3_RAW uint16 ///< RC channel 3 value, in microseconds - CHAN4_RAW uint16 ///< RC channel 4 value, in microseconds - CHAN5_RAW uint16 ///< RC channel 5 value, in microseconds - CHAN6_RAW uint16 ///< RC channel 6 value, in microseconds - CHAN7_RAW uint16 ///< RC channel 7 value, in microseconds - CHAN8_RAW uint16 ///< RC channel 8 value, in microseconds - CHAN9_RAW uint16 ///< RC channel 9 value, in microseconds - CHAN10_RAW uint16 ///< RC channel 10 value, in microseconds - CHAN11_RAW uint16 ///< RC channel 11 value, in microseconds - CHAN12_RAW uint16 ///< RC channel 12 value, in microseconds - RSSI uint8 ///< Receive signal strength indicator, 0: 0%, 255: 100% + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + CHAN1_RAW uint16 // RC channel 1 value, in microseconds + CHAN2_RAW uint16 // RC channel 2 value, in microseconds + CHAN3_RAW uint16 // RC channel 3 value, in microseconds + CHAN4_RAW uint16 // RC channel 4 value, in microseconds + CHAN5_RAW uint16 // RC channel 5 value, in microseconds + CHAN6_RAW uint16 // RC channel 6 value, in microseconds + CHAN7_RAW uint16 // RC channel 7 value, in microseconds + CHAN8_RAW uint16 // RC channel 8 value, in microseconds + CHAN9_RAW uint16 // RC channel 9 value, in microseconds + CHAN10_RAW uint16 // RC channel 10 value, in microseconds + CHAN11_RAW uint16 // RC channel 11 value, in microseconds + CHAN12_RAW uint16 // RC channel 12 value, in microseconds + RSSI uint8 // Receive signal strength indicator, 0: 0%, 255: 100% } -func NewHilRcInputsRaw(TIME_USEC uint64, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, CHAN9_RAW uint16, CHAN10_RAW uint16, CHAN11_RAW uint16, CHAN12_RAW uint16, RSSI uint8) MAVLinkMessage { +// NewHilRcInputsRaw returns a new HilRcInputsRaw +func NewHilRcInputsRaw(TIME_USEC uint64, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, CHAN9_RAW uint16, CHAN10_RAW uint16, CHAN11_RAW uint16, CHAN12_RAW uint16, RSSI uint8) *HilRcInputsRaw { m := HilRcInputsRaw{} m.TIME_USEC = TIME_USEC m.CHAN1_RAW = CHAN1_RAW @@ -4818,18 +5756,22 @@ func NewHilRcInputsRaw(TIME_USEC uint64, CHAN1_RAW uint16, CHAN2_RAW uint16, CHA return &m } +// Id returns the HilRcInputsRaw Message ID func (*HilRcInputsRaw) Id() uint8 { return 92 } +// Len returns the HilRcInputsRaw Message Length func (*HilRcInputsRaw) Len() uint8 { return 33 } +// Crc returns the HilRcInputsRaw Message CRC func (*HilRcInputsRaw) Crc() uint8 { return 54 } +// Pack returns a packed byte array which represents a HilRcInputsRaw payload func (m *HilRcInputsRaw) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -4849,6 +5791,7 @@ func (m *HilRcInputsRaw) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilRcInputsRaw func (m *HilRcInputsRaw) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -4867,24 +5810,31 @@ func (m *HilRcInputsRaw) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.RSSI) } +const () + +// // MESSAGE OPTICAL_FLOW - +// // MAVLINK_MSG_ID_OPTICAL_FLOW 100 +// // MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26 +// // MAVLINK_MSG_ID_OPTICAL_FLOW_CRC 175 - +// +// type OpticalFlow struct { - TIME_USEC uint64 ///< Timestamp (UNIX) - FLOW_COMP_M_X float32 ///< Flow in meters in x-sensor direction, angular-speed compensated - FLOW_COMP_M_Y float32 ///< Flow in meters in y-sensor direction, angular-speed compensated - GROUND_DISTANCE float32 ///< Ground distance in meters. Positive value: distance known. Negative value: Unknown distance - FLOW_X int16 ///< Flow in pixels * 10 in x-sensor direction (dezi-pixels) - FLOW_Y int16 ///< Flow in pixels * 10 in y-sensor direction (dezi-pixels) - SENSOR_ID uint8 ///< Sensor ID - QUALITY uint8 ///< Optical flow quality / confidence. 0: bad, 255: maximum quality + TIME_USEC uint64 // Timestamp (UNIX) + FLOW_COMP_M_X float32 // Flow in meters in x-sensor direction, angular-speed compensated + FLOW_COMP_M_Y float32 // Flow in meters in y-sensor direction, angular-speed compensated + GROUND_DISTANCE float32 // Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + FLOW_X int16 // Flow in pixels * 10 in x-sensor direction (dezi-pixels) + FLOW_Y int16 // Flow in pixels * 10 in y-sensor direction (dezi-pixels) + SENSOR_ID uint8 // Sensor ID + QUALITY uint8 // Optical flow quality / confidence. 0: bad, 255: maximum quality } -func NewOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y float32, GROUND_DISTANCE float32, FLOW_X int16, FLOW_Y int16, SENSOR_ID uint8, QUALITY uint8) MAVLinkMessage { +// NewOpticalFlow returns a new OpticalFlow +func NewOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y float32, GROUND_DISTANCE float32, FLOW_X int16, FLOW_Y int16, SENSOR_ID uint8, QUALITY uint8) *OpticalFlow { m := OpticalFlow{} m.TIME_USEC = TIME_USEC m.FLOW_COMP_M_X = FLOW_COMP_M_X @@ -4897,18 +5847,22 @@ func NewOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y float return &m } +// Id returns the OpticalFlow Message ID func (*OpticalFlow) Id() uint8 { return 100 } +// Len returns the OpticalFlow Message Length func (*OpticalFlow) Len() uint8 { return 26 } +// Crc returns the OpticalFlow Message CRC func (*OpticalFlow) Crc() uint8 { return 175 } +// Pack returns a packed byte array which represents a OpticalFlow payload func (m *OpticalFlow) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -4922,6 +5876,7 @@ func (m *OpticalFlow) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the OpticalFlow func (m *OpticalFlow) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -4934,23 +5889,30 @@ func (m *OpticalFlow) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.QUALITY) } +const () + +// // MESSAGE GLOBAL_VISION_POSITION_ESTIMATE - +// // MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101 +// // MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32 +// // MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102 - +// +// type GlobalVisionPositionEstimate struct { - USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - X float32 ///< Global X position - Y float32 ///< Global Y position - Z float32 ///< Global Z position - ROLL float32 ///< Roll angle in rad - PITCH float32 ///< Pitch angle in rad - YAW float32 ///< Yaw angle in rad + USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + X float32 // Global X position + Y float32 // Global Y position + Z float32 // Global Z position + ROLL float32 // Roll angle in rad + PITCH float32 // Pitch angle in rad + YAW float32 // Yaw angle in rad } -func NewGlobalVisionPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) MAVLinkMessage { +// NewGlobalVisionPositionEstimate returns a new GlobalVisionPositionEstimate +func NewGlobalVisionPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) *GlobalVisionPositionEstimate { m := GlobalVisionPositionEstimate{} m.USEC = USEC m.X = X @@ -4962,18 +5924,22 @@ func NewGlobalVisionPositionEstimate(USEC uint64, X float32, Y float32, Z float3 return &m } +// Id returns the GlobalVisionPositionEstimate Message ID func (*GlobalVisionPositionEstimate) Id() uint8 { return 101 } +// Len returns the GlobalVisionPositionEstimate Message Length func (*GlobalVisionPositionEstimate) Len() uint8 { return 32 } +// Crc returns the GlobalVisionPositionEstimate Message CRC func (*GlobalVisionPositionEstimate) Crc() uint8 { return 102 } +// Pack returns a packed byte array which represents a GlobalVisionPositionEstimate payload func (m *GlobalVisionPositionEstimate) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.USEC) @@ -4986,6 +5952,7 @@ func (m *GlobalVisionPositionEstimate) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GlobalVisionPositionEstimate func (m *GlobalVisionPositionEstimate) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.USEC) @@ -4997,23 +5964,30 @@ func (m *GlobalVisionPositionEstimate) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.YAW) } +const () + +// // MESSAGE VISION_POSITION_ESTIMATE - +// // MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 102 +// // MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32 +// // MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC 158 - +// +// type VisionPositionEstimate struct { - USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - X float32 ///< Global X position - Y float32 ///< Global Y position - Z float32 ///< Global Z position - ROLL float32 ///< Roll angle in rad - PITCH float32 ///< Pitch angle in rad - YAW float32 ///< Yaw angle in rad + USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + X float32 // Global X position + Y float32 // Global Y position + Z float32 // Global Z position + ROLL float32 // Roll angle in rad + PITCH float32 // Pitch angle in rad + YAW float32 // Yaw angle in rad } -func NewVisionPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) MAVLinkMessage { +// NewVisionPositionEstimate returns a new VisionPositionEstimate +func NewVisionPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) *VisionPositionEstimate { m := VisionPositionEstimate{} m.USEC = USEC m.X = X @@ -5025,18 +5999,22 @@ func NewVisionPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROL return &m } +// Id returns the VisionPositionEstimate Message ID func (*VisionPositionEstimate) Id() uint8 { return 102 } +// Len returns the VisionPositionEstimate Message Length func (*VisionPositionEstimate) Len() uint8 { return 32 } +// Crc returns the VisionPositionEstimate Message CRC func (*VisionPositionEstimate) Crc() uint8 { return 158 } +// Pack returns a packed byte array which represents a VisionPositionEstimate payload func (m *VisionPositionEstimate) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.USEC) @@ -5049,6 +6027,7 @@ func (m *VisionPositionEstimate) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the VisionPositionEstimate func (m *VisionPositionEstimate) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.USEC) @@ -5060,20 +6039,27 @@ func (m *VisionPositionEstimate) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.YAW) } +const () + +// // MESSAGE VISION_SPEED_ESTIMATE - +// // MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103 +// // MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20 +// // MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 208 - +// +// type VisionSpeedEstimate struct { - USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - X float32 ///< Global X speed - Y float32 ///< Global Y speed - Z float32 ///< Global Z speed + USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + X float32 // Global X speed + Y float32 // Global Y speed + Z float32 // Global Z speed } -func NewVisionSpeedEstimate(USEC uint64, X float32, Y float32, Z float32) MAVLinkMessage { +// NewVisionSpeedEstimate returns a new VisionSpeedEstimate +func NewVisionSpeedEstimate(USEC uint64, X float32, Y float32, Z float32) *VisionSpeedEstimate { m := VisionSpeedEstimate{} m.USEC = USEC m.X = X @@ -5082,18 +6068,22 @@ func NewVisionSpeedEstimate(USEC uint64, X float32, Y float32, Z float32) MAVLin return &m } +// Id returns the VisionSpeedEstimate Message ID func (*VisionSpeedEstimate) Id() uint8 { return 103 } +// Len returns the VisionSpeedEstimate Message Length func (*VisionSpeedEstimate) Len() uint8 { return 20 } +// Crc returns the VisionSpeedEstimate Message CRC func (*VisionSpeedEstimate) Crc() uint8 { return 208 } +// Pack returns a packed byte array which represents a VisionSpeedEstimate payload func (m *VisionSpeedEstimate) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.USEC) @@ -5103,6 +6093,7 @@ func (m *VisionSpeedEstimate) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the VisionSpeedEstimate func (m *VisionSpeedEstimate) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.USEC) @@ -5111,23 +6102,30 @@ func (m *VisionSpeedEstimate) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.Z) } +const () + +// // MESSAGE VICON_POSITION_ESTIMATE - +// // MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 104 +// // MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32 +// // MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC 56 - +// +// type ViconPositionEstimate struct { - USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - X float32 ///< Global X position - Y float32 ///< Global Y position - Z float32 ///< Global Z position - ROLL float32 ///< Roll angle in rad - PITCH float32 ///< Pitch angle in rad - YAW float32 ///< Yaw angle in rad + USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + X float32 // Global X position + Y float32 // Global Y position + Z float32 // Global Z position + ROLL float32 // Roll angle in rad + PITCH float32 // Pitch angle in rad + YAW float32 // Yaw angle in rad } -func NewViconPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) MAVLinkMessage { +// NewViconPositionEstimate returns a new ViconPositionEstimate +func NewViconPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) *ViconPositionEstimate { m := ViconPositionEstimate{} m.USEC = USEC m.X = X @@ -5139,18 +6137,22 @@ func NewViconPositionEstimate(USEC uint64, X float32, Y float32, Z float32, ROLL return &m } +// Id returns the ViconPositionEstimate Message ID func (*ViconPositionEstimate) Id() uint8 { return 104 } +// Len returns the ViconPositionEstimate Message Length func (*ViconPositionEstimate) Len() uint8 { return 32 } +// Crc returns the ViconPositionEstimate Message CRC func (*ViconPositionEstimate) Crc() uint8 { return 56 } +// Pack returns a packed byte array which represents a ViconPositionEstimate payload func (m *ViconPositionEstimate) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.USEC) @@ -5163,6 +6165,7 @@ func (m *ViconPositionEstimate) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ViconPositionEstimate func (m *ViconPositionEstimate) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.USEC) @@ -5174,31 +6177,38 @@ func (m *ViconPositionEstimate) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.YAW) } +const () + +// // MESSAGE HIGHRES_IMU - +// // MAVLINK_MSG_ID_HIGHRES_IMU 105 +// // MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62 +// // MAVLINK_MSG_ID_HIGHRES_IMU_CRC 93 - +// +// type HighresImu struct { - TIME_USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - XACC float32 ///< X acceleration (m/s^2) - YACC float32 ///< Y acceleration (m/s^2) - ZACC float32 ///< Z acceleration (m/s^2) - XGYRO float32 ///< Angular speed around X axis (rad / sec) - YGYRO float32 ///< Angular speed around Y axis (rad / sec) - ZGYRO float32 ///< Angular speed around Z axis (rad / sec) - XMAG float32 ///< X Magnetic field (Gauss) - YMAG float32 ///< Y Magnetic field (Gauss) - ZMAG float32 ///< Z Magnetic field (Gauss) - ABS_PRESSURE float32 ///< Absolute pressure in millibar - DIFF_PRESSURE float32 ///< Differential pressure in millibar - PRESSURE_ALT float32 ///< Altitude calculated from pressure - TEMPERATURE float32 ///< Temperature in degrees celsius - FIELDS_UPDATED uint16 ///< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + TIME_USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + XACC float32 // X acceleration (m/s^2) + YACC float32 // Y acceleration (m/s^2) + ZACC float32 // Z acceleration (m/s^2) + XGYRO float32 // Angular speed around X axis (rad / sec) + YGYRO float32 // Angular speed around Y axis (rad / sec) + ZGYRO float32 // Angular speed around Z axis (rad / sec) + XMAG float32 // X Magnetic field (Gauss) + YMAG float32 // Y Magnetic field (Gauss) + ZMAG float32 // Z Magnetic field (Gauss) + ABS_PRESSURE float32 // Absolute pressure in millibar + DIFF_PRESSURE float32 // Differential pressure in millibar + PRESSURE_ALT float32 // Altitude calculated from pressure + TEMPERATURE float32 // Temperature in degrees celsius + FIELDS_UPDATED uint16 // Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature } -func NewHighresImu(TIME_USEC uint64, XACC float32, YACC float32, ZACC float32, XGYRO float32, YGYRO float32, ZGYRO float32, XMAG float32, YMAG float32, ZMAG float32, ABS_PRESSURE float32, DIFF_PRESSURE float32, PRESSURE_ALT float32, TEMPERATURE float32, FIELDS_UPDATED uint16) MAVLinkMessage { +// NewHighresImu returns a new HighresImu +func NewHighresImu(TIME_USEC uint64, XACC float32, YACC float32, ZACC float32, XGYRO float32, YGYRO float32, ZGYRO float32, XMAG float32, YMAG float32, ZMAG float32, ABS_PRESSURE float32, DIFF_PRESSURE float32, PRESSURE_ALT float32, TEMPERATURE float32, FIELDS_UPDATED uint16) *HighresImu { m := HighresImu{} m.TIME_USEC = TIME_USEC m.XACC = XACC @@ -5218,18 +6228,22 @@ func NewHighresImu(TIME_USEC uint64, XACC float32, YACC float32, ZACC float32, X return &m } +// Id returns the HighresImu Message ID func (*HighresImu) Id() uint8 { return 105 } +// Len returns the HighresImu Message Length func (*HighresImu) Len() uint8 { return 62 } +// Crc returns the HighresImu Message CRC func (*HighresImu) Crc() uint8 { return 93 } +// Pack returns a packed byte array which represents a HighresImu payload func (m *HighresImu) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -5250,6 +6264,7 @@ func (m *HighresImu) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HighresImu func (m *HighresImu) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -5269,22 +6284,29 @@ func (m *HighresImu) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FIELDS_UPDATED) } +const () + +// // MESSAGE OMNIDIRECTIONAL_FLOW - +// // MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW 106 +// // MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN 54 +// // MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_CRC 211 - +// +// type OmnidirectionalFlow struct { - TIME_USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - FRONT_DISTANCE_M float32 ///< Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance - LEFT [10]int16 ///< Flow in deci pixels (1 = 0.1 pixel) on left hemisphere - RIGHT [10]int16 ///< Flow in deci pixels (1 = 0.1 pixel) on right hemisphere - SENSOR_ID uint8 ///< Sensor ID - QUALITY uint8 ///< Optical flow quality / confidence. 0: bad, 255: maximum quality + TIME_USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + FRONT_DISTANCE_M float32 // Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance + LEFT [10]int16 // Flow in deci pixels (1 = 0.1 pixel) on left hemisphere + RIGHT [10]int16 // Flow in deci pixels (1 = 0.1 pixel) on right hemisphere + SENSOR_ID uint8 // Sensor ID + QUALITY uint8 // Optical flow quality / confidence. 0: bad, 255: maximum quality } -func NewOmnidirectionalFlow(TIME_USEC uint64, FRONT_DISTANCE_M float32, LEFT [10]int16, RIGHT [10]int16, SENSOR_ID uint8, QUALITY uint8) MAVLinkMessage { +// NewOmnidirectionalFlow returns a new OmnidirectionalFlow +func NewOmnidirectionalFlow(TIME_USEC uint64, FRONT_DISTANCE_M float32, LEFT [10]int16, RIGHT [10]int16, SENSOR_ID uint8, QUALITY uint8) *OmnidirectionalFlow { m := OmnidirectionalFlow{} m.TIME_USEC = TIME_USEC m.FRONT_DISTANCE_M = FRONT_DISTANCE_M @@ -5295,18 +6317,22 @@ func NewOmnidirectionalFlow(TIME_USEC uint64, FRONT_DISTANCE_M float32, LEFT [10 return &m } +// Id returns the OmnidirectionalFlow Message ID func (*OmnidirectionalFlow) Id() uint8 { return 106 } +// Len returns the OmnidirectionalFlow Message Length func (*OmnidirectionalFlow) Len() uint8 { return 54 } +// Crc returns the OmnidirectionalFlow Message CRC func (*OmnidirectionalFlow) Crc() uint8 { return 211 } +// Pack returns a packed byte array which represents a OmnidirectionalFlow payload func (m *OmnidirectionalFlow) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -5318,6 +6344,7 @@ func (m *OmnidirectionalFlow) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the OmnidirectionalFlow func (m *OmnidirectionalFlow) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -5328,34 +6355,41 @@ func (m *OmnidirectionalFlow) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.QUALITY) } -const MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_left_LEN = 10 -const MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_right_LEN = 10 +const ( + MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_left_LEN = 10 + MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_right_LEN = 10 +) +// // MESSAGE HIL_SENSOR - +// // MAVLINK_MSG_ID_HIL_SENSOR 107 +// // MAVLINK_MSG_ID_HIL_SENSOR_LEN 64 +// // MAVLINK_MSG_ID_HIL_SENSOR_CRC 108 - +// +// type HilSensor struct { - TIME_USEC uint64 ///< Timestamp (microseconds, synced to UNIX time or since system boot) - XACC float32 ///< X acceleration (m/s^2) - YACC float32 ///< Y acceleration (m/s^2) - ZACC float32 ///< Z acceleration (m/s^2) - XGYRO float32 ///< Angular speed around X axis in body frame (rad / sec) - YGYRO float32 ///< Angular speed around Y axis in body frame (rad / sec) - ZGYRO float32 ///< Angular speed around Z axis in body frame (rad / sec) - XMAG float32 ///< X Magnetic field (Gauss) - YMAG float32 ///< Y Magnetic field (Gauss) - ZMAG float32 ///< Z Magnetic field (Gauss) - ABS_PRESSURE float32 ///< Absolute pressure in millibar - DIFF_PRESSURE float32 ///< Differential pressure (airspeed) in millibar - PRESSURE_ALT float32 ///< Altitude calculated from pressure - TEMPERATURE float32 ///< Temperature in degrees celsius - FIELDS_UPDATED uint32 ///< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + TIME_USEC uint64 // Timestamp (microseconds, synced to UNIX time or since system boot) + XACC float32 // X acceleration (m/s^2) + YACC float32 // Y acceleration (m/s^2) + ZACC float32 // Z acceleration (m/s^2) + XGYRO float32 // Angular speed around X axis in body frame (rad / sec) + YGYRO float32 // Angular speed around Y axis in body frame (rad / sec) + ZGYRO float32 // Angular speed around Z axis in body frame (rad / sec) + XMAG float32 // X Magnetic field (Gauss) + YMAG float32 // Y Magnetic field (Gauss) + ZMAG float32 // Z Magnetic field (Gauss) + ABS_PRESSURE float32 // Absolute pressure in millibar + DIFF_PRESSURE float32 // Differential pressure (airspeed) in millibar + PRESSURE_ALT float32 // Altitude calculated from pressure + TEMPERATURE float32 // Temperature in degrees celsius + FIELDS_UPDATED uint32 // Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature } -func NewHilSensor(TIME_USEC uint64, XACC float32, YACC float32, ZACC float32, XGYRO float32, YGYRO float32, ZGYRO float32, XMAG float32, YMAG float32, ZMAG float32, ABS_PRESSURE float32, DIFF_PRESSURE float32, PRESSURE_ALT float32, TEMPERATURE float32, FIELDS_UPDATED uint32) MAVLinkMessage { +// NewHilSensor returns a new HilSensor +func NewHilSensor(TIME_USEC uint64, XACC float32, YACC float32, ZACC float32, XGYRO float32, YGYRO float32, ZGYRO float32, XMAG float32, YMAG float32, ZMAG float32, ABS_PRESSURE float32, DIFF_PRESSURE float32, PRESSURE_ALT float32, TEMPERATURE float32, FIELDS_UPDATED uint32) *HilSensor { m := HilSensor{} m.TIME_USEC = TIME_USEC m.XACC = XACC @@ -5375,18 +6409,22 @@ func NewHilSensor(TIME_USEC uint64, XACC float32, YACC float32, ZACC float32, XG return &m } +// Id returns the HilSensor Message ID func (*HilSensor) Id() uint8 { return 107 } +// Len returns the HilSensor Message Length func (*HilSensor) Len() uint8 { return 64 } +// Crc returns the HilSensor Message CRC func (*HilSensor) Crc() uint8 { return 108 } +// Pack returns a packed byte array which represents a HilSensor payload func (m *HilSensor) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -5407,6 +6445,7 @@ func (m *HilSensor) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilSensor func (m *HilSensor) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -5426,37 +6465,44 @@ func (m *HilSensor) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FIELDS_UPDATED) } +const () + +// // MESSAGE SIM_STATE - +// // MAVLINK_MSG_ID_SIM_STATE 108 +// // MAVLINK_MSG_ID_SIM_STATE_LEN 84 +// // MAVLINK_MSG_ID_SIM_STATE_CRC 32 - +// +// type SimState struct { - Q1 float32 ///< True attitude quaternion component 1, w (1 in null-rotation) - Q2 float32 ///< True attitude quaternion component 2, x (0 in null-rotation) - Q3 float32 ///< True attitude quaternion component 3, y (0 in null-rotation) - Q4 float32 ///< True attitude quaternion component 4, z (0 in null-rotation) - ROLL float32 ///< Attitude roll expressed as Euler angles, not recommended except for human-readable outputs - PITCH float32 ///< Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs - YAW float32 ///< Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs - XACC float32 ///< X acceleration m/s/s - YACC float32 ///< Y acceleration m/s/s - ZACC float32 ///< Z acceleration m/s/s - XGYRO float32 ///< Angular speed around X axis rad/s - YGYRO float32 ///< Angular speed around Y axis rad/s - ZGYRO float32 ///< Angular speed around Z axis rad/s - LAT float32 ///< Latitude in degrees - LON float32 ///< Longitude in degrees - ALT float32 ///< Altitude in meters - STD_DEV_HORZ float32 ///< Horizontal position standard deviation - STD_DEV_VERT float32 ///< Vertical position standard deviation - VN float32 ///< True velocity in m/s in NORTH direction in earth-fixed NED frame - VE float32 ///< True velocity in m/s in EAST direction in earth-fixed NED frame - VD float32 ///< True velocity in m/s in DOWN direction in earth-fixed NED frame + Q1 float32 // True attitude quaternion component 1, w (1 in null-rotation) + Q2 float32 // True attitude quaternion component 2, x (0 in null-rotation) + Q3 float32 // True attitude quaternion component 3, y (0 in null-rotation) + Q4 float32 // True attitude quaternion component 4, z (0 in null-rotation) + ROLL float32 // Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + PITCH float32 // Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + YAW float32 // Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + XACC float32 // X acceleration m/s/s + YACC float32 // Y acceleration m/s/s + ZACC float32 // Z acceleration m/s/s + XGYRO float32 // Angular speed around X axis rad/s + YGYRO float32 // Angular speed around Y axis rad/s + ZGYRO float32 // Angular speed around Z axis rad/s + LAT float32 // Latitude in degrees + LON float32 // Longitude in degrees + ALT float32 // Altitude in meters + STD_DEV_HORZ float32 // Horizontal position standard deviation + STD_DEV_VERT float32 // Vertical position standard deviation + VN float32 // True velocity in m/s in NORTH direction in earth-fixed NED frame + VE float32 // True velocity in m/s in EAST direction in earth-fixed NED frame + VD float32 // True velocity in m/s in DOWN direction in earth-fixed NED frame } -func NewSimState(Q1 float32, Q2 float32, Q3 float32, Q4 float32, ROLL float32, PITCH float32, YAW float32, XACC float32, YACC float32, ZACC float32, XGYRO float32, YGYRO float32, ZGYRO float32, LAT float32, LON float32, ALT float32, STD_DEV_HORZ float32, STD_DEV_VERT float32, VN float32, VE float32, VD float32) MAVLinkMessage { +// NewSimState returns a new SimState +func NewSimState(Q1 float32, Q2 float32, Q3 float32, Q4 float32, ROLL float32, PITCH float32, YAW float32, XACC float32, YACC float32, ZACC float32, XGYRO float32, YGYRO float32, ZGYRO float32, LAT float32, LON float32, ALT float32, STD_DEV_HORZ float32, STD_DEV_VERT float32, VN float32, VE float32, VD float32) *SimState { m := SimState{} m.Q1 = Q1 m.Q2 = Q2 @@ -5482,18 +6528,22 @@ func NewSimState(Q1 float32, Q2 float32, Q3 float32, Q4 float32, ROLL float32, P return &m } +// Id returns the SimState Message ID func (*SimState) Id() uint8 { return 108 } +// Len returns the SimState Message Length func (*SimState) Len() uint8 { return 84 } +// Crc returns the SimState Message CRC func (*SimState) Crc() uint8 { return 32 } +// Pack returns a packed byte array which represents a SimState payload func (m *SimState) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.Q1) @@ -5520,6 +6570,7 @@ func (m *SimState) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SimState func (m *SimState) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.Q1) @@ -5545,23 +6596,30 @@ func (m *SimState) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.VD) } +const () + +// // MESSAGE RADIO_STATUS - +// // MAVLINK_MSG_ID_RADIO_STATUS 109 +// // MAVLINK_MSG_ID_RADIO_STATUS_LEN 9 +// // MAVLINK_MSG_ID_RADIO_STATUS_CRC 185 - +// +// type RadioStatus struct { - RXERRORS uint16 ///< receive errors - FIXED uint16 ///< count of error corrected packets - RSSI uint8 ///< local signal strength - REMRSSI uint8 ///< remote signal strength - TXBUF uint8 ///< how full the tx buffer is as a percentage - NOISE uint8 ///< background noise level - REMNOISE uint8 ///< remote background noise level + RXERRORS uint16 // receive errors + FIXED uint16 // count of error corrected packets + RSSI uint8 // local signal strength + REMRSSI uint8 // remote signal strength + TXBUF uint8 // how full the tx buffer is as a percentage + NOISE uint8 // background noise level + REMNOISE uint8 // remote background noise level } -func NewRadioStatus(RXERRORS uint16, FIXED uint16, RSSI uint8, REMRSSI uint8, TXBUF uint8, NOISE uint8, REMNOISE uint8) MAVLinkMessage { +// NewRadioStatus returns a new RadioStatus +func NewRadioStatus(RXERRORS uint16, FIXED uint16, RSSI uint8, REMRSSI uint8, TXBUF uint8, NOISE uint8, REMNOISE uint8) *RadioStatus { m := RadioStatus{} m.RXERRORS = RXERRORS m.FIXED = FIXED @@ -5573,18 +6631,22 @@ func NewRadioStatus(RXERRORS uint16, FIXED uint16, RSSI uint8, REMRSSI uint8, TX return &m } +// Id returns the RadioStatus Message ID func (*RadioStatus) Id() uint8 { return 109 } +// Len returns the RadioStatus Message Length func (*RadioStatus) Len() uint8 { return 9 } +// Crc returns the RadioStatus Message CRC func (*RadioStatus) Crc() uint8 { return 185 } +// Pack returns a packed byte array which represents a RadioStatus payload func (m *RadioStatus) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.RXERRORS) @@ -5597,6 +6659,7 @@ func (m *RadioStatus) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the RadioStatus func (m *RadioStatus) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.RXERRORS) @@ -5608,21 +6671,28 @@ func (m *RadioStatus) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.REMNOISE) } +const () + +// // MESSAGE FILE_TRANSFER_START - +// // MAVLINK_MSG_ID_FILE_TRANSFER_START 110 +// // MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN 254 +// // MAVLINK_MSG_ID_FILE_TRANSFER_START_CRC 235 - +// +// type FileTransferStart struct { - TRANSFER_UID uint64 ///< Unique transfer ID - FILE_SIZE uint32 ///< File size in bytes - DEST_PATH [240]uint8 ///< Destination path - DIRECTION uint8 ///< Transfer direction: 0: from requester, 1: to requester - FLAGS uint8 ///< RESERVED + TRANSFER_UID uint64 // Unique transfer ID + FILE_SIZE uint32 // File size in bytes + DEST_PATH [240]uint8 // Destination path + DIRECTION uint8 // Transfer direction: 0: from requester, 1: to requester + FLAGS uint8 // RESERVED } -func NewFileTransferStart(TRANSFER_UID uint64, FILE_SIZE uint32, DEST_PATH [240]uint8, DIRECTION uint8, FLAGS uint8) MAVLinkMessage { +// NewFileTransferStart returns a new FileTransferStart +func NewFileTransferStart(TRANSFER_UID uint64, FILE_SIZE uint32, DEST_PATH [240]uint8, DIRECTION uint8, FLAGS uint8) *FileTransferStart { m := FileTransferStart{} m.TRANSFER_UID = TRANSFER_UID m.FILE_SIZE = FILE_SIZE @@ -5632,18 +6702,22 @@ func NewFileTransferStart(TRANSFER_UID uint64, FILE_SIZE uint32, DEST_PATH [240] return &m } +// Id returns the FileTransferStart Message ID func (*FileTransferStart) Id() uint8 { return 110 } +// Len returns the FileTransferStart Message Length func (*FileTransferStart) Len() uint8 { return 254 } +// Crc returns the FileTransferStart Message CRC func (*FileTransferStart) Crc() uint8 { return 235 } +// Pack returns a packed byte array which represents a FileTransferStart payload func (m *FileTransferStart) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TRANSFER_UID) @@ -5654,6 +6728,7 @@ func (m *FileTransferStart) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the FileTransferStart func (m *FileTransferStart) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TRANSFER_UID) @@ -5663,21 +6738,28 @@ func (m *FileTransferStart) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FLAGS) } -const MAVLINK_MSG_FILE_TRANSFER_START_FIELD_dest_path_LEN = 240 +const ( + MAVLINK_MSG_FILE_TRANSFER_START_FIELD_dest_path_LEN = 240 +) +// // MESSAGE FILE_TRANSFER_DIR_LIST - +// // MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST 111 +// // MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN 249 +// // MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_CRC 93 - +// +// type FileTransferDirList struct { - TRANSFER_UID uint64 ///< Unique transfer ID - DIR_PATH [240]uint8 ///< Directory path to list - FLAGS uint8 ///< RESERVED + TRANSFER_UID uint64 // Unique transfer ID + DIR_PATH [240]uint8 // Directory path to list + FLAGS uint8 // RESERVED } -func NewFileTransferDirList(TRANSFER_UID uint64, DIR_PATH [240]uint8, FLAGS uint8) MAVLinkMessage { +// NewFileTransferDirList returns a new FileTransferDirList +func NewFileTransferDirList(TRANSFER_UID uint64, DIR_PATH [240]uint8, FLAGS uint8) *FileTransferDirList { m := FileTransferDirList{} m.TRANSFER_UID = TRANSFER_UID m.DIR_PATH = DIR_PATH @@ -5685,18 +6767,22 @@ func NewFileTransferDirList(TRANSFER_UID uint64, DIR_PATH [240]uint8, FLAGS uint return &m } +// Id returns the FileTransferDirList Message ID func (*FileTransferDirList) Id() uint8 { return 111 } +// Len returns the FileTransferDirList Message Length func (*FileTransferDirList) Len() uint8 { return 249 } +// Crc returns the FileTransferDirList Message CRC func (*FileTransferDirList) Crc() uint8 { return 93 } +// Pack returns a packed byte array which represents a FileTransferDirList payload func (m *FileTransferDirList) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TRANSFER_UID) @@ -5705,6 +6791,7 @@ func (m *FileTransferDirList) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the FileTransferDirList func (m *FileTransferDirList) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TRANSFER_UID) @@ -5712,38 +6799,49 @@ func (m *FileTransferDirList) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FLAGS) } -const MAVLINK_MSG_FILE_TRANSFER_DIR_LIST_FIELD_dir_path_LEN = 240 +const ( + MAVLINK_MSG_FILE_TRANSFER_DIR_LIST_FIELD_dir_path_LEN = 240 +) +// // MESSAGE FILE_TRANSFER_RES - +// // MAVLINK_MSG_ID_FILE_TRANSFER_RES 112 +// // MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN 9 +// // MAVLINK_MSG_ID_FILE_TRANSFER_RES_CRC 124 - +// +// type FileTransferRes struct { - TRANSFER_UID uint64 ///< Unique transfer ID - RESULT uint8 ///< 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device + TRANSFER_UID uint64 // Unique transfer ID + RESULT uint8 // 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device } -func NewFileTransferRes(TRANSFER_UID uint64, RESULT uint8) MAVLinkMessage { +// NewFileTransferRes returns a new FileTransferRes +func NewFileTransferRes(TRANSFER_UID uint64, RESULT uint8) *FileTransferRes { m := FileTransferRes{} m.TRANSFER_UID = TRANSFER_UID m.RESULT = RESULT return &m } +// Id returns the FileTransferRes Message ID func (*FileTransferRes) Id() uint8 { return 112 } +// Len returns the FileTransferRes Message Length func (*FileTransferRes) Len() uint8 { return 9 } +// Crc returns the FileTransferRes Message CRC func (*FileTransferRes) Crc() uint8 { return 124 } +// Pack returns a packed byte array which represents a FileTransferRes payload func (m *FileTransferRes) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TRANSFER_UID) @@ -5751,35 +6849,43 @@ func (m *FileTransferRes) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the FileTransferRes func (m *FileTransferRes) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TRANSFER_UID) binary.Read(data, binary.LittleEndian, &m.RESULT) } +const () + +// // MESSAGE HIL_GPS - +// // MAVLINK_MSG_ID_HIL_GPS 113 +// // MAVLINK_MSG_ID_HIL_GPS_LEN 36 +// // MAVLINK_MSG_ID_HIL_GPS_CRC 124 - +// +// type HilGps struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - LAT int32 ///< Latitude (WGS84), in degrees * 1E7 - LON int32 ///< Longitude (WGS84), in degrees * 1E7 - ALT int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) - EPH uint16 ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 - EPV uint16 ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 - VEL uint16 ///< GPS ground speed (m/s * 100). If unknown, set to: 65535 - VN int16 ///< GPS velocity in cm/s in NORTH direction in earth-fixed NED frame - VE int16 ///< GPS velocity in cm/s in EAST direction in earth-fixed NED frame - VD int16 ///< GPS velocity in cm/s in DOWN direction in earth-fixed NED frame - COG uint16 ///< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 - FIX_TYPE uint8 ///< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - SATELLITES_VISIBLE uint8 ///< Number of satellites visible. If unknown, set to 255 + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + LAT int32 // Latitude (WGS84), in degrees * 1E7 + LON int32 // Longitude (WGS84), in degrees * 1E7 + ALT int32 // Altitude (WGS84), in meters * 1000 (positive for up) + EPH uint16 // GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 + EPV uint16 // GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 + VEL uint16 // GPS ground speed (m/s * 100). If unknown, set to: 65535 + VN int16 // GPS velocity in cm/s in NORTH direction in earth-fixed NED frame + VE int16 // GPS velocity in cm/s in EAST direction in earth-fixed NED frame + VD int16 // GPS velocity in cm/s in DOWN direction in earth-fixed NED frame + COG uint16 // Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 + FIX_TYPE uint8 // 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + SATELLITES_VISIBLE uint8 // Number of satellites visible. If unknown, set to 255 } -func NewHilGps(TIME_USEC uint64, LAT int32, LON int32, ALT int32, EPH uint16, EPV uint16, VEL uint16, VN int16, VE int16, VD int16, COG uint16, FIX_TYPE uint8, SATELLITES_VISIBLE uint8) MAVLinkMessage { +// NewHilGps returns a new HilGps +func NewHilGps(TIME_USEC uint64, LAT int32, LON int32, ALT int32, EPH uint16, EPV uint16, VEL uint16, VN int16, VE int16, VD int16, COG uint16, FIX_TYPE uint8, SATELLITES_VISIBLE uint8) *HilGps { m := HilGps{} m.TIME_USEC = TIME_USEC m.LAT = LAT @@ -5797,18 +6903,22 @@ func NewHilGps(TIME_USEC uint64, LAT int32, LON int32, ALT int32, EPH uint16, EP return &m } +// Id returns the HilGps Message ID func (*HilGps) Id() uint8 { return 113 } +// Len returns the HilGps Message Length func (*HilGps) Len() uint8 { return 36 } +// Crc returns the HilGps Message CRC func (*HilGps) Crc() uint8 { return 124 } +// Pack returns a packed byte array which represents a HilGps payload func (m *HilGps) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -5827,6 +6937,7 @@ func (m *HilGps) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilGps func (m *HilGps) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -5844,24 +6955,31 @@ func (m *HilGps) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.SATELLITES_VISIBLE) } +const () + +// // MESSAGE HIL_OPTICAL_FLOW - +// // MAVLINK_MSG_ID_HIL_OPTICAL_FLOW 114 +// // MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN 26 +// // MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC 119 - +// +// type HilOpticalFlow struct { - TIME_USEC uint64 ///< Timestamp (UNIX) - FLOW_COMP_M_X float32 ///< Flow in meters in x-sensor direction, angular-speed compensated - FLOW_COMP_M_Y float32 ///< Flow in meters in y-sensor direction, angular-speed compensated - GROUND_DISTANCE float32 ///< Ground distance in meters. Positive value: distance known. Negative value: Unknown distance - FLOW_X int16 ///< Flow in pixels in x-sensor direction - FLOW_Y int16 ///< Flow in pixels in y-sensor direction - SENSOR_ID uint8 ///< Sensor ID - QUALITY uint8 ///< Optical flow quality / confidence. 0: bad, 255: maximum quality + TIME_USEC uint64 // Timestamp (UNIX) + FLOW_COMP_M_X float32 // Flow in meters in x-sensor direction, angular-speed compensated + FLOW_COMP_M_Y float32 // Flow in meters in y-sensor direction, angular-speed compensated + GROUND_DISTANCE float32 // Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + FLOW_X int16 // Flow in pixels in x-sensor direction + FLOW_Y int16 // Flow in pixels in y-sensor direction + SENSOR_ID uint8 // Sensor ID + QUALITY uint8 // Optical flow quality / confidence. 0: bad, 255: maximum quality } -func NewHilOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y float32, GROUND_DISTANCE float32, FLOW_X int16, FLOW_Y int16, SENSOR_ID uint8, QUALITY uint8) MAVLinkMessage { +// NewHilOpticalFlow returns a new HilOpticalFlow +func NewHilOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y float32, GROUND_DISTANCE float32, FLOW_X int16, FLOW_Y int16, SENSOR_ID uint8, QUALITY uint8) *HilOpticalFlow { m := HilOpticalFlow{} m.TIME_USEC = TIME_USEC m.FLOW_COMP_M_X = FLOW_COMP_M_X @@ -5874,18 +6992,22 @@ func NewHilOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y fl return &m } +// Id returns the HilOpticalFlow Message ID func (*HilOpticalFlow) Id() uint8 { return 114 } +// Len returns the HilOpticalFlow Message Length func (*HilOpticalFlow) Len() uint8 { return 26 } +// Crc returns the HilOpticalFlow Message CRC func (*HilOpticalFlow) Crc() uint8 { return 119 } +// Pack returns a packed byte array which represents a HilOpticalFlow payload func (m *HilOpticalFlow) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -5899,6 +7021,7 @@ func (m *HilOpticalFlow) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilOpticalFlow func (m *HilOpticalFlow) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -5911,32 +7034,39 @@ func (m *HilOpticalFlow) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.QUALITY) } +const () + +// // MESSAGE HIL_STATE_QUATERNION - +// // MAVLINK_MSG_ID_HIL_STATE_QUATERNION 115 +// // MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN 64 +// // MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC 4 - +// +// type HilStateQuaternion struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - ATTITUDE_QUATERNION [4]float32 ///< Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) - ROLLSPEED float32 ///< Body frame roll / phi angular speed (rad/s) - PITCHSPEED float32 ///< Body frame pitch / theta angular speed (rad/s) - YAWSPEED float32 ///< Body frame yaw / psi angular speed (rad/s) - LAT int32 ///< Latitude, expressed as * 1E7 - LON int32 ///< Longitude, expressed as * 1E7 - ALT int32 ///< Altitude in meters, expressed as * 1000 (millimeters) - VX int16 ///< Ground X Speed (Latitude), expressed as m/s * 100 - VY int16 ///< Ground Y Speed (Longitude), expressed as m/s * 100 - VZ int16 ///< Ground Z Speed (Altitude), expressed as m/s * 100 - IND_AIRSPEED uint16 ///< Indicated airspeed, expressed as m/s * 100 - TRUE_AIRSPEED uint16 ///< True airspeed, expressed as m/s * 100 - XACC int16 ///< X acceleration (mg) - YACC int16 ///< Y acceleration (mg) - ZACC int16 ///< Z acceleration (mg) + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + ATTITUDE_QUATERNION [4]float32 // Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + ROLLSPEED float32 // Body frame roll / phi angular speed (rad/s) + PITCHSPEED float32 // Body frame pitch / theta angular speed (rad/s) + YAWSPEED float32 // Body frame yaw / psi angular speed (rad/s) + LAT int32 // Latitude, expressed as * 1E7 + LON int32 // Longitude, expressed as * 1E7 + ALT int32 // Altitude in meters, expressed as * 1000 (millimeters) + VX int16 // Ground X Speed (Latitude), expressed as m/s * 100 + VY int16 // Ground Y Speed (Longitude), expressed as m/s * 100 + VZ int16 // Ground Z Speed (Altitude), expressed as m/s * 100 + IND_AIRSPEED uint16 // Indicated airspeed, expressed as m/s * 100 + TRUE_AIRSPEED uint16 // True airspeed, expressed as m/s * 100 + XACC int16 // X acceleration (mg) + YACC int16 // Y acceleration (mg) + ZACC int16 // Z acceleration (mg) } -func NewHilStateQuaternion(TIME_USEC uint64, ATTITUDE_QUATERNION [4]float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32, LAT int32, LON int32, ALT int32, VX int16, VY int16, VZ int16, IND_AIRSPEED uint16, TRUE_AIRSPEED uint16, XACC int16, YACC int16, ZACC int16) MAVLinkMessage { +// NewHilStateQuaternion returns a new HilStateQuaternion +func NewHilStateQuaternion(TIME_USEC uint64, ATTITUDE_QUATERNION [4]float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32, LAT int32, LON int32, ALT int32, VX int16, VY int16, VZ int16, IND_AIRSPEED uint16, TRUE_AIRSPEED uint16, XACC int16, YACC int16, ZACC int16) *HilStateQuaternion { m := HilStateQuaternion{} m.TIME_USEC = TIME_USEC m.ATTITUDE_QUATERNION = ATTITUDE_QUATERNION @@ -5957,18 +7087,22 @@ func NewHilStateQuaternion(TIME_USEC uint64, ATTITUDE_QUATERNION [4]float32, ROL return &m } +// Id returns the HilStateQuaternion Message ID func (*HilStateQuaternion) Id() uint8 { return 115 } +// Len returns the HilStateQuaternion Message Length func (*HilStateQuaternion) Len() uint8 { return 64 } +// Crc returns the HilStateQuaternion Message CRC func (*HilStateQuaternion) Crc() uint8 { return 4 } +// Pack returns a packed byte array which represents a HilStateQuaternion payload func (m *HilStateQuaternion) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -5990,6 +7124,7 @@ func (m *HilStateQuaternion) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the HilStateQuaternion func (m *HilStateQuaternion) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -6010,28 +7145,35 @@ func (m *HilStateQuaternion) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ZACC) } -const MAVLINK_MSG_HIL_STATE_QUATERNION_FIELD_attitude_quaternion_LEN = 4 +const ( + MAVLINK_MSG_HIL_STATE_QUATERNION_FIELD_attitude_quaternion_LEN = 4 +) +// // MESSAGE SCALED_IMU2 - +// // MAVLINK_MSG_ID_SCALED_IMU2 116 +// // MAVLINK_MSG_ID_SCALED_IMU2_LEN 22 +// // MAVLINK_MSG_ID_SCALED_IMU2_CRC 76 - +// +// type ScaledImu2 struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - XACC int16 ///< X acceleration (mg) - YACC int16 ///< Y acceleration (mg) - ZACC int16 ///< Z acceleration (mg) - XGYRO int16 ///< Angular speed around X axis (millirad /sec) - YGYRO int16 ///< Angular speed around Y axis (millirad /sec) - ZGYRO int16 ///< Angular speed around Z axis (millirad /sec) - XMAG int16 ///< X Magnetic field (milli tesla) - YMAG int16 ///< Y Magnetic field (milli tesla) - ZMAG int16 ///< Z Magnetic field (milli tesla) + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + XACC int16 // X acceleration (mg) + YACC int16 // Y acceleration (mg) + ZACC int16 // Z acceleration (mg) + XGYRO int16 // Angular speed around X axis (millirad /sec) + YGYRO int16 // Angular speed around Y axis (millirad /sec) + ZGYRO int16 // Angular speed around Z axis (millirad /sec) + XMAG int16 // X Magnetic field (milli tesla) + YMAG int16 // Y Magnetic field (milli tesla) + ZMAG int16 // Z Magnetic field (milli tesla) } -func NewScaledImu2(TIME_BOOT_MS uint32, XACC int16, YACC int16, ZACC int16, XGYRO int16, YGYRO int16, ZGYRO int16, XMAG int16, YMAG int16, ZMAG int16) MAVLinkMessage { +// NewScaledImu2 returns a new ScaledImu2 +func NewScaledImu2(TIME_BOOT_MS uint32, XACC int16, YACC int16, ZACC int16, XGYRO int16, YGYRO int16, ZGYRO int16, XMAG int16, YMAG int16, ZMAG int16) *ScaledImu2 { m := ScaledImu2{} m.TIME_BOOT_MS = TIME_BOOT_MS m.XACC = XACC @@ -6046,18 +7188,22 @@ func NewScaledImu2(TIME_BOOT_MS uint32, XACC int16, YACC int16, ZACC int16, XGYR return &m } +// Id returns the ScaledImu2 Message ID func (*ScaledImu2) Id() uint8 { return 116 } +// Len returns the ScaledImu2 Message Length func (*ScaledImu2) Len() uint8 { return 22 } +// Crc returns the ScaledImu2 Message CRC func (*ScaledImu2) Crc() uint8 { return 76 } +// Pack returns a packed byte array which represents a ScaledImu2 payload func (m *ScaledImu2) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -6073,6 +7219,7 @@ func (m *ScaledImu2) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the ScaledImu2 func (m *ScaledImu2) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -6087,20 +7234,27 @@ func (m *ScaledImu2) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.ZMAG) } +const () + +// // MESSAGE LOG_REQUEST_LIST - +// // MAVLINK_MSG_ID_LOG_REQUEST_LIST 117 +// // MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6 +// // MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC 128 - +// +// type LogRequestList struct { - START uint16 ///< First log id (0 for first available) - END uint16 ///< Last log id (0xffff for last available) - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + START uint16 // First log id (0 for first available) + END uint16 // Last log id (0xffff for last available) + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewLogRequestList(START uint16, END uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewLogRequestList returns a new LogRequestList +func NewLogRequestList(START uint16, END uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *LogRequestList { m := LogRequestList{} m.START = START m.END = END @@ -6109,18 +7263,22 @@ func NewLogRequestList(START uint16, END uint16, TARGET_SYSTEM uint8, TARGET_COM return &m } +// Id returns the LogRequestList Message ID func (*LogRequestList) Id() uint8 { return 117 } +// Len returns the LogRequestList Message Length func (*LogRequestList) Len() uint8 { return 6 } +// Crc returns the LogRequestList Message CRC func (*LogRequestList) Crc() uint8 { return 128 } +// Pack returns a packed byte array which represents a LogRequestList payload func (m *LogRequestList) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.START) @@ -6130,6 +7288,7 @@ func (m *LogRequestList) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LogRequestList func (m *LogRequestList) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.START) @@ -6138,21 +7297,28 @@ func (m *LogRequestList) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE LOG_ENTRY - +// // MAVLINK_MSG_ID_LOG_ENTRY 118 +// // MAVLINK_MSG_ID_LOG_ENTRY_LEN 14 +// // MAVLINK_MSG_ID_LOG_ENTRY_CRC 56 - +// +// type LogEntry struct { - TIME_UTC uint32 ///< UTC timestamp of log in seconds since 1970, or 0 if not available - SIZE uint32 ///< Size of the log (may be approximate) in bytes - ID uint16 ///< Log id - NUM_LOGS uint16 ///< Total number of logs - LAST_LOG_NUM uint16 ///< High log number + TIME_UTC uint32 // UTC timestamp of log in seconds since 1970, or 0 if not available + SIZE uint32 // Size of the log (may be approximate) in bytes + ID uint16 // Log id + NUM_LOGS uint16 // Total number of logs + LAST_LOG_NUM uint16 // High log number } -func NewLogEntry(TIME_UTC uint32, SIZE uint32, ID uint16, NUM_LOGS uint16, LAST_LOG_NUM uint16) MAVLinkMessage { +// NewLogEntry returns a new LogEntry +func NewLogEntry(TIME_UTC uint32, SIZE uint32, ID uint16, NUM_LOGS uint16, LAST_LOG_NUM uint16) *LogEntry { m := LogEntry{} m.TIME_UTC = TIME_UTC m.SIZE = SIZE @@ -6162,18 +7328,22 @@ func NewLogEntry(TIME_UTC uint32, SIZE uint32, ID uint16, NUM_LOGS uint16, LAST_ return &m } +// Id returns the LogEntry Message ID func (*LogEntry) Id() uint8 { return 118 } +// Len returns the LogEntry Message Length func (*LogEntry) Len() uint8 { return 14 } +// Crc returns the LogEntry Message CRC func (*LogEntry) Crc() uint8 { return 56 } +// Pack returns a packed byte array which represents a LogEntry payload func (m *LogEntry) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_UTC) @@ -6184,6 +7354,7 @@ func (m *LogEntry) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LogEntry func (m *LogEntry) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_UTC) @@ -6193,21 +7364,28 @@ func (m *LogEntry) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.LAST_LOG_NUM) } +const () + +// // MESSAGE LOG_REQUEST_DATA - +// // MAVLINK_MSG_ID_LOG_REQUEST_DATA 119 +// // MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN 12 +// // MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC 116 - +// +// type LogRequestData struct { - OFS uint32 ///< Offset into the log - COUNT uint32 ///< Number of bytes - ID uint16 ///< Log id (from LOG_ENTRY reply) - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + OFS uint32 // Offset into the log + COUNT uint32 // Number of bytes + ID uint16 // Log id (from LOG_ENTRY reply) + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewLogRequestData(OFS uint32, COUNT uint32, ID uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewLogRequestData returns a new LogRequestData +func NewLogRequestData(OFS uint32, COUNT uint32, ID uint16, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *LogRequestData { m := LogRequestData{} m.OFS = OFS m.COUNT = COUNT @@ -6217,18 +7395,22 @@ func NewLogRequestData(OFS uint32, COUNT uint32, ID uint16, TARGET_SYSTEM uint8, return &m } +// Id returns the LogRequestData Message ID func (*LogRequestData) Id() uint8 { return 119 } +// Len returns the LogRequestData Message Length func (*LogRequestData) Len() uint8 { return 12 } +// Crc returns the LogRequestData Message CRC func (*LogRequestData) Crc() uint8 { return 116 } +// Pack returns a packed byte array which represents a LogRequestData payload func (m *LogRequestData) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.OFS) @@ -6239,6 +7421,7 @@ func (m *LogRequestData) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LogRequestData func (m *LogRequestData) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.OFS) @@ -6248,20 +7431,27 @@ func (m *LogRequestData) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE LOG_DATA - +// // MAVLINK_MSG_ID_LOG_DATA 120 +// // MAVLINK_MSG_ID_LOG_DATA_LEN 97 +// // MAVLINK_MSG_ID_LOG_DATA_CRC 134 - +// +// type LogData struct { - OFS uint32 ///< Offset into the log - ID uint16 ///< Log id (from LOG_ENTRY reply) - COUNT uint8 ///< Number of bytes (zero for end of log) - DATA [90]uint8 ///< log data + OFS uint32 // Offset into the log + ID uint16 // Log id (from LOG_ENTRY reply) + COUNT uint8 // Number of bytes (zero for end of log) + DATA [90]uint8 // log data } -func NewLogData(OFS uint32, ID uint16, COUNT uint8, DATA [90]uint8) MAVLinkMessage { +// NewLogData returns a new LogData +func NewLogData(OFS uint32, ID uint16, COUNT uint8, DATA [90]uint8) *LogData { m := LogData{} m.OFS = OFS m.ID = ID @@ -6270,18 +7460,22 @@ func NewLogData(OFS uint32, ID uint16, COUNT uint8, DATA [90]uint8) MAVLinkMessa return &m } +// Id returns the LogData Message ID func (*LogData) Id() uint8 { return 120 } +// Len returns the LogData Message Length func (*LogData) Len() uint8 { return 97 } +// Crc returns the LogData Message CRC func (*LogData) Crc() uint8 { return 134 } +// Pack returns a packed byte array which represents a LogData payload func (m *LogData) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.OFS) @@ -6291,6 +7485,7 @@ func (m *LogData) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LogData func (m *LogData) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.OFS) @@ -6299,38 +7494,49 @@ func (m *LogData) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.DATA) } -const MAVLINK_MSG_LOG_DATA_FIELD_data_LEN = 90 +const ( + MAVLINK_MSG_LOG_DATA_FIELD_data_LEN = 90 +) +// // MESSAGE LOG_ERASE - +// // MAVLINK_MSG_ID_LOG_ERASE 121 +// // MAVLINK_MSG_ID_LOG_ERASE_LEN 2 +// // MAVLINK_MSG_ID_LOG_ERASE_CRC 237 - +// +// type LogErase struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewLogErase(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewLogErase returns a new LogErase +func NewLogErase(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *LogErase { m := LogErase{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT return &m } +// Id returns the LogErase Message ID func (*LogErase) Id() uint8 { return 121 } +// Len returns the LogErase Message Length func (*LogErase) Len() uint8 { return 2 } +// Crc returns the LogErase Message CRC func (*LogErase) Crc() uint8 { return 237 } +// Pack returns a packed byte array which represents a LogErase payload func (m *LogErase) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -6338,42 +7544,54 @@ func (m *LogErase) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LogErase func (m *LogErase) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE LOG_REQUEST_END - +// // MAVLINK_MSG_ID_LOG_REQUEST_END 122 +// // MAVLINK_MSG_ID_LOG_REQUEST_END_LEN 2 +// // MAVLINK_MSG_ID_LOG_REQUEST_END_CRC 203 - +// +// type LogRequestEnd struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID } -func NewLogRequestEnd(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) MAVLinkMessage { +// NewLogRequestEnd returns a new LogRequestEnd +func NewLogRequestEnd(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *LogRequestEnd { m := LogRequestEnd{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT return &m } +// Id returns the LogRequestEnd Message ID func (*LogRequestEnd) Id() uint8 { return 122 } +// Len returns the LogRequestEnd Message Length func (*LogRequestEnd) Len() uint8 { return 2 } +// Crc returns the LogRequestEnd Message CRC func (*LogRequestEnd) Crc() uint8 { return 203 } +// Pack returns a packed byte array which represents a LogRequestEnd payload func (m *LogRequestEnd) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -6381,26 +7599,34 @@ func (m *LogRequestEnd) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the LogRequestEnd func (m *LogRequestEnd) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT) } +const () + +// // MESSAGE GPS_INJECT_DATA - +// // MAVLINK_MSG_ID_GPS_INJECT_DATA 123 +// // MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN 113 +// // MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC 250 - +// +// type GpsInjectData struct { - TARGET_SYSTEM uint8 ///< System ID - TARGET_COMPONENT uint8 ///< Component ID - LEN uint8 ///< data length - DATA [110]uint8 ///< raw data (110 is enough for 12 satellites of RTCMv2) + TARGET_SYSTEM uint8 // System ID + TARGET_COMPONENT uint8 // Component ID + LEN uint8 // data length + DATA [110]uint8 // raw data (110 is enough for 12 satellites of RTCMv2) } -func NewGpsInjectData(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, LEN uint8, DATA [110]uint8) MAVLinkMessage { +// NewGpsInjectData returns a new GpsInjectData +func NewGpsInjectData(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, LEN uint8, DATA [110]uint8) *GpsInjectData { m := GpsInjectData{} m.TARGET_SYSTEM = TARGET_SYSTEM m.TARGET_COMPONENT = TARGET_COMPONENT @@ -6409,18 +7635,22 @@ func NewGpsInjectData(TARGET_SYSTEM uint8, TARGET_COMPONENT uint8, LEN uint8, DA return &m } +// Id returns the GpsInjectData Message ID func (*GpsInjectData) Id() uint8 { return 123 } +// Len returns the GpsInjectData Message Length func (*GpsInjectData) Len() uint8 { return 113 } +// Crc returns the GpsInjectData Message CRC func (*GpsInjectData) Crc() uint8 { return 250 } +// Pack returns a packed byte array which represents a GpsInjectData payload func (m *GpsInjectData) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM) @@ -6430,6 +7660,7 @@ func (m *GpsInjectData) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GpsInjectData func (m *GpsInjectData) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) @@ -6438,30 +7669,37 @@ func (m *GpsInjectData) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.DATA) } -const MAVLINK_MSG_GPS_INJECT_DATA_FIELD_data_LEN = 110 +const ( + MAVLINK_MSG_GPS_INJECT_DATA_FIELD_data_LEN = 110 +) +// // MESSAGE GPS2_RAW - +// // MAVLINK_MSG_ID_GPS2_RAW 124 +// // MAVLINK_MSG_ID_GPS2_RAW_LEN 35 +// // MAVLINK_MSG_ID_GPS2_RAW_CRC 87 - +// +// type Gps2Raw struct { - TIME_USEC uint64 ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - LAT int32 ///< Latitude (WGS84), in degrees * 1E7 - LON int32 ///< Longitude (WGS84), in degrees * 1E7 - ALT int32 ///< Altitude (WGS84), in meters * 1000 (positive for up) - DGPS_AGE uint32 ///< Age of DGPS info - EPH uint16 ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - EPV uint16 ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - VEL uint16 ///< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - COG uint16 ///< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - FIX_TYPE uint8 ///< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - SATELLITES_VISIBLE uint8 ///< Number of satellites visible. If unknown, set to 255 - DGPS_NUMCH uint8 ///< Number of DGPS satellites + TIME_USEC uint64 // Timestamp (microseconds since UNIX epoch or microseconds since system boot) + LAT int32 // Latitude (WGS84), in degrees * 1E7 + LON int32 // Longitude (WGS84), in degrees * 1E7 + ALT int32 // Altitude (WGS84), in meters * 1000 (positive for up) + DGPS_AGE uint32 // Age of DGPS info + EPH uint16 // GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + EPV uint16 // GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + VEL uint16 // GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + COG uint16 // Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + FIX_TYPE uint8 // 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + SATELLITES_VISIBLE uint8 // Number of satellites visible. If unknown, set to 255 + DGPS_NUMCH uint8 // Number of DGPS satellites } -func NewGps2Raw(TIME_USEC uint64, LAT int32, LON int32, ALT int32, DGPS_AGE uint32, EPH uint16, EPV uint16, VEL uint16, COG uint16, FIX_TYPE uint8, SATELLITES_VISIBLE uint8, DGPS_NUMCH uint8) MAVLinkMessage { +// NewGps2Raw returns a new Gps2Raw +func NewGps2Raw(TIME_USEC uint64, LAT int32, LON int32, ALT int32, DGPS_AGE uint32, EPH uint16, EPV uint16, VEL uint16, COG uint16, FIX_TYPE uint8, SATELLITES_VISIBLE uint8, DGPS_NUMCH uint8) *Gps2Raw { m := Gps2Raw{} m.TIME_USEC = TIME_USEC m.LAT = LAT @@ -6478,18 +7716,22 @@ func NewGps2Raw(TIME_USEC uint64, LAT int32, LON int32, ALT int32, DGPS_AGE uint return &m } +// Id returns the Gps2Raw Message ID func (*Gps2Raw) Id() uint8 { return 124 } +// Len returns the Gps2Raw Message Length func (*Gps2Raw) Len() uint8 { return 35 } +// Crc returns the Gps2Raw Message CRC func (*Gps2Raw) Crc() uint8 { return 87 } +// Pack returns a packed byte array which represents a Gps2Raw payload func (m *Gps2Raw) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -6507,6 +7749,7 @@ func (m *Gps2Raw) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Gps2Raw func (m *Gps2Raw) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -6523,19 +7766,26 @@ func (m *Gps2Raw) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.DGPS_NUMCH) } +const () + +// // MESSAGE POWER_STATUS - +// // MAVLINK_MSG_ID_POWER_STATUS 125 +// // MAVLINK_MSG_ID_POWER_STATUS_LEN 6 +// // MAVLINK_MSG_ID_POWER_STATUS_CRC 203 - +// +// type PowerStatus struct { - VCC uint16 ///< 5V rail voltage in millivolts - VSERVO uint16 ///< servo rail voltage in millivolts - FLAGS uint16 ///< power supply status flags (see MAV_POWER_STATUS enum) + VCC uint16 // 5V rail voltage in millivolts + VSERVO uint16 // servo rail voltage in millivolts + FLAGS uint16 // power supply status flags (see MAV_POWER_STATUS enum) } -func NewPowerStatus(VCC uint16, VSERVO uint16, FLAGS uint16) MAVLinkMessage { +// NewPowerStatus returns a new PowerStatus +func NewPowerStatus(VCC uint16, VSERVO uint16, FLAGS uint16) *PowerStatus { m := PowerStatus{} m.VCC = VCC m.VSERVO = VSERVO @@ -6543,18 +7793,22 @@ func NewPowerStatus(VCC uint16, VSERVO uint16, FLAGS uint16) MAVLinkMessage { return &m } +// Id returns the PowerStatus Message ID func (*PowerStatus) Id() uint8 { return 125 } +// Len returns the PowerStatus Message Length func (*PowerStatus) Len() uint8 { return 6 } +// Crc returns the PowerStatus Message CRC func (*PowerStatus) Crc() uint8 { return 203 } +// Pack returns a packed byte array which represents a PowerStatus payload func (m *PowerStatus) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.VCC) @@ -6563,6 +7817,7 @@ func (m *PowerStatus) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the PowerStatus func (m *PowerStatus) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.VCC) @@ -6570,22 +7825,29 @@ func (m *PowerStatus) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.FLAGS) } +const () + +// // MESSAGE SERIAL_CONTROL - +// // MAVLINK_MSG_ID_SERIAL_CONTROL 126 +// // MAVLINK_MSG_ID_SERIAL_CONTROL_LEN 79 +// // MAVLINK_MSG_ID_SERIAL_CONTROL_CRC 220 - +// +// type SerialControl struct { - BAUDRATE uint32 ///< Baudrate of transfer. Zero means no change. - TIMEOUT uint16 ///< Timeout for reply data in milliseconds - DEVICE uint8 ///< See SERIAL_CONTROL_DEV enum - FLAGS uint8 ///< See SERIAL_CONTROL_FLAG enum - COUNT uint8 ///< how many bytes in this transfer - DATA [70]uint8 ///< serial data + BAUDRATE uint32 // Baudrate of transfer. Zero means no change. + TIMEOUT uint16 // Timeout for reply data in milliseconds + DEVICE uint8 // See SERIAL_CONTROL_DEV enum + FLAGS uint8 // See SERIAL_CONTROL_FLAG enum + COUNT uint8 // how many bytes in this transfer + DATA [70]uint8 // serial data } -func NewSerialControl(BAUDRATE uint32, TIMEOUT uint16, DEVICE uint8, FLAGS uint8, COUNT uint8, DATA [70]uint8) MAVLinkMessage { +// NewSerialControl returns a new SerialControl +func NewSerialControl(BAUDRATE uint32, TIMEOUT uint16, DEVICE uint8, FLAGS uint8, COUNT uint8, DATA [70]uint8) *SerialControl { m := SerialControl{} m.BAUDRATE = BAUDRATE m.TIMEOUT = TIMEOUT @@ -6596,18 +7858,22 @@ func NewSerialControl(BAUDRATE uint32, TIMEOUT uint16, DEVICE uint8, FLAGS uint8 return &m } +// Id returns the SerialControl Message ID func (*SerialControl) Id() uint8 { return 126 } +// Len returns the SerialControl Message Length func (*SerialControl) Len() uint8 { return 79 } +// Crc returns the SerialControl Message CRC func (*SerialControl) Crc() uint8 { return 220 } +// Pack returns a packed byte array which represents a SerialControl payload func (m *SerialControl) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.BAUDRATE) @@ -6619,6 +7885,7 @@ func (m *SerialControl) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the SerialControl func (m *SerialControl) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.BAUDRATE) @@ -6629,31 +7896,38 @@ func (m *SerialControl) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.DATA) } -const MAVLINK_MSG_SERIAL_CONTROL_FIELD_data_LEN = 70 +const ( + MAVLINK_MSG_SERIAL_CONTROL_FIELD_data_LEN = 70 +) +// // MESSAGE GPS_RTK - +// // MAVLINK_MSG_ID_GPS_RTK 127 +// // MAVLINK_MSG_ID_GPS_RTK_LEN 35 +// // MAVLINK_MSG_ID_GPS_RTK_CRC 25 - +// +// type GpsRtk struct { - TIME_LAST_BASELINE_MS uint32 ///< Time since boot of last baseline message received in ms. - TOW uint32 ///< GPS Time of Week of last baseline - BASELINE_A_MM int32 ///< Current baseline in ECEF x or NED north component in mm. - BASELINE_B_MM int32 ///< Current baseline in ECEF y or NED east component in mm. - BASELINE_C_MM int32 ///< Current baseline in ECEF z or NED down component in mm. - ACCURACY uint32 ///< Current estimate of baseline accuracy. - IAR_NUM_HYPOTHESES int32 ///< Current number of integer ambiguity hypotheses. - WN uint16 ///< GPS Week Number of last baseline - RTK_RECEIVER_ID uint8 ///< Identification of connected RTK receiver. - RTK_HEALTH uint8 ///< GPS-specific health report for RTK data. - RTK_RATE uint8 ///< Rate of baseline messages being received by GPS, in HZ - NSATS uint8 ///< Current number of sats used for RTK calculation. - BASELINE_COORDS_TYPE uint8 ///< Coordinate system of baseline. 0 == ECEF, 1 == NED + TIME_LAST_BASELINE_MS uint32 // Time since boot of last baseline message received in ms. + TOW uint32 // GPS Time of Week of last baseline + BASELINE_A_MM int32 // Current baseline in ECEF x or NED north component in mm. + BASELINE_B_MM int32 // Current baseline in ECEF y or NED east component in mm. + BASELINE_C_MM int32 // Current baseline in ECEF z or NED down component in mm. + ACCURACY uint32 // Current estimate of baseline accuracy. + IAR_NUM_HYPOTHESES int32 // Current number of integer ambiguity hypotheses. + WN uint16 // GPS Week Number of last baseline + RTK_RECEIVER_ID uint8 // Identification of connected RTK receiver. + RTK_HEALTH uint8 // GPS-specific health report for RTK data. + RTK_RATE uint8 // Rate of baseline messages being received by GPS, in HZ + NSATS uint8 // Current number of sats used for RTK calculation. + BASELINE_COORDS_TYPE uint8 // Coordinate system of baseline. 0 == ECEF, 1 == NED } -func NewGpsRtk(TIME_LAST_BASELINE_MS uint32, TOW uint32, BASELINE_A_MM int32, BASELINE_B_MM int32, BASELINE_C_MM int32, ACCURACY uint32, IAR_NUM_HYPOTHESES int32, WN uint16, RTK_RECEIVER_ID uint8, RTK_HEALTH uint8, RTK_RATE uint8, NSATS uint8, BASELINE_COORDS_TYPE uint8) MAVLinkMessage { +// NewGpsRtk returns a new GpsRtk +func NewGpsRtk(TIME_LAST_BASELINE_MS uint32, TOW uint32, BASELINE_A_MM int32, BASELINE_B_MM int32, BASELINE_C_MM int32, ACCURACY uint32, IAR_NUM_HYPOTHESES int32, WN uint16, RTK_RECEIVER_ID uint8, RTK_HEALTH uint8, RTK_RATE uint8, NSATS uint8, BASELINE_COORDS_TYPE uint8) *GpsRtk { m := GpsRtk{} m.TIME_LAST_BASELINE_MS = TIME_LAST_BASELINE_MS m.TOW = TOW @@ -6671,18 +7945,22 @@ func NewGpsRtk(TIME_LAST_BASELINE_MS uint32, TOW uint32, BASELINE_A_MM int32, BA return &m } +// Id returns the GpsRtk Message ID func (*GpsRtk) Id() uint8 { return 127 } +// Len returns the GpsRtk Message Length func (*GpsRtk) Len() uint8 { return 35 } +// Crc returns the GpsRtk Message CRC func (*GpsRtk) Crc() uint8 { return 25 } +// Pack returns a packed byte array which represents a GpsRtk payload func (m *GpsRtk) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_LAST_BASELINE_MS) @@ -6701,6 +7979,7 @@ func (m *GpsRtk) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the GpsRtk func (m *GpsRtk) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_LAST_BASELINE_MS) @@ -6718,29 +7997,36 @@ func (m *GpsRtk) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.BASELINE_COORDS_TYPE) } +const () + +// // MESSAGE GPS2_RTK - +// // MAVLINK_MSG_ID_GPS2_RTK 128 +// // MAVLINK_MSG_ID_GPS2_RTK_LEN 35 +// // MAVLINK_MSG_ID_GPS2_RTK_CRC 226 - +// +// type Gps2Rtk struct { - TIME_LAST_BASELINE_MS uint32 ///< Time since boot of last baseline message received in ms. - TOW uint32 ///< GPS Time of Week of last baseline - BASELINE_A_MM int32 ///< Current baseline in ECEF x or NED north component in mm. - BASELINE_B_MM int32 ///< Current baseline in ECEF y or NED east component in mm. - BASELINE_C_MM int32 ///< Current baseline in ECEF z or NED down component in mm. - ACCURACY uint32 ///< Current estimate of baseline accuracy. - IAR_NUM_HYPOTHESES int32 ///< Current number of integer ambiguity hypotheses. - WN uint16 ///< GPS Week Number of last baseline - RTK_RECEIVER_ID uint8 ///< Identification of connected RTK receiver. - RTK_HEALTH uint8 ///< GPS-specific health report for RTK data. - RTK_RATE uint8 ///< Rate of baseline messages being received by GPS, in HZ - NSATS uint8 ///< Current number of sats used for RTK calculation. - BASELINE_COORDS_TYPE uint8 ///< Coordinate system of baseline. 0 == ECEF, 1 == NED + TIME_LAST_BASELINE_MS uint32 // Time since boot of last baseline message received in ms. + TOW uint32 // GPS Time of Week of last baseline + BASELINE_A_MM int32 // Current baseline in ECEF x or NED north component in mm. + BASELINE_B_MM int32 // Current baseline in ECEF y or NED east component in mm. + BASELINE_C_MM int32 // Current baseline in ECEF z or NED down component in mm. + ACCURACY uint32 // Current estimate of baseline accuracy. + IAR_NUM_HYPOTHESES int32 // Current number of integer ambiguity hypotheses. + WN uint16 // GPS Week Number of last baseline + RTK_RECEIVER_ID uint8 // Identification of connected RTK receiver. + RTK_HEALTH uint8 // GPS-specific health report for RTK data. + RTK_RATE uint8 // Rate of baseline messages being received by GPS, in HZ + NSATS uint8 // Current number of sats used for RTK calculation. + BASELINE_COORDS_TYPE uint8 // Coordinate system of baseline. 0 == ECEF, 1 == NED } -func NewGps2Rtk(TIME_LAST_BASELINE_MS uint32, TOW uint32, BASELINE_A_MM int32, BASELINE_B_MM int32, BASELINE_C_MM int32, ACCURACY uint32, IAR_NUM_HYPOTHESES int32, WN uint16, RTK_RECEIVER_ID uint8, RTK_HEALTH uint8, RTK_RATE uint8, NSATS uint8, BASELINE_COORDS_TYPE uint8) MAVLinkMessage { +// NewGps2Rtk returns a new Gps2Rtk +func NewGps2Rtk(TIME_LAST_BASELINE_MS uint32, TOW uint32, BASELINE_A_MM int32, BASELINE_B_MM int32, BASELINE_C_MM int32, ACCURACY uint32, IAR_NUM_HYPOTHESES int32, WN uint16, RTK_RECEIVER_ID uint8, RTK_HEALTH uint8, RTK_RATE uint8, NSATS uint8, BASELINE_COORDS_TYPE uint8) *Gps2Rtk { m := Gps2Rtk{} m.TIME_LAST_BASELINE_MS = TIME_LAST_BASELINE_MS m.TOW = TOW @@ -6758,18 +8044,22 @@ func NewGps2Rtk(TIME_LAST_BASELINE_MS uint32, TOW uint32, BASELINE_A_MM int32, B return &m } +// Id returns the Gps2Rtk Message ID func (*Gps2Rtk) Id() uint8 { return 128 } +// Len returns the Gps2Rtk Message Length func (*Gps2Rtk) Len() uint8 { return 35 } +// Crc returns the Gps2Rtk Message CRC func (*Gps2Rtk) Crc() uint8 { return 226 } +// Pack returns a packed byte array which represents a Gps2Rtk payload func (m *Gps2Rtk) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_LAST_BASELINE_MS) @@ -6788,6 +8078,7 @@ func (m *Gps2Rtk) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Gps2Rtk func (m *Gps2Rtk) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_LAST_BASELINE_MS) @@ -6805,23 +8096,30 @@ func (m *Gps2Rtk) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.BASELINE_COORDS_TYPE) } +const () + +// // MESSAGE DATA_TRANSMISSION_HANDSHAKE - +// // MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130 +// // MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13 +// // MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC 29 - +// +// type DataTransmissionHandshake struct { - SIZE uint32 ///< total data size in bytes (set on ACK only) - WIDTH uint16 ///< Width of a matrix or image - HEIGHT uint16 ///< Height of a matrix or image - PACKETS uint16 ///< number of packets beeing sent (set on ACK only) - TYPE uint8 ///< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - PAYLOAD uint8 ///< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - JPG_QUALITY uint8 ///< JPEG quality out of [1,100] + SIZE uint32 // total data size in bytes (set on ACK only) + WIDTH uint16 // Width of a matrix or image + HEIGHT uint16 // Height of a matrix or image + PACKETS uint16 // number of packets beeing sent (set on ACK only) + TYPE uint8 // type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) + PAYLOAD uint8 // payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) + JPG_QUALITY uint8 // JPEG quality out of [1,100] } -func NewDataTransmissionHandshake(SIZE uint32, WIDTH uint16, HEIGHT uint16, PACKETS uint16, TYPE uint8, PAYLOAD uint8, JPG_QUALITY uint8) MAVLinkMessage { +// NewDataTransmissionHandshake returns a new DataTransmissionHandshake +func NewDataTransmissionHandshake(SIZE uint32, WIDTH uint16, HEIGHT uint16, PACKETS uint16, TYPE uint8, PAYLOAD uint8, JPG_QUALITY uint8) *DataTransmissionHandshake { m := DataTransmissionHandshake{} m.SIZE = SIZE m.WIDTH = WIDTH @@ -6833,18 +8131,22 @@ func NewDataTransmissionHandshake(SIZE uint32, WIDTH uint16, HEIGHT uint16, PACK return &m } +// Id returns the DataTransmissionHandshake Message ID func (*DataTransmissionHandshake) Id() uint8 { return 130 } +// Len returns the DataTransmissionHandshake Message Length func (*DataTransmissionHandshake) Len() uint8 { return 13 } +// Crc returns the DataTransmissionHandshake Message CRC func (*DataTransmissionHandshake) Crc() uint8 { return 29 } +// Pack returns a packed byte array which represents a DataTransmissionHandshake payload func (m *DataTransmissionHandshake) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SIZE) @@ -6857,6 +8159,7 @@ func (m *DataTransmissionHandshake) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the DataTransmissionHandshake func (m *DataTransmissionHandshake) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SIZE) @@ -6868,36 +8171,47 @@ func (m *DataTransmissionHandshake) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.JPG_QUALITY) } +const () + +// // MESSAGE ENCAPSULATED_DATA - +// // MAVLINK_MSG_ID_ENCAPSULATED_DATA 131 +// // MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255 +// // MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC 223 - +// +// type EncapsulatedData struct { - SEQNR uint16 ///< sequence number (starting with 0 on every transmission) - DATA [253]uint8 ///< image data bytes + SEQNR uint16 // sequence number (starting with 0 on every transmission) + DATA [253]uint8 // image data bytes } -func NewEncapsulatedData(SEQNR uint16, DATA [253]uint8) MAVLinkMessage { +// NewEncapsulatedData returns a new EncapsulatedData +func NewEncapsulatedData(SEQNR uint16, DATA [253]uint8) *EncapsulatedData { m := EncapsulatedData{} m.SEQNR = SEQNR m.DATA = DATA return &m } +// Id returns the EncapsulatedData Message ID func (*EncapsulatedData) Id() uint8 { return 131 } +// Len returns the EncapsulatedData Message Length func (*EncapsulatedData) Len() uint8 { return 255 } +// Crc returns the EncapsulatedData Message CRC func (*EncapsulatedData) Crc() uint8 { return 223 } +// Pack returns a packed byte array which represents a EncapsulatedData payload func (m *EncapsulatedData) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SEQNR) @@ -6905,32 +8219,40 @@ func (m *EncapsulatedData) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the EncapsulatedData func (m *EncapsulatedData) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SEQNR) binary.Read(data, binary.LittleEndian, &m.DATA) } -const MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_data_LEN = 253 +const ( + MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_data_LEN = 253 +) +// // MESSAGE DISTANCE_SENSOR - +// // MAVLINK_MSG_ID_DISTANCE_SENSOR 132 +// // MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14 +// // MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85 - +// +// type DistanceSensor struct { - TIME_BOOT_MS uint32 ///< Time since system boot - MIN_DISTANCE uint16 ///< Minimum distance the sensor can measure in centimeters - MAX_DISTANCE uint16 ///< Maximum distance the sensor can measure in centimeters - CURRENT_DISTANCE uint16 ///< Current distance reading - TYPE uint8 ///< Type from MAV_DISTANCE_SENSOR enum. - ID uint8 ///< Onboard ID of the sensor - ORIENTATION uint8 ///< Direction the sensor faces from FIXME enum. - COVARIANCE uint8 ///< Measurement covariance in centimeters, 0 for unknown / invalid readings + TIME_BOOT_MS uint32 // Time since system boot + MIN_DISTANCE uint16 // Minimum distance the sensor can measure in centimeters + MAX_DISTANCE uint16 // Maximum distance the sensor can measure in centimeters + CURRENT_DISTANCE uint16 // Current distance reading + TYPE uint8 // Type from MAV_DISTANCE_SENSOR enum. + ID uint8 // Onboard ID of the sensor + ORIENTATION uint8 // Direction the sensor faces from FIXME enum. + COVARIANCE uint8 // Measurement covariance in centimeters, 0 for unknown / invalid readings } -func NewDistanceSensor(TIME_BOOT_MS uint32, MIN_DISTANCE uint16, MAX_DISTANCE uint16, CURRENT_DISTANCE uint16, TYPE uint8, ID uint8, ORIENTATION uint8, COVARIANCE uint8) MAVLinkMessage { +// NewDistanceSensor returns a new DistanceSensor +func NewDistanceSensor(TIME_BOOT_MS uint32, MIN_DISTANCE uint16, MAX_DISTANCE uint16, CURRENT_DISTANCE uint16, TYPE uint8, ID uint8, ORIENTATION uint8, COVARIANCE uint8) *DistanceSensor { m := DistanceSensor{} m.TIME_BOOT_MS = TIME_BOOT_MS m.MIN_DISTANCE = MIN_DISTANCE @@ -6943,18 +8265,22 @@ func NewDistanceSensor(TIME_BOOT_MS uint32, MIN_DISTANCE uint16, MAX_DISTANCE ui return &m } +// Id returns the DistanceSensor Message ID func (*DistanceSensor) Id() uint8 { return 132 } +// Len returns the DistanceSensor Message Length func (*DistanceSensor) Len() uint8 { return 14 } +// Crc returns the DistanceSensor Message CRC func (*DistanceSensor) Crc() uint8 { return 85 } +// Pack returns a packed byte array which represents a DistanceSensor payload func (m *DistanceSensor) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -6968,6 +8294,7 @@ func (m *DistanceSensor) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the DistanceSensor func (m *DistanceSensor) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -6980,20 +8307,27 @@ func (m *DistanceSensor) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.COVARIANCE) } +const () + +// // MESSAGE TERRAIN_REQUEST - +// // MAVLINK_MSG_ID_TERRAIN_REQUEST 133 +// // MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN 18 +// // MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC 6 - +// +// type TerrainRequest struct { - MASK uint64 ///< Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) - LAT int32 ///< Latitude of SW corner of first grid (degrees *10^7) - LON int32 ///< Longitude of SW corner of first grid (in degrees *10^7) - GRID_SPACING uint16 ///< Grid spacing in meters + MASK uint64 // Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + LAT int32 // Latitude of SW corner of first grid (degrees *10^7) + LON int32 // Longitude of SW corner of first grid (in degrees *10^7) + GRID_SPACING uint16 // Grid spacing in meters } -func NewTerrainRequest(MASK uint64, LAT int32, LON int32, GRID_SPACING uint16) MAVLinkMessage { +// NewTerrainRequest returns a new TerrainRequest +func NewTerrainRequest(MASK uint64, LAT int32, LON int32, GRID_SPACING uint16) *TerrainRequest { m := TerrainRequest{} m.MASK = MASK m.LAT = LAT @@ -7002,18 +8336,22 @@ func NewTerrainRequest(MASK uint64, LAT int32, LON int32, GRID_SPACING uint16) M return &m } +// Id returns the TerrainRequest Message ID func (*TerrainRequest) Id() uint8 { return 133 } +// Len returns the TerrainRequest Message Length func (*TerrainRequest) Len() uint8 { return 18 } +// Crc returns the TerrainRequest Message CRC func (*TerrainRequest) Crc() uint8 { return 6 } +// Pack returns a packed byte array which represents a TerrainRequest payload func (m *TerrainRequest) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.MASK) @@ -7023,6 +8361,7 @@ func (m *TerrainRequest) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the TerrainRequest func (m *TerrainRequest) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.MASK) @@ -7031,21 +8370,28 @@ func (m *TerrainRequest) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.GRID_SPACING) } +const () + +// // MESSAGE TERRAIN_DATA - +// // MAVLINK_MSG_ID_TERRAIN_DATA 134 +// // MAVLINK_MSG_ID_TERRAIN_DATA_LEN 43 +// // MAVLINK_MSG_ID_TERRAIN_DATA_CRC 229 - +// +// type TerrainData struct { - LAT int32 ///< Latitude of SW corner of first grid (degrees *10^7) - LON int32 ///< Longitude of SW corner of first grid (in degrees *10^7) - GRID_SPACING uint16 ///< Grid spacing in meters - DATA [16]int16 ///< Terrain data in meters AMSL - GRIDBIT uint8 ///< bit within the terrain request mask + LAT int32 // Latitude of SW corner of first grid (degrees *10^7) + LON int32 // Longitude of SW corner of first grid (in degrees *10^7) + GRID_SPACING uint16 // Grid spacing in meters + DATA [16]int16 // Terrain data in meters AMSL + GRIDBIT uint8 // bit within the terrain request mask } -func NewTerrainData(LAT int32, LON int32, GRID_SPACING uint16, DATA [16]int16, GRIDBIT uint8) MAVLinkMessage { +// NewTerrainData returns a new TerrainData +func NewTerrainData(LAT int32, LON int32, GRID_SPACING uint16, DATA [16]int16, GRIDBIT uint8) *TerrainData { m := TerrainData{} m.LAT = LAT m.LON = LON @@ -7055,18 +8401,22 @@ func NewTerrainData(LAT int32, LON int32, GRID_SPACING uint16, DATA [16]int16, G return &m } +// Id returns the TerrainData Message ID func (*TerrainData) Id() uint8 { return 134 } +// Len returns the TerrainData Message Length func (*TerrainData) Len() uint8 { return 43 } +// Crc returns the TerrainData Message CRC func (*TerrainData) Crc() uint8 { return 229 } +// Pack returns a packed byte array which represents a TerrainData payload func (m *TerrainData) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LAT) @@ -7077,6 +8427,7 @@ func (m *TerrainData) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the TerrainData func (m *TerrainData) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LAT) @@ -7086,38 +8437,49 @@ func (m *TerrainData) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.GRIDBIT) } -const MAVLINK_MSG_TERRAIN_DATA_FIELD_data_LEN = 16 +const ( + MAVLINK_MSG_TERRAIN_DATA_FIELD_data_LEN = 16 +) +// // MESSAGE TERRAIN_CHECK - +// // MAVLINK_MSG_ID_TERRAIN_CHECK 135 +// // MAVLINK_MSG_ID_TERRAIN_CHECK_LEN 8 +// // MAVLINK_MSG_ID_TERRAIN_CHECK_CRC 203 - +// +// type TerrainCheck struct { - LAT int32 ///< Latitude (degrees *10^7) - LON int32 ///< Longitude (degrees *10^7) + LAT int32 // Latitude (degrees *10^7) + LON int32 // Longitude (degrees *10^7) } -func NewTerrainCheck(LAT int32, LON int32) MAVLinkMessage { +// NewTerrainCheck returns a new TerrainCheck +func NewTerrainCheck(LAT int32, LON int32) *TerrainCheck { m := TerrainCheck{} m.LAT = LAT m.LON = LON return &m } +// Id returns the TerrainCheck Message ID func (*TerrainCheck) Id() uint8 { return 135 } +// Len returns the TerrainCheck Message Length func (*TerrainCheck) Len() uint8 { return 8 } +// Crc returns the TerrainCheck Message CRC func (*TerrainCheck) Crc() uint8 { return 203 } +// Pack returns a packed byte array which represents a TerrainCheck payload func (m *TerrainCheck) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LAT) @@ -7125,29 +8487,37 @@ func (m *TerrainCheck) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the TerrainCheck func (m *TerrainCheck) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LAT) binary.Read(data, binary.LittleEndian, &m.LON) } +const () + +// // MESSAGE TERRAIN_REPORT - +// // MAVLINK_MSG_ID_TERRAIN_REPORT 136 +// // MAVLINK_MSG_ID_TERRAIN_REPORT_LEN 22 +// // MAVLINK_MSG_ID_TERRAIN_REPORT_CRC 1 - +// +// type TerrainReport struct { - LAT int32 ///< Latitude (degrees *10^7) - LON int32 ///< Longitude (degrees *10^7) - TERRAIN_HEIGHT float32 ///< Terrain height in meters AMSL - CURRENT_HEIGHT float32 ///< Current vehicle height above lat/lon terrain height (meters) - SPACING uint16 ///< grid spacing (zero if terrain at this location unavailable) - PENDING uint16 ///< Number of 4x4 terrain blocks waiting to be received or read from disk - LOADED uint16 ///< Number of 4x4 terrain blocks in memory + LAT int32 // Latitude (degrees *10^7) + LON int32 // Longitude (degrees *10^7) + TERRAIN_HEIGHT float32 // Terrain height in meters AMSL + CURRENT_HEIGHT float32 // Current vehicle height above lat/lon terrain height (meters) + SPACING uint16 // grid spacing (zero if terrain at this location unavailable) + PENDING uint16 // Number of 4x4 terrain blocks waiting to be received or read from disk + LOADED uint16 // Number of 4x4 terrain blocks in memory } -func NewTerrainReport(LAT int32, LON int32, TERRAIN_HEIGHT float32, CURRENT_HEIGHT float32, SPACING uint16, PENDING uint16, LOADED uint16) MAVLinkMessage { +// NewTerrainReport returns a new TerrainReport +func NewTerrainReport(LAT int32, LON int32, TERRAIN_HEIGHT float32, CURRENT_HEIGHT float32, SPACING uint16, PENDING uint16, LOADED uint16) *TerrainReport { m := TerrainReport{} m.LAT = LAT m.LON = LON @@ -7159,18 +8529,22 @@ func NewTerrainReport(LAT int32, LON int32, TERRAIN_HEIGHT float32, CURRENT_HEIG return &m } +// Id returns the TerrainReport Message ID func (*TerrainReport) Id() uint8 { return 136 } +// Len returns the TerrainReport Message Length func (*TerrainReport) Len() uint8 { return 22 } +// Crc returns the TerrainReport Message CRC func (*TerrainReport) Crc() uint8 { return 1 } +// Pack returns a packed byte array which represents a TerrainReport payload func (m *TerrainReport) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.LAT) @@ -7183,6 +8557,7 @@ func (m *TerrainReport) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the TerrainReport func (m *TerrainReport) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.LAT) @@ -7194,27 +8569,34 @@ func (m *TerrainReport) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.LOADED) } +const () + +// // MESSAGE BATTERY_STATUS - +// // MAVLINK_MSG_ID_BATTERY_STATUS 147 +// // MAVLINK_MSG_ID_BATTERY_STATUS_LEN 24 +// // MAVLINK_MSG_ID_BATTERY_STATUS_CRC 177 - +// +// type BatteryStatus struct { - CURRENT_CONSUMED int32 ///< Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate - ENERGY_CONSUMED int32 ///< Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate - VOLTAGE_CELL_1 uint16 ///< Battery voltage of cell 1, in millivolts (1 = 1 millivolt) - VOLTAGE_CELL_2 uint16 ///< Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell - VOLTAGE_CELL_3 uint16 ///< Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell - VOLTAGE_CELL_4 uint16 ///< Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell - VOLTAGE_CELL_5 uint16 ///< Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell - VOLTAGE_CELL_6 uint16 ///< Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell - CURRENT_BATTERY int16 ///< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - ACCU_ID uint8 ///< Accupack ID - BATTERY_REMAINING int8 ///< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + CURRENT_CONSUMED int32 // Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate + ENERGY_CONSUMED int32 // Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate + VOLTAGE_CELL_1 uint16 // Battery voltage of cell 1, in millivolts (1 = 1 millivolt) + VOLTAGE_CELL_2 uint16 // Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell + VOLTAGE_CELL_3 uint16 // Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell + VOLTAGE_CELL_4 uint16 // Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell + VOLTAGE_CELL_5 uint16 // Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell + VOLTAGE_CELL_6 uint16 // Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell + CURRENT_BATTERY int16 // Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + ACCU_ID uint8 // Accupack ID + BATTERY_REMAINING int8 // Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery } -func NewBatteryStatus(CURRENT_CONSUMED int32, ENERGY_CONSUMED int32, VOLTAGE_CELL_1 uint16, VOLTAGE_CELL_2 uint16, VOLTAGE_CELL_3 uint16, VOLTAGE_CELL_4 uint16, VOLTAGE_CELL_5 uint16, VOLTAGE_CELL_6 uint16, CURRENT_BATTERY int16, ACCU_ID uint8, BATTERY_REMAINING int8) MAVLinkMessage { +// NewBatteryStatus returns a new BatteryStatus +func NewBatteryStatus(CURRENT_CONSUMED int32, ENERGY_CONSUMED int32, VOLTAGE_CELL_1 uint16, VOLTAGE_CELL_2 uint16, VOLTAGE_CELL_3 uint16, VOLTAGE_CELL_4 uint16, VOLTAGE_CELL_5 uint16, VOLTAGE_CELL_6 uint16, CURRENT_BATTERY int16, ACCU_ID uint8, BATTERY_REMAINING int8) *BatteryStatus { m := BatteryStatus{} m.CURRENT_CONSUMED = CURRENT_CONSUMED m.ENERGY_CONSUMED = ENERGY_CONSUMED @@ -7230,18 +8612,22 @@ func NewBatteryStatus(CURRENT_CONSUMED int32, ENERGY_CONSUMED int32, VOLTAGE_CEL return &m } +// Id returns the BatteryStatus Message ID func (*BatteryStatus) Id() uint8 { return 147 } +// Len returns the BatteryStatus Message Length func (*BatteryStatus) Len() uint8 { return 24 } +// Crc returns the BatteryStatus Message CRC func (*BatteryStatus) Crc() uint8 { return 177 } +// Pack returns a packed byte array which represents a BatteryStatus payload func (m *BatteryStatus) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.CURRENT_CONSUMED) @@ -7258,6 +8644,7 @@ func (m *BatteryStatus) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the BatteryStatus func (m *BatteryStatus) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.CURRENT_CONSUMED) @@ -7273,25 +8660,32 @@ func (m *BatteryStatus) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.BATTERY_REMAINING) } +const () + +// // MESSAGE SETPOINT_8DOF - +// // MAVLINK_MSG_ID_SETPOINT_8DOF 148 +// // MAVLINK_MSG_ID_SETPOINT_8DOF_LEN 33 +// // MAVLINK_MSG_ID_SETPOINT_8DOF_CRC 241 - +// +// type Setpoint8Dof struct { - VAL1 float32 ///< Value 1 - VAL2 float32 ///< Value 2 - VAL3 float32 ///< Value 3 - VAL4 float32 ///< Value 4 - VAL5 float32 ///< Value 5 - VAL6 float32 ///< Value 6 - VAL7 float32 ///< Value 7 - VAL8 float32 ///< Value 8 - TARGET_SYSTEM uint8 ///< System ID + VAL1 float32 // Value 1 + VAL2 float32 // Value 2 + VAL3 float32 // Value 3 + VAL4 float32 // Value 4 + VAL5 float32 // Value 5 + VAL6 float32 // Value 6 + VAL7 float32 // Value 7 + VAL8 float32 // Value 8 + TARGET_SYSTEM uint8 // System ID } -func NewSetpoint8Dof(VAL1 float32, VAL2 float32, VAL3 float32, VAL4 float32, VAL5 float32, VAL6 float32, VAL7 float32, VAL8 float32, TARGET_SYSTEM uint8) MAVLinkMessage { +// NewSetpoint8Dof returns a new Setpoint8Dof +func NewSetpoint8Dof(VAL1 float32, VAL2 float32, VAL3 float32, VAL4 float32, VAL5 float32, VAL6 float32, VAL7 float32, VAL8 float32, TARGET_SYSTEM uint8) *Setpoint8Dof { m := Setpoint8Dof{} m.VAL1 = VAL1 m.VAL2 = VAL2 @@ -7305,18 +8699,22 @@ func NewSetpoint8Dof(VAL1 float32, VAL2 float32, VAL3 float32, VAL4 float32, VAL return &m } +// Id returns the Setpoint8Dof Message ID func (*Setpoint8Dof) Id() uint8 { return 148 } +// Len returns the Setpoint8Dof Message Length func (*Setpoint8Dof) Len() uint8 { return 33 } +// Crc returns the Setpoint8Dof Message CRC func (*Setpoint8Dof) Crc() uint8 { return 241 } +// Pack returns a packed byte array which represents a Setpoint8Dof payload func (m *Setpoint8Dof) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.VAL1) @@ -7331,6 +8729,7 @@ func (m *Setpoint8Dof) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Setpoint8Dof func (m *Setpoint8Dof) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.VAL1) @@ -7344,23 +8743,30 @@ func (m *Setpoint8Dof) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) } +const () + +// // MESSAGE SETPOINT_6DOF - +// // MAVLINK_MSG_ID_SETPOINT_6DOF 149 +// // MAVLINK_MSG_ID_SETPOINT_6DOF_LEN 25 +// // MAVLINK_MSG_ID_SETPOINT_6DOF_CRC 15 - +// +// type Setpoint6Dof struct { - TRANS_X float32 ///< Translational Component in x - TRANS_Y float32 ///< Translational Component in y - TRANS_Z float32 ///< Translational Component in z - ROT_X float32 ///< Rotational Component in x - ROT_Y float32 ///< Rotational Component in y - ROT_Z float32 ///< Rotational Component in z - TARGET_SYSTEM uint8 ///< System ID + TRANS_X float32 // Translational Component in x + TRANS_Y float32 // Translational Component in y + TRANS_Z float32 // Translational Component in z + ROT_X float32 // Rotational Component in x + ROT_Y float32 // Rotational Component in y + ROT_Z float32 // Rotational Component in z + TARGET_SYSTEM uint8 // System ID } -func NewSetpoint6Dof(TRANS_X float32, TRANS_Y float32, TRANS_Z float32, ROT_X float32, ROT_Y float32, ROT_Z float32, TARGET_SYSTEM uint8) MAVLinkMessage { +// NewSetpoint6Dof returns a new Setpoint6Dof +func NewSetpoint6Dof(TRANS_X float32, TRANS_Y float32, TRANS_Z float32, ROT_X float32, ROT_Y float32, ROT_Z float32, TARGET_SYSTEM uint8) *Setpoint6Dof { m := Setpoint6Dof{} m.TRANS_X = TRANS_X m.TRANS_Y = TRANS_Y @@ -7372,18 +8778,22 @@ func NewSetpoint6Dof(TRANS_X float32, TRANS_Y float32, TRANS_Z float32, ROT_X fl return &m } +// Id returns the Setpoint6Dof Message ID func (*Setpoint6Dof) Id() uint8 { return 149 } +// Len returns the Setpoint6Dof Message Length func (*Setpoint6Dof) Len() uint8 { return 25 } +// Crc returns the Setpoint6Dof Message CRC func (*Setpoint6Dof) Crc() uint8 { return 15 } +// Pack returns a packed byte array which represents a Setpoint6Dof payload func (m *Setpoint6Dof) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TRANS_X) @@ -7396,6 +8806,7 @@ func (m *Setpoint6Dof) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Setpoint6Dof func (m *Setpoint6Dof) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TRANS_X) @@ -7407,20 +8818,27 @@ func (m *Setpoint6Dof) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM) } +const () + +// // MESSAGE MEMORY_VECT - +// // MAVLINK_MSG_ID_MEMORY_VECT 249 +// // MAVLINK_MSG_ID_MEMORY_VECT_LEN 36 +// // MAVLINK_MSG_ID_MEMORY_VECT_CRC 204 - +// +// type MemoryVect struct { - ADDRESS uint16 ///< Starting address of the debug variables - VER uint8 ///< Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below - TYPE uint8 ///< Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 - VALUE [32]int8 ///< Memory contents at specified address + ADDRESS uint16 // Starting address of the debug variables + VER uint8 // Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + TYPE uint8 // Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + VALUE [32]int8 // Memory contents at specified address } -func NewMemoryVect(ADDRESS uint16, VER uint8, TYPE uint8, VALUE [32]int8) MAVLinkMessage { +// NewMemoryVect returns a new MemoryVect +func NewMemoryVect(ADDRESS uint16, VER uint8, TYPE uint8, VALUE [32]int8) *MemoryVect { m := MemoryVect{} m.ADDRESS = ADDRESS m.VER = VER @@ -7429,18 +8847,22 @@ func NewMemoryVect(ADDRESS uint16, VER uint8, TYPE uint8, VALUE [32]int8) MAVLin return &m } +// Id returns the MemoryVect Message ID func (*MemoryVect) Id() uint8 { return 249 } +// Len returns the MemoryVect Message Length func (*MemoryVect) Len() uint8 { return 36 } +// Crc returns the MemoryVect Message CRC func (*MemoryVect) Crc() uint8 { return 204 } +// Pack returns a packed byte array which represents a MemoryVect payload func (m *MemoryVect) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.ADDRESS) @@ -7450,6 +8872,7 @@ func (m *MemoryVect) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MemoryVect func (m *MemoryVect) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.ADDRESS) @@ -7458,23 +8881,30 @@ func (m *MemoryVect) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.VALUE) } -const MAVLINK_MSG_MEMORY_VECT_FIELD_value_LEN = 32 +const ( + MAVLINK_MSG_MEMORY_VECT_FIELD_value_LEN = 32 +) +// // MESSAGE DEBUG_VECT - +// // MAVLINK_MSG_ID_DEBUG_VECT 250 +// // MAVLINK_MSG_ID_DEBUG_VECT_LEN 30 +// // MAVLINK_MSG_ID_DEBUG_VECT_CRC 49 - +// +// type DebugVect struct { - TIME_USEC uint64 ///< Timestamp - X float32 ///< x - Y float32 ///< y - Z float32 ///< z - NAME [10]uint8 ///< Name + TIME_USEC uint64 // Timestamp + X float32 // x + Y float32 // y + Z float32 // z + NAME [10]uint8 // Name } -func NewDebugVect(TIME_USEC uint64, X float32, Y float32, Z float32, NAME [10]uint8) MAVLinkMessage { +// NewDebugVect returns a new DebugVect +func NewDebugVect(TIME_USEC uint64, X float32, Y float32, Z float32, NAME [10]uint8) *DebugVect { m := DebugVect{} m.TIME_USEC = TIME_USEC m.X = X @@ -7484,18 +8914,22 @@ func NewDebugVect(TIME_USEC uint64, X float32, Y float32, Z float32, NAME [10]ui return &m } +// Id returns the DebugVect Message ID func (*DebugVect) Id() uint8 { return 250 } +// Len returns the DebugVect Message Length func (*DebugVect) Len() uint8 { return 30 } +// Crc returns the DebugVect Message CRC func (*DebugVect) Crc() uint8 { return 49 } +// Pack returns a packed byte array which represents a DebugVect payload func (m *DebugVect) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_USEC) @@ -7506,6 +8940,7 @@ func (m *DebugVect) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the DebugVect func (m *DebugVect) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_USEC) @@ -7515,21 +8950,28 @@ func (m *DebugVect) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.NAME) } -const MAVLINK_MSG_DEBUG_VECT_FIELD_name_LEN = 10 +const ( + MAVLINK_MSG_DEBUG_VECT_FIELD_name_LEN = 10 +) +// // MESSAGE NAMED_VALUE_FLOAT - +// // MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 251 +// // MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18 +// // MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC 170 - +// +// type NamedValueFloat struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - VALUE float32 ///< Floating point value - NAME [10]uint8 ///< Name of the debug variable + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + VALUE float32 // Floating point value + NAME [10]uint8 // Name of the debug variable } -func NewNamedValueFloat(TIME_BOOT_MS uint32, VALUE float32, NAME [10]uint8) MAVLinkMessage { +// NewNamedValueFloat returns a new NamedValueFloat +func NewNamedValueFloat(TIME_BOOT_MS uint32, VALUE float32, NAME [10]uint8) *NamedValueFloat { m := NamedValueFloat{} m.TIME_BOOT_MS = TIME_BOOT_MS m.VALUE = VALUE @@ -7537,18 +8979,22 @@ func NewNamedValueFloat(TIME_BOOT_MS uint32, VALUE float32, NAME [10]uint8) MAVL return &m } +// Id returns the NamedValueFloat Message ID func (*NamedValueFloat) Id() uint8 { return 251 } +// Len returns the NamedValueFloat Message Length func (*NamedValueFloat) Len() uint8 { return 18 } +// Crc returns the NamedValueFloat Message CRC func (*NamedValueFloat) Crc() uint8 { return 170 } +// Pack returns a packed byte array which represents a NamedValueFloat payload func (m *NamedValueFloat) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -7557,6 +9003,7 @@ func (m *NamedValueFloat) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the NamedValueFloat func (m *NamedValueFloat) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -7564,21 +9011,28 @@ func (m *NamedValueFloat) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.NAME) } -const MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_name_LEN = 10 +const ( + MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_name_LEN = 10 +) +// // MESSAGE NAMED_VALUE_INT - +// // MAVLINK_MSG_ID_NAMED_VALUE_INT 252 +// // MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18 +// // MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC 44 - +// +// type NamedValueInt struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - VALUE int32 ///< Signed integer value - NAME [10]uint8 ///< Name of the debug variable + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + VALUE int32 // Signed integer value + NAME [10]uint8 // Name of the debug variable } -func NewNamedValueInt(TIME_BOOT_MS uint32, VALUE int32, NAME [10]uint8) MAVLinkMessage { +// NewNamedValueInt returns a new NamedValueInt +func NewNamedValueInt(TIME_BOOT_MS uint32, VALUE int32, NAME [10]uint8) *NamedValueInt { m := NamedValueInt{} m.TIME_BOOT_MS = TIME_BOOT_MS m.VALUE = VALUE @@ -7586,18 +9040,22 @@ func NewNamedValueInt(TIME_BOOT_MS uint32, VALUE int32, NAME [10]uint8) MAVLinkM return &m } +// Id returns the NamedValueInt Message ID func (*NamedValueInt) Id() uint8 { return 252 } +// Len returns the NamedValueInt Message Length func (*NamedValueInt) Len() uint8 { return 18 } +// Crc returns the NamedValueInt Message CRC func (*NamedValueInt) Crc() uint8 { return 44 } +// Pack returns a packed byte array which represents a NamedValueInt payload func (m *NamedValueInt) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -7606,6 +9064,7 @@ func (m *NamedValueInt) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the NamedValueInt func (m *NamedValueInt) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) @@ -7613,38 +9072,49 @@ func (m *NamedValueInt) Decode(buf []byte) { binary.Read(data, binary.LittleEndian, &m.NAME) } -const MAVLINK_MSG_NAMED_VALUE_INT_FIELD_name_LEN = 10 +const ( + MAVLINK_MSG_NAMED_VALUE_INT_FIELD_name_LEN = 10 +) +// // MESSAGE STATUSTEXT - +// // MAVLINK_MSG_ID_STATUSTEXT 253 +// // MAVLINK_MSG_ID_STATUSTEXT_LEN 51 +// // MAVLINK_MSG_ID_STATUSTEXT_CRC 83 - +// +// type Statustext struct { - SEVERITY uint8 ///< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. - TEXT [50]uint8 ///< Status text message, without null termination character + SEVERITY uint8 // Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. + TEXT [50]uint8 // Status text message, without null termination character } -func NewStatustext(SEVERITY uint8, TEXT [50]uint8) MAVLinkMessage { +// NewStatustext returns a new Statustext +func NewStatustext(SEVERITY uint8, TEXT [50]uint8) *Statustext { m := Statustext{} m.SEVERITY = SEVERITY m.TEXT = TEXT return &m } +// Id returns the Statustext Message ID func (*Statustext) Id() uint8 { return 253 } +// Len returns the Statustext Message Length func (*Statustext) Len() uint8 { return 51 } +// Crc returns the Statustext Message CRC func (*Statustext) Crc() uint8 { return 83 } +// Pack returns a packed byte array which represents a Statustext payload func (m *Statustext) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.SEVERITY) @@ -7652,27 +9122,35 @@ func (m *Statustext) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Statustext func (m *Statustext) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.SEVERITY) binary.Read(data, binary.LittleEndian, &m.TEXT) } -const MAVLINK_MSG_STATUSTEXT_FIELD_text_LEN = 50 +const ( + MAVLINK_MSG_STATUSTEXT_FIELD_text_LEN = 50 +) +// // MESSAGE DEBUG - +// // MAVLINK_MSG_ID_DEBUG 254 +// // MAVLINK_MSG_ID_DEBUG_LEN 9 +// // MAVLINK_MSG_ID_DEBUG_CRC 46 - +// +// type Debug struct { - TIME_BOOT_MS uint32 ///< Timestamp (milliseconds since system boot) - VALUE float32 ///< DEBUG value - IND uint8 ///< index of debug variable + TIME_BOOT_MS uint32 // Timestamp (milliseconds since system boot) + VALUE float32 // DEBUG value + IND uint8 // index of debug variable } -func NewDebug(TIME_BOOT_MS uint32, VALUE float32, IND uint8) MAVLinkMessage { +// NewDebug returns a new Debug +func NewDebug(TIME_BOOT_MS uint32, VALUE float32, IND uint8) *Debug { m := Debug{} m.TIME_BOOT_MS = TIME_BOOT_MS m.VALUE = VALUE @@ -7680,18 +9158,22 @@ func NewDebug(TIME_BOOT_MS uint32, VALUE float32, IND uint8) MAVLinkMessage { return &m } +// Id returns the Debug Message ID func (*Debug) Id() uint8 { return 254 } +// Len returns the Debug Message Length func (*Debug) Len() uint8 { return 9 } +// Crc returns the Debug Message CRC func (*Debug) Crc() uint8 { return 46 } +// Pack returns a packed byte array which represents a Debug payload func (m *Debug) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS) @@ -7700,9 +9182,12 @@ func (m *Debug) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the Debug func (m *Debug) Decode(buf []byte) { data := bytes.NewBuffer(buf) binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS) binary.Read(data, binary.LittleEndian, &m.VALUE) binary.Read(data, binary.LittleEndian, &m.IND) } + +const () diff --git a/platforms/mavlink/common/mavlink.go b/platforms/mavlink/common/mavlink.go index b8e54f01..5e5d7489 100644 --- a/platforms/mavlink/common/mavlink.go +++ b/platforms/mavlink/common/mavlink.go @@ -1,9 +1,9 @@ package mavlink -/** @file - * @brief MAVLink comm protocol built from common.xml - * @see http://pixhawk.ethz.ch/software/mavlink - */ +// +// MAVLink comm protocol built from common.xml +// http://pixhawk.ethz.ch/software/mavlink +// import ( "bytes" @@ -12,14 +12,16 @@ import ( "time" ) -const MAVLINK_BIG_ENDIAN = 0 -const MAVLINK_LITTLE_ENDIAN = 1 -const MAVLINK_STX = 254 -const MAVLINK_ENDIAN = MAVLINK_LITTLE_ENDIAN -const MAVLINK_ALIGNED_FIELDS = 1 -const MAVLINK_CRC_EXTRA = 1 -const X25_INIT_CRC = 0xffff -const X25_VALIDATE_CRC = 0xf0b8 +const ( + MAVLINK_BIG_ENDIAN = 0 + MAVLINK_LITTLE_ENDIAN = 1 + MAVLINK_STX = 254 + MAVLINK_ENDIAN = MAVLINK_LITTLE_ENDIAN + MAVLINK_ALIGNED_FIELDS = 1 + MAVLINK_CRC_EXTRA = 1 + X25_INIT_CRC = 0xffff + X25_VALIDATE_CRC = 0xf0b8 +) var sequence uint16 = 0 @@ -28,6 +30,7 @@ func generateSequence() uint8 { return uint8(sequence) } +// The MAVLinkMessage interface is implemented by MAVLink messages type MAVLinkMessage interface { Id() uint8 Len() uint8 @@ -36,6 +39,7 @@ type MAVLinkMessage interface { Decode([]byte) } +// A MAVLinkPacket represents a raw packet received from a micro air vehicle type MAVLinkPacket struct { Protocol uint8 Length uint8 @@ -47,6 +51,8 @@ type MAVLinkPacket struct { Checksum uint16 } +// ReadMAVLinkPacket reads an io.Reader for a new packet and returns a new MAVLink packet +// or returns the error received by the io.Reader func ReadMAVLinkPacket(r io.Reader) (*MAVLinkPacket, error) { for { header, err := read(r, 1) @@ -72,6 +78,7 @@ func ReadMAVLinkPacket(r io.Reader) (*MAVLinkPacket, error) { } } +// CraftMAVLinkPacket returns a new MAVLinkPacket from a MAVLinkMessage func CraftMAVLinkPacket(SystemID uint8, ComponentID uint8, Message MAVLinkMessage) *MAVLinkPacket { return NewMAVLinkPacket( 0xFE, @@ -84,6 +91,7 @@ func CraftMAVLinkPacket(SystemID uint8, ComponentID uint8, Message MAVLinkMessag ) } +// NewMAVLinkPacket returns a new MAVLinkPacket func NewMAVLinkPacket(Protocol uint8, Length uint8, Sequence uint8, SystemID uint8, ComponentID uint8, MessageID uint8, Data []uint8) *MAVLinkPacket { m := &MAVLinkPacket{ Protocol: Protocol, @@ -98,10 +106,13 @@ func NewMAVLinkPacket(Protocol uint8, Length uint8, Sequence uint8, SystemID uin return m } +// MAVLinkMessage returns the decoded MAVLinkMessage from the MAVLinkPacket +// or returns an error generated from the MAVLinkMessage func (m *MAVLinkPacket) MAVLinkMessage() (MAVLinkMessage, error) { return NewMAVLinkMessage(m.MessageID, m.Data) } +// Pack returns a packed byte array which represents the MAVLinkPacket func (m *MAVLinkPacket) Pack() []byte { data := new(bytes.Buffer) binary.Write(data, binary.LittleEndian, m.Protocol) @@ -115,6 +126,7 @@ func (m *MAVLinkPacket) Pack() []byte { return data.Bytes() } +// Decode accepts a packed byte array and populates the fields of the MAVLinkPacket func (m *MAVLinkPacket) Decode(buf []byte) { m.Protocol = buf[0] m.Length = buf[1] @@ -147,15 +159,15 @@ func read(r io.Reader, length int) ([]byte, error) { return buf, nil } -/** - * @brief Accumulate the X.25 CRC by adding one char at a time. - * - * The checksum function adds the hash of one char at a time to the - * 16 bit checksum (uint16). - * - * @param data to hash - * @param crcAccum the already accumulated checksum - **/ +// +// Accumulate the X.25 CRC by adding one char at a time. +// +// The checksum function adds the hash of one char at a time to the +// 16 bit checksum (uint16). +// +// data to hash +// crcAccum the already accumulated checksum +// func crcAccumulate(data uint8, crcAccum uint16) uint16 { /*Accumulate one byte of data into the CRC*/ var tmp uint8 @@ -166,19 +178,18 @@ func crcAccumulate(data uint8, crcAccum uint16) uint16 { return crcAccum } -/** - * @brief Initiliaze the buffer for the X.25 CRC - * - */ +// +// Initiliaze the buffer for the X.25 CRC +// func crcInit() uint16 { return X25_INIT_CRC } -/** - * @brief Calculates the X.25 checksum on a byte buffer - * - * @return the checksum over the buffer bytes - **/ +// +// Calculates the X.25 checksum on a byte buffer +// +// return the checksum over the buffer bytes +// func crcCalculate(m *MAVLinkPacket) uint16 { crc := crcInit() diff --git a/platforms/mavlink/common/version.go b/platforms/mavlink/common/version.go index e8e15b6a..2432eb1d 100644 --- a/platforms/mavlink/common/version.go +++ b/platforms/mavlink/common/version.go @@ -1,11 +1,13 @@ package mavlink -/** @file - * @brief MAVLink comm protocol built from common.xml - * @see http://pixhawk.ethz.ch/software/mavlink - */ +// +// MAVLink comm protocol built from common.xml +// http://pixhawk.ethz.ch/software/mavlink +// -const MAVLINK_BUILD_DATE = "Thu Jul 31 22:19:34 2014" -const MAVLINK_WIRE_PROTOCOL_VERSION = "1.0" -const MAVLINK_MAX_DIALECT_PAYLOAD_SIZE = 255 -const MAVLINK_VERSION = 3 +const ( + MAVLINK_BUILD_DATE = "Fri Sep 26 19:23:02 2014" + MAVLINK_WIRE_PROTOCOL_VERSION = "1.0" + MAVLINK_MAX_DIALECT_PAYLOAD_SIZE = 255 + MAVLINK_VERSION = 3 +)