{"id":23360725,"url":"https://github.com/liuxuan30/telloswift","last_synced_at":"2025-04-10T10:32:44.860Z","repository":{"id":54152581,"uuid":"222345101","full_name":"liuxuan30/TelloSwift","owner":"liuxuan30","description":"DJI Tello Swift Framework powered by SwiftNIO","archived":false,"fork":false,"pushed_at":"2023-06-27T03:51:47.000Z","size":1311,"stargazers_count":20,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T09:21:17.073Z","etag":null,"topics":["dji-tello","ios","macos","swift-framework","swiftnio","tello","tello-frameworks"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liuxuan30.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-18T02:14:44.000Z","updated_at":"2025-01-28T11:11:52.000Z","dependencies_parsed_at":"2024-11-13T21:34:26.084Z","dependency_job_id":"013fd9a9-c11a-44af-bcf5-d0ad4402da08","html_url":"https://github.com/liuxuan30/TelloSwift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxuan30%2FTelloSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxuan30%2FTelloSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxuan30%2FTelloSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxuan30%2FTelloSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuxuan30","download_url":"https://codeload.github.com/liuxuan30/TelloSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dji-tello","ios","macos","swift-framework","swiftnio","tello","tello-frameworks"],"created_at":"2024-12-21T11:16:03.867Z","updated_at":"2025-04-10T10:32:44.841Z","avatar_url":"https://github.com/liuxuan30.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TelloSwift  [![Build Status](https://travis-ci.org/liuxuan30/TelloSwift.svg?branch=master)](https://travis-ci.org/liuxuan30/TelloSwift) ![License](https://img.shields.io/github/license/liuxuan30/TelloSwift) [![Codecov](https://img.shields.io/codecov/c/github/liuxuan30/TelloSwift?color=%2352CC0F)](https://codecov.io/gh/liuxuan30/TelloSwift)\nA DJI Tello(plus EDU) Swift Framework, powered by Apple's [SwiftNIO](https://github.com/apple/swift-nio)\n\n![Logo](Resources/TelloSwift.png)\n\nThere are already a lot of Tello frameworks in Python, but I don't see a decent one for Apple's platform, especially in Swift. \n\nTherefore I decided to develop this framework combining latest Swift trend and replaced traditional socket programming fashion with SwiftNIO, an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol.\n\nTelloSwift is built upon SwiftNIO purely in Swift, providing flexible protocols and All-In-One Tello class that you can use to control your Tello drone. It supports both Tello and Tello EDU/IronMan edition.\n\n## Features\n* Flexible Protocol design so you can implement your own Tello controller;\n* Event-driven duplex command handlers based on SwiftNIO, powering sync and async command execution;\n* Many useful built-in control commands to design your own flight flow;\n* Full coverage for both Tello SDK and Tello 2.0 SDK (except for swarm)\n* Provide a default H264 video decoder, more details [here](https://github.com/liuxuan30/TelloSwift/tree/master/TelloVideoDecoder) \n\n## Requirement\n* Xcode 11 / Swift 5\n* iOS \u003e= 12.0\n* macOS \u003e= 10.15*\n* Ubuntu**\n\n\\*For simplicity and Catalyst, I choose 10.15, but the source code itself should support macOS since 10.13, aligned with SwiftNIO's requirement.\n\n\\*\\* For Linux OS, refer Swift and SwiftNIO compatibility. \n\n## Installation\nJust grab the source code, or add Swift package by\n```swift\ndependencies: [\n    .package(url: \"https://github.com/liuxuan30/TelloSwift.git\")\n]\n```\nOr, if your project is set up as an Xcode project and you're using Xcode 11+, you can add TelloSwift as a dependency to your Xcode project by clicking File -\u003e Swift Packages -\u003e Add Package Dependency.\n\n## How to use it\nTo use Tello you just have to create Tello object, like\n```swift\nlet tello = Tello()\n\nprint(\"connected:\", tello.activate())\n\nprint(\"battery:\", tello.battery)\nif tello.battery \u003c 20 {\n    tello.shutdown()\n    print(\"battery too low\")\n}\n\nprint(tello.speed)\n```\nBy default, Tello is initialized as EDU version. If your drone is not EDU, just use another initializer such as\n```swift\npublic convenience init(localAddr: String, localPort: Int, EDU: Bool)\n```\n\nThere are several convenience initializer for your favorite.\n\nTo take off, first invoke `tello.activate()` and then simply call `tello.takeoff()`, or use convenient method:\n```swift\ntakeoffAnd(operation: @escaping () -\u003e Void)\n```\nYou can even chain the command:\n```swift\ntello.chain(\"takeoff\").chain(\"forward 20\", failover: .hover).chain(\"land\")\n```\nAfter you finished playing with your drone, simply call `tello.shutdown()`, which will close the channel and free NIO event loop resources.\n\n**Note you should always call `shutdown()` before Tello object get deallocated.** Otherwise the threads and already associated file descriptors could be leaked.\n\n## Architecture\nTello is assembled with multiple protocols.\n\n### TelloCommandHandler and TelloCommander\nWhat if the existing methods could not meet my demand?\n\nAt the heart of TelloSwift, TelloCommander is resonsible for sending tello commands either in sync or async mode. Behind the scene, TelloCommandHandler is a duplex ChannelHander, mirroring from `RequestResponseHandler` in `swift-nio-extras`.\n\nYou can replace them with your own implementations, or just get the promise from `TelloCommander.dispatchCommand()`. You can find more about `EventLoopPromise` from [NIO documentation](https://apple.github.io/swift-nio/docs/current/NIO/Structs/EventLoopPromise.html)\n\n### TelloMotion, TelloFlightControl and MissionPadControl protocol\nThese protocols encapsulate commands for tello flight control. To turn on mission pad detection, simply call `tello.enable(detection: true` and `setDirection(direction: .both)`\n\nFor single flight commands taking distance argument, if the distance exceeds max value, it will automatically mod (max value + 1), if it's less then min value, it will return false. For commands only takes angles, it will mod 361.\n\nFor flight commands that involves both speed and distance like go/curve/jump, for safety purpose, TelloSwift will check if the parameter falls in to the valid range. It would also check if the command requires Tello EDU. If not satisfied, command would return false.\n\n###  TelloState and DroneTello protocol\nTelloState is the delegate protocol for receiving tello state raw string from UDP packets. Currently there are no further processing about the state string.\nDroneTello is for obtaining the Tello state in real time.\nTo turn on state reporting, set `stateDelegate`.\n\n### TelloVideoSteam and CameraControl protocol\nIt will directly forward the raw stream bytes to the delegate. To turn on the camera, just call `tello.enable(video: true)`\n\n## TODO list\n1. Swarm support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuxuan30%2Ftelloswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuxuan30%2Ftelloswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuxuan30%2Ftelloswift/lists"}