Giter VIP home page Giter VIP logo

dronelib-camerasupport's Introduction

THIS DOES NOT CURRENTLY WORK!!

If you want to use this, please download from the guy who initally created this library.

dronelib-CameraSupport

This is a fork of the dronelib library intended for controlling a Ultra-X + WiFi drone, but with wifi support. This library was tested also on a Ultra-X + WiFi drone BUT it should also work on other drones, provided that it works with the Ultra-X + WiFi app

Some possible drones are: Propel 1890, The Voyage Aeronautics VA-2750, The Asend Aeronautics 2000 series and The Asend Aeronautics hover hawk

Features

  • Move your drone (throttle, direction, turning)
  • Auto take-off
  • Calibrate gyro
  • Unlock motor

Example

First, make sure you are connected to your drone's AP.

const { Drone } = require('dronelib')

const drone = new Drone()

// Enabling will start sending commands to your drone
// and the lights on it should stop blinking
drone.enable()

// Take flight!
drone.takeOff()

Fields

throttle

This is the current throttle of the drone. It ranges from 0-254. Equivalent to pushing the left stick up or down.

Set it below 128 to make it go down, set it above 128 to make it go up.

// FULL THROTTLE!
drone.throttle = 254

turn

The current turn value of the drone. It ranges from 0-254. Equivalent to pushing the left stick left or right.

Set it below 128 to make it turn left, set it above 128 to make it turn right.

// Spin left!
drone.turn = 0

forwardBackward

The current forward/backward direction value of the drone. It ranges from 0-254. Equivalent to pushing the right stick up or down.

Set it below 128 to make it go forward, set it above 128 to make it go backward.

// I hope it doesn't run into any trees
drone.forwardBackward = 254

leftRight

The current left/right direction value of the drone. It ranges from 0-254. Equivalent to pushing the right stick left or right.

Set it below 128 to make it go left, set it above 128 to make it go right.

// Moves the drone slightly left
drone.leftRight = 100

currentCommand

The command that is currently being sent to the drone. You probably shouldn't touch this directly, and instead use one of the provided command methods.

Methods

enable()

Use this method to start sending commands to the drone. While enabled, this library will send a message to the drone every 100ms. This is how the drone knows it hasn't disconnected from the client.

disable()

Use this method to stop sending commands to the drone.

takeOff()

Take flight! This is equivalent to pressing the "Auto Take-Off/Land" button.

land()

Fall with style! This is equivalent to pressing the "Auto Take-Off/Land" button.

calibrateGyro()

Calibrate the drone's gyro. The user should put the drone on a flat surface before this is called.

toggleMotorLock()

Toggle the drone's motor lock. This enables/disables the altitude lock. There's no way to programmatically determine whether it is enabled or disabled.

License

This project is licensed under the GNU GPL v3.

dronelib-camerasupport's People

Contributors

vsjnk avatar tjhorner 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.