Skip to content

Repository files navigation

logomakr_123ujk

Build StatuscodecovnpmGitHub licenseMaintenance

Motivation

Provide an async promise based unofficial sdk for the tello drone based on the official documentation.

Installation

add it to your project using npm install tellojs --save or yarn add tellojs

Usage

this sdk provide functions when you import for the next capabilities:

constsdk=require('tellojs')constx=number,y=number,z=number,speed=number,yaw=number,start={x, y, z},end={x, y, z},ssid=string,password=string//CONTROL COMMANDSawaitsdk.control.connect()// Enter SDK mode.awaitsdk.control.takeOff()// Auto takeoff.awaitsdk.control.land()// Auto landing.awaitsdk.control.emergency()// Stop motors immediatelyawaitsdk.control.stop()// Hovers in the airawaitsdk.control.move.up(x)// Ascend to “x” cm.awaitsdk.control.move.down(x)// Descend to “x” cm.awaitsdk.control.move.left(x)// move left to “x” cm.awaitsdk.control.move.right(x)// move right to “x” cm.awaitsdk.control.move.front(x)// move forward to “x” cm.awaitsdk.control.move.back(x)// move backwards to “x” cm.awaitsdk.control.move.go(end,speed)// fly to x y z in speed (cm/s)awaitsdk.control.move.curve(start,end,speed)// fly to x y z in speed (cm/s)awaitsdk.control.rotate.clockwise(x)// rotate clockwise 'x' degrees.awaitsdk.control.rotate.counterClockwise(x)// rotate counter clockwise 'x' degrees.awaitsdk.control.flip.left()// Flip to the left.awaitsdk.control.flip.right()// Flip to the right.awaitsdk.control.flip.back()// Flip in backward.awaitsdk.control.flip.front()// Flip in forward.//SET COMMANDSawaitsdk.set.speed(x)// set speed to x cm/sawaitsdk.set.rc(x,y,z,yaw)// Send RC control via four channels.awaitsdk.set.wifi(ssid,password)// Set Wi-Fi with SSID password//READ COMMANDSawaitsdk.read.speed()// Obtain current speed (cm/s).awaitsdk.read.battery()// Obtain current battery percentage.awaitsdk.read.time()// Obtain current flight time.awaitsdk.read.height()// Obtain get height (cm)awaitsdk.read.temperature()// Obtain temperature (°C)awaitsdk.read.attitude()// Obtain IMU attitude dataawaitsdk.read.barometer()// Obtain barometer value (m)awaitsdk.read.tof()// Obtain distance value from TOF(cm)awaitsdk.read.acceleration()// Obtain IMU angular acceleration data (0.001g)awaitsdk.read.wifi()// Obtain Wi-Fi SNR.//STREAM STATEconststateEmitter=sdk.receiver.state.bind()// Binding to port of statestateEmitter.on('message',res=>console.log)// React to messages on receivedsdk.receiver.state.close()// Stop receiving messages//STREAM VIDEOconstvideoEmitter=sdk.receiver.video.bind()// Binding to port of videovideoEmitter.on('message',res=>console.log)// React to messages on receivedsdk.receiver.video.close()// Stop receiving messages/*Example output of state:{  pitch: 1, roll: 0, yaw: 0, speed: { x: 0, y: 0, z: 0 }, temperature: { low: 51, high: 53 }, tof: 6553, heigh: 0, battery: 87, barometer: 24.65, time: 0, acceleration: { x: 16, y: 3, z: -990 } }Example output of video: is binary ;)*/
Web graphic by picol from Flaticon is licensed under CC BY 3.0. Check out the new logo that I created on LogoMakr.comhttps://logomakr.com/09u4Zz

About

a package to be able to control and recieve information from the dji tello

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages