UNPKG

tello-custom-ip

Version:

Tello drone client with custom IP address support, forked from @0x77/tellots

85 lines 3.19 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Tello = void 0; var control_1 = __importDefault(require("./commands/control")); var read_1 = __importDefault(require("./commands/read")); var set_1 = __importDefault(require("./commands/set")); var state_1 = __importDefault(require("./streams/state")); var video_1 = __importDefault(require("./streams/video")); var config_1 = __importDefault(require("./config")); var config_2 = require("./config"); // Export types for library users __exportStar(require("./types"), exports); __exportStar(require("./streams/state.interfaces"), exports); /** * Main Tello SDK object with response parsing and typed return values * * - READ commands return structured data with appropriate types * - CONTROL/SET commands return boolean (true for 'ok', false for errors) */ exports.Tello = { /** * Set a custom IP address for the Tello drone * @param ip - The IP address to connect to (default: 192.168.10.1) */ setIP: config_1.default.setTelloIP, /** * Get the current Tello IP address * @returns The current IP address */ getIP: config_2.getTelloIP, /** * Control commands - All return boolean (true for success, false for failure) * * Examples: * - connect() - Establish connection to the drone * - takeOff() - Take off * - land() - Land the drone * - move.up(50) - Move up 50cm * - rotate.clockwise(90) - Rotate 90 degrees clockwise */ control: control_1.default, /** * Read commands - All return structured data with proper types * * Examples: * - battery() - Returns BatteryResponse {value: number} * - height() - Returns HeightResponse {value: number, unit: 'dm'} * - attitude() - Returns AttitudeResponse {pitch: number, roll: number, yaw: number, unit: '°'} */ read: read_1.default, /** * Set commands - All return boolean (true for success, false for failure) * * Examples: * - speed(50) - Set speed to 50cm/s * - wifi(ssid, password) - Set WiFi SSID and password */ set: set_1.default, /** * Receivers for state and video streams */ receiver: { state: state_1.default, video: video_1.default } }; exports.default = exports.Tello; //# sourceMappingURL=index.js.map