UNPKG

mavlink-mappings

Version:
226 lines 10.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.REGISTRY = exports.AutopilotVersion = exports.GlobalPositionInt = exports.FirmwareVersionType = exports.MavProtocolCapability = exports.MavBool = void 0; const mavlink_1 = require("./mavlink"); /** * Enum used to indicate true or false (also: success or failure, enabled or disabled, active or * inactive). */ var MavBool; (function (MavBool) { /** * False. */ MavBool[MavBool["FALSE"] = 0] = "FALSE"; /** * True. */ MavBool[MavBool["TRUE"] = 1] = "TRUE"; })(MavBool = exports.MavBool || (exports.MavBool = {})); /** * Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this * capability. */ var MavProtocolCapability; (function (MavProtocolCapability) { /** * Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and * autopilots should use MISSION_ITEM_INT instead. */ MavProtocolCapability[MavProtocolCapability["MISSION_FLOAT"] = 1] = "MISSION_FLOAT"; /** * Autopilot supports the new param float message type. */ MavProtocolCapability[MavProtocolCapability["PARAM_FLOAT"] = 2] = "PARAM_FLOAT"; /** * Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be * set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than * MISSION_ITEM, which is deprecated). */ MavProtocolCapability[MavProtocolCapability["MISSION_INT"] = 4] = "MISSION_INT"; /** * Autopilot supports COMMAND_INT scaled integer message type. */ MavProtocolCapability[MavProtocolCapability["COMMAND_INT"] = 8] = "COMMAND_INT"; /** * Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: * https://mavlink.io/en/services/parameter.html#parameter-encoding. Note that either this flag or * MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported. */ MavProtocolCapability[MavProtocolCapability["PARAM_ENCODE_BYTEWISE"] = 16] = "PARAM_ENCODE_BYTEWISE"; /** * Autopilot supports the File Transfer Protocol v1: https://mavlink.io/en/services/ftp.html. */ MavProtocolCapability[MavProtocolCapability["FTP"] = 32] = "FTP"; /** * Autopilot supports commanding attitude offboard. */ MavProtocolCapability[MavProtocolCapability["SET_ATTITUDE_TARGET"] = 64] = "SET_ATTITUDE_TARGET"; /** * Autopilot supports commanding position and velocity targets in local NED frame. */ MavProtocolCapability[MavProtocolCapability["SET_POSITION_TARGET_LOCAL_NED"] = 128] = "SET_POSITION_TARGET_LOCAL_NED"; /** * Autopilot supports commanding position and velocity targets in global scaled integers. */ MavProtocolCapability[MavProtocolCapability["SET_POSITION_TARGET_GLOBAL_INT"] = 256] = "SET_POSITION_TARGET_GLOBAL_INT"; /** * Autopilot supports terrain protocol / data handling. */ MavProtocolCapability[MavProtocolCapability["TERRAIN"] = 512] = "TERRAIN"; /** * Reserved for future use. */ MavProtocolCapability[MavProtocolCapability["RESERVED3"] = 1024] = "RESERVED3"; /** * Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination). */ MavProtocolCapability[MavProtocolCapability["FLIGHT_TERMINATION"] = 2048] = "FLIGHT_TERMINATION"; /** * Autopilot supports onboard compass calibration. */ MavProtocolCapability[MavProtocolCapability["COMPASS_CALIBRATION"] = 4096] = "COMPASS_CALIBRATION"; /** * Autopilot supports MAVLink version 2. */ MavProtocolCapability[MavProtocolCapability["MAVLINK2"] = 8192] = "MAVLINK2"; /** * Autopilot supports mission fence protocol. */ MavProtocolCapability[MavProtocolCapability["MISSION_FENCE"] = 16384] = "MISSION_FENCE"; /** * Autopilot supports mission rally point protocol. */ MavProtocolCapability[MavProtocolCapability["MISSION_RALLY"] = 32768] = "MISSION_RALLY"; /** * Reserved for future use. */ MavProtocolCapability[MavProtocolCapability["RESERVED2"] = 65536] = "RESERVED2"; /** * Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: * https://mavlink.io/en/services/parameter.html#parameter-encoding. Note that either this flag or * MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported. */ MavProtocolCapability[MavProtocolCapability["PARAM_ENCODE_C_CAST"] = 131072] = "PARAM_ENCODE_C_CAST"; /** * This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other * messages can be requested. */ MavProtocolCapability[MavProtocolCapability["COMPONENT_IMPLEMENTS_GIMBAL_MANAGER"] = 262144] = "COMPONENT_IMPLEMENTS_GIMBAL_MANAGER"; /** * Component supports locking control to a particular GCS independent of its system (via * MAV_CMD_REQUEST_OPERATOR_CONTROL). */ MavProtocolCapability[MavProtocolCapability["COMPONENT_ACCEPTS_GCS_CONTROL"] = 524288] = "COMPONENT_ACCEPTS_GCS_CONTROL"; /** * Autopilot has a connected gripper. MAVLink Grippers would set MAV_TYPE_GRIPPER instead. */ MavProtocolCapability[MavProtocolCapability["GRIPPER"] = 1048576] = "GRIPPER"; })(MavProtocolCapability = exports.MavProtocolCapability || (exports.MavProtocolCapability = {})); /** * These values define the type of firmware release. These values indicate the first version or release * of this type. For example the first alpha release would be 64, the second would be 65. */ var FirmwareVersionType; (function (FirmwareVersionType) { /** * development release */ FirmwareVersionType[FirmwareVersionType["DEV"] = 0] = "DEV"; /** * alpha release */ FirmwareVersionType[FirmwareVersionType["ALPHA"] = 64] = "ALPHA"; /** * beta release */ FirmwareVersionType[FirmwareVersionType["BETA"] = 128] = "BETA"; /** * release candidate */ FirmwareVersionType[FirmwareVersionType["RC"] = 192] = "RC"; /** * official stable release */ FirmwareVersionType[FirmwareVersionType["OFFICIAL"] = 255] = "OFFICIAL"; })(FirmwareVersionType = exports.FirmwareVersionType || (exports.FirmwareVersionType = {})); /** * The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame * (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not * sufficient. */ class GlobalPositionInt extends mavlink_1.MavLinkData { constructor() { super(); this.timeBootMs = 0; this.lat = 0; this.lon = 0; this.alt = 0; this.relativeAlt = 0; this.vx = 0; this.vy = 0; this.vz = 0; this.hdg = 0; } } exports.GlobalPositionInt = GlobalPositionInt; GlobalPositionInt.MSG_ID = 33; GlobalPositionInt.MSG_NAME = 'GLOBAL_POSITION_INT'; GlobalPositionInt.PAYLOAD_LENGTH = 28; GlobalPositionInt.MAGIC_NUMBER = 104; GlobalPositionInt.FIELDS = [ new mavlink_1.MavLinkPacketField('time_boot_ms', 'timeBootMs', 0, false, 4, 'uint32_t', 'ms'), new mavlink_1.MavLinkPacketField('lat', 'lat', 4, false, 4, 'int32_t', 'degE7'), new mavlink_1.MavLinkPacketField('lon', 'lon', 8, false, 4, 'int32_t', 'degE7'), new mavlink_1.MavLinkPacketField('alt', 'alt', 12, false, 4, 'int32_t', 'mm'), new mavlink_1.MavLinkPacketField('relative_alt', 'relativeAlt', 16, false, 4, 'int32_t', 'mm'), new mavlink_1.MavLinkPacketField('vx', 'vx', 20, false, 2, 'int16_t', 'cm/s'), new mavlink_1.MavLinkPacketField('vy', 'vy', 22, false, 2, 'int16_t', 'cm/s'), new mavlink_1.MavLinkPacketField('vz', 'vz', 24, false, 2, 'int16_t', 'cm/s'), new mavlink_1.MavLinkPacketField('hdg', 'hdg', 26, false, 2, 'uint16_t', 'cdeg'), ]; /** * Version and capability of autopilot software. This should be emitted in response to a request with * MAV_CMD_REQUEST_MESSAGE. */ class AutopilotVersion extends mavlink_1.MavLinkData { constructor() { super(); this.capabilities = MavProtocolCapability[Object.keys(MavProtocolCapability)[0]]; this.flightSwVersion = 0; this.middlewareSwVersion = 0; this.osSwVersion = 0; this.boardVersion = 0; this.flightCustomVersion = []; this.middlewareCustomVersion = []; this.osCustomVersion = []; this.vendorId = 0; this.productId = 0; this.uid = BigInt(0); this.uid2 = []; } } exports.AutopilotVersion = AutopilotVersion; AutopilotVersion.MSG_ID = 148; AutopilotVersion.MSG_NAME = 'AUTOPILOT_VERSION'; AutopilotVersion.PAYLOAD_LENGTH = 78; AutopilotVersion.MAGIC_NUMBER = 178; AutopilotVersion.FIELDS = [ new mavlink_1.MavLinkPacketField('capabilities', 'capabilities', 0, false, 8, 'uint64_t', ''), new mavlink_1.MavLinkPacketField('uid', 'uid', 8, false, 8, 'uint64_t', ''), new mavlink_1.MavLinkPacketField('flight_sw_version', 'flightSwVersion', 16, false, 4, 'uint32_t', ''), new mavlink_1.MavLinkPacketField('middleware_sw_version', 'middlewareSwVersion', 20, false, 4, 'uint32_t', ''), new mavlink_1.MavLinkPacketField('os_sw_version', 'osSwVersion', 24, false, 4, 'uint32_t', ''), new mavlink_1.MavLinkPacketField('board_version', 'boardVersion', 28, false, 4, 'uint32_t', ''), new mavlink_1.MavLinkPacketField('vendor_id', 'vendorId', 32, false, 2, 'uint16_t', ''), new mavlink_1.MavLinkPacketField('product_id', 'productId', 34, false, 2, 'uint16_t', ''), new mavlink_1.MavLinkPacketField('flight_custom_version', 'flightCustomVersion', 36, false, 1, 'uint8_t[]', '', 8), new mavlink_1.MavLinkPacketField('middleware_custom_version', 'middlewareCustomVersion', 44, false, 1, 'uint8_t[]', '', 8), new mavlink_1.MavLinkPacketField('os_custom_version', 'osCustomVersion', 52, false, 1, 'uint8_t[]', '', 8), new mavlink_1.MavLinkPacketField('uid2', 'uid2', 60, true, 1, 'uint8_t[]', '', 18), ]; exports.REGISTRY = { 33: GlobalPositionInt, 148: AutopilotVersion, }; //# sourceMappingURL=standard.js.map