All Projects → gandhimonik → DroneJS

gandhimonik / DroneJS

Licence: Apache-2.0 license
A Node.js based library for controlling a Parrot minidrone. This library also provides the feature to take pictures from the drone, download them all at a time and delete them whenever required.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to DroneJS

home assistant-ble
Companion application for home-assistant, sending bluetooth low energy detection
Stars: ✭ 21 (+10.53%)
Mutual labels:  bluetooth, bluetooth-low-energy
Gatt Python
Bluetooth GATT SDK for Python
Stars: ✭ 233 (+1126.32%)
Mutual labels:  bluetooth, bluetooth-low-energy
Continuity
Apple Continuity Protocol Reverse Engineering and Dissector
Stars: ✭ 180 (+847.37%)
Mutual labels:  bluetooth, bluetooth-low-energy
H Ble
Android Ble类库,基于回调,暴露搜索、连接、发送、接收、断开连接等接口,无需关心细节操作即可进行Ble通信。
Stars: ✭ 171 (+800%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble-serial
"RFCOMM for BLE" a UART over Bluetooth low energy (4.0+) bridge for Linux, Mac and Windows
Stars: ✭ 134 (+605.26%)
Mutual labels:  bluetooth, bluetooth-low-energy
Reactivebeacons
Android library scanning BLE beacons nearby with RxJava
Stars: ✭ 171 (+800%)
Mutual labels:  bluetooth, bluetooth-low-energy
Python Bluezero
A simple Python interface to Bluez
Stars: ✭ 222 (+1068.42%)
Mutual labels:  bluetooth, bluetooth-low-energy
Bluetonium
Bluetooth mapping in Swift
Stars: ✭ 159 (+736.84%)
Mutual labels:  bluetooth, bluetooth-low-energy
angular-web-bluetooth-starter
A Starter for the Angular Web Bluetooth module
Stars: ✭ 15 (-21.05%)
Mutual labels:  bluetooth, bluetooth-low-energy
bluetooth-terminal
ES6 class for serial communication with your own Bluetooth Low Energy (Smart) devices
Stars: ✭ 43 (+126.32%)
Mutual labels:  bluetooth, bluetooth-low-energy
Bluetoothkit
Easily communicate between iOS/OSX devices using BLE
Stars: ✭ 2,027 (+10568.42%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble
Bluetooth Low Energy for Linux / macOS
Stars: ✭ 264 (+1289.47%)
Mutual labels:  bluetooth, bluetooth-low-energy
Airpodsbattery Monitor For Mac
Simple Widget to display your AirPods battery levels from the Mac Status bar
Stars: ✭ 165 (+768.42%)
Mutual labels:  bluetooth, bluetooth-low-energy
Androidbluetoothlibrary
A Library for easy implementation of Serial Bluetooth Classic and Low Energy on Android. 💙
Stars: ✭ 171 (+800%)
Mutual labels:  bluetooth, bluetooth-low-energy
Angular Web Bluetooth
The missing Web Bluetooth module for Angular
Stars: ✭ 164 (+763.16%)
Mutual labels:  bluetooth, bluetooth-low-energy
Radareeye
A tool made for specially scanning nearby devices[BLE, Bluetooth & Wifi] and execute our given command on our system when the target device comes in-between range.
Stars: ✭ 218 (+1047.37%)
Mutual labels:  bluetooth, bluetooth-low-energy
Easyble
Android BLE framework
Stars: ✭ 155 (+715.79%)
Mutual labels:  bluetooth, bluetooth-low-energy
Node Ble
Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
Stars: ✭ 159 (+736.84%)
Mutual labels:  bluetooth, bluetooth-low-energy
Bluetooth
Cross-platform Bluetooth API for Go and TinyGo.
Stars: ✭ 246 (+1194.74%)
Mutual labels:  bluetooth, bluetooth-low-energy
py-bluetooth-utils
Python module containing bluetooth utility functions, in particular for easy BLE scanning and advertising
Stars: ✭ 60 (+215.79%)
Mutual labels:  bluetooth, bluetooth-low-energy

DroneJS

A Node.js based library for controlling a Parrot minidrone. The library also provides the feature to take pictures from the drone, download them all at a time and delete them whenever required. The library follows Bluetooth LE networking protocol to connect to the drone.

Drones Supported

  • Parrot Rolling Spider
  • Parrot Airborne Night Maclane
  • Parrot Airborne Night Blaze
  • Parrot Airborne Night Swat
  • Parrot Airborne Cargo Mars
  • Parrot Airborne Cargo Travis

Prerequisites

Install


npm install dronejs

Usage

Connect

To connect to drone, you need to instantiate the MiniDrone class and then call its connect method.

var minidrone = require('dronejs');

minidrone.connect('RS_')
        .then()
        .catch((e) => {
            console.log('Error occurred: ' + e);
        });

Setup Navdata Stream

To listen to the navigation data from the drone, you need to call the getNavDataStream function and then subscribe to the object returned from it.

var minidrone = require('dronejs');

var navDataStream = minidrone.getNavDataStream();
navDataStream.subscribe((data) => {
        console.log(data);
    },
    err => debug(err),
    () => debug('complete'));


minidrone.connect('RS_')
    .then(() => minidrone.checkAllStates())
    .then()
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });

Basic Maneuvers

var minidrone = require('dronejs');

var navDataStream = minidrone.getNavDataStream();
navDataStream.subscribe((data) => {
        console.log(data);
    },
    err => debug(err),
    () => debug('complete'));


minidrone.connect('RS_')
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.takeOff())
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.forward(50, 5))
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.land())
    .then()
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });

Take Picture

var minidrone = require('dronejs');

var navDataStream = minidrone.getNavDataStream();
navDataStream.subscribe((data) => {
        console.log(data);
    },
    err => debug(err),
    () => debug('complete'));


minidrone.connect('RS_')
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.takeOff())
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.takePicture())
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.land())
    .then()
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });

Download Pictures

var minidrone = require('dronejs');

minidrone.connect('RS_')
    .then(() => minidrone.listAllPictures())
    .then(pictures => minidrone.downloadPicture(pictures[0], 'output'))
    .then(response => {
        if (response === 'success') {
            console.log('picture downloaded successfully...');
        }
    })
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });

Delete Picture

var minidrone = require('dronejs');

minidrone.connect('RS_')
    .then(() => minidrone.listAllPictures())
    .then(pictures => minidrone.deletePicture(pictures[0]))
    .then(response => {
        if (response === 'success') {
            console.log('picture deleted successfully...');
        }
    })
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });

API

  • drone.connect(droneIdentifier)

    Connect the device to the drone.

    droneIdentifier - Local name of the drone as per the advertisement through Bluetooth or UUID of the drone.

  • getNavDataStream()

    Get the stream of navigation data from the drone.

  • checkAllStates()

    Check the device state including the battery percentage.

  • flatTrim()

    Stabilize the drone.

  • takeOff()

    Do a drone take off

  • turnLeft(intensity, frequency)

    Turn the drone to left

    intensity - Intensity with which the turn should happen.

    frequency - Number of times drone should perform this action.

  • turnRight(intensity, frequency)

    Turn the drone to right

    intensity - Intensity with which the turn should happen.

    frequency - Number of times drone should perform this action.

  • backward(intensity, frequency)

    Move the drone backward

    intensity - Intensity with which the turn should happen.

    frequency - Number of times drone should perform this action.

  • forward(intensity, frequency)

    Move the drone forward

    intensity - Intensity with which the turn should happen.

    frequency - Number of times drone should perform this action.

  • left(intensity, frequency)

    Move the drone to left

    intensity - Intensity with which the turn should happen.

    frequency - Number of times drone should perform this action.

  • right(intensity, frequency)

    Move the drone to right

    intensity - Intensity with which the turn should happen.

    frequency - Number of times drone should perform this action.

  • frontFlip()

    Make the drone do a front flip

  • backFlip()

    Make the drone do a back flip

  • rightFlip()

    Make the drone do a right flip

  • leftFlip()

    Make the drone do a left flip

  • takePicture()

    Take the picture from the drone during flight

  • listAllPictures()

    List all the pictures taken from the drone

  • downloadPicture(name, downloadPath)

    Download a picture

    name - Name of the picture as per the one returned while calling listAllPictures.

    downloadPath - Folder path to store the picture.

  • deletePicture(name)

    Delete a picture

    name - Name of the picture as per the one returned while calling listAllPictures.

  • land()

    Make the drone land

  • disconnect()

    Disconnect the drone

  • enableLogging([ dir ])

    Enable logging

    dir - Optional. Directory to store the logs. If not specified then logs would get printed in the console.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].