Coder Social home page Coder Social logo

tello-wrapper's Introduction

tello-wrapper

A small Java library that connects your JVM to your tello drone. Provides access to tello sdk commands, state messages and video feed. Based on Tello4J.

Getting started

Include the library in your project by adding it as a gradle source dependency:

build.gradle:

repositories {
    jcenter()
}

dependencies {
    implementation 'com.github.ele115:tello-wrapper:2.+'
}

Use the API to send instructions to your drone, receive state updates and video frames from the camera of your drone:

import com.github.ele115.tello_wrapper.ITelloDrone;
import com.github.ele115.tello_wrapper.Tello;
import com.github.ele115.tello_wrapper.tello4j.api.video.VideoWindow;
import com.github.ele115.tello_wrapper.tello4j.api.world.FlipDirection;

public class FlightPlanExample {
    public static void main(String[] args) {
        // Connect to an actual drone, or a simulated drone:
        ITelloDrone drone = Tello.Connect("59D70D");
        //                = Tello.Connect("simulator");
        // Subscribe to state updates of our drone (e.g. current speed, attitude)
        drone.addStateListener((o, n) -> {
            // Do sth. when switching from one to another state
        });
        //Create a video window to see things with our drones eyes
        drone.addVideoListener(new VideoWindow());
        // ...or use a custom video listener to process the single frames
        drone.addVideoListener(frame -> {
            //Do sth when we received a frame
        });
        // ...and tell the drone to turn on the stream
        drone.setStreaming(true);
        // Now perform a flight plan
        drone.takeoff();
        drone.forward(30);
        drone.turnLeft(90);
        drone.forward(30);
        drone.backward(30);
        drone.flip(FlipDirection.FORWARD);
        drone.turnRight(90);
        drone.backward(30);
        drone.land();
    }
}

Documentation

Refer to the javadoc of Tello4J.

Legal

Apache-2.0

Changes from Tello4J:

  • Added wrapper to get away throws
  • Added simulator
  • Integrated mac-to-ip
  • Robust transmission
  • Ping to prevent 15-second auto-landing

Development

The package is published to JFrog Bintray/ELE115/maven/tello-wrapper. To make a new release:

  1. Create a new account on JFrog Bintray.

  2. Obtain your API key.

  3. In file ~/.gradle/gradle.properties, add two lines:

    bintray.user=<your-bintray-user-name>
    bintray.key=<your-bintray-API-key>
    
  4. Ask the admin of the JFrog Bintray/ELE115 to include you as a member.

  5. Double check if the version in build.gradle is correct.

  6. Run ./gradlew bintrayUpload.

tello-wrapper's People

Contributors

alexeylavrov avatar b1f6c1c4 avatar wentzlaf avatar zechenghe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.