Code Monkey home page Code Monkey logo

javascript-drones's Introduction

JavaScript Drones!

Watch the videos:

Part 1 → https://www.youtube.com/watch?v=JzFvGf7Ywkk

Part 2 → https://www.youtube.com/watch?v=ozMwRq-IT2w

⚠️️️ ⚠️ ️️⚠️️️ Use the codebase as your own risk. The drone can hurt you and I'm not responsible for that. Always test commands with the props removed first. Don't be dumb. ⚠️️️ ⚠️️️ ⚠️️️

Flying a Drone with React and Node.js

IBM is giving away 2,000 DJI Tello drones as part of a contest and I made this video to help them promote it.

Software Used

  • React (with React Hooks!)
  • Styled Components for styling
  • Node.js and UDP4 sockets for communicating with drone
  • Socket.io WebSockets for sending data to/from the browser
  • Next.js for easy react setup

Hardware Used

Using This Code

Frontend

  1. cd frontend
  2. npm install
  3. npm run dev

Backend

  1. cd backend
  2. npm install
  3. connect to drone via wifi
  4. npm start

Troubleshooting

Docs for Tello are available here

I had to update the firmware of my drone when it came in the mail before I could use this 1.3 API. Do this via the Tello app on your phone.

If you let the drone's WIFI connection lapse, you have to restart the server by typing rs into the terminal. This will re-run the command command that puts the drone in SDK mode. If you don't do this, it will ignore any commands you send it.

License — WTFPL

I want you to build cool stuff with this.

Please hack on it and make your own cool things.

Examples & Resources

javascript-drones's People

Contributors

dnomak avatar herrfugbaum avatar kerstinmaur avatar shadrach-tayo avatar spalmella avatar vincenthelwig avatar wesbos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-drones's Issues

drone cluster

Is it possible to drive multiple drone in same time as a cluster?

Take off command throws undefined error

Just started hacking this together. I'm receiving all the data from the drone but I cant seem to send anything to the drone. It also says I'm disconnected but clearly I'm getting connected to one of the ports or else I wouldn't be able to get the pitch, roll, etc...

Is there something I missed or a better way to handle and track errors?

Also is there a link to download the videos so I can watch them without switching between wifi's.

Cant start frontend

TypeError: Cannot read property 'current' of undefined
at Object. (C:\mplayer\javascript-drones\frontend\node_modules\react-ssr-prepass\dist\react-ssr-prepass.development.js:842:45)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (C:\mplayer\javascript-drones\frontend\node_modules\react-ssr-prepass\index.js:4:20)
at Module._compile (internal/modules/cjs/loader.js:689:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: next -p 7777
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Drone lands itself after a few seconds without command

Im finding my drone will land itself and start flashing red light (even when battery is 100%) after a few seconds of being in the air without a command. It will ignore any further commands until it has landed but is still sending through status updates. Is anybody else finding this?

Frontend is not functional on Linux

forrestblade@pop-os:~/javascript-drones/frontend$ npm run dev

> [email protected] dev /home/forrestblade/javascript-drones/frontend
> next -p 7777

[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:7777 ...
TypeError: Cannot read property 'current' of undefined
    at Object.<anonymous> (/home/forrestblade/javascript-drones/frontend/node_modules/react-ssr-prepass/dist/react-ssr-prepass.development.js:842:45)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/forrestblade/javascript-drones/frontend/node_modules/react-ssr-prepass/index.js:4:20)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `next -p 7777`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Maybe I'm just missing something, but everything is installed and it should be working. What version of node was this developed on?

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.