Skip to content

dfodel/coptermanager-simple

 
 

Repository files navigation

Coptermanager Simple

Control your quadrocopter with JavaScript.

Requirements

  • Arduino board (tested with Arduino Due) and A7105 chip
  • node.js and npm
  • bower (install with npm install -g bower)
  • gulp (install with npm install -g gulp)

Setup instructions

  1. Follow the instructions to build the transmitter station with a small modification:
  • instead of 3 wire SPI use 4 wire SPI:
  • skip step 10 "Put an additional wire from the 'SDIO' pin of the A7105 to the 'MISO' pin of the due."
  • instead wire 'gio1' of the A7105 chip to the 'MISO' port of the arduino due
  • test some resistor values (as written in the tutorial) - mine didn't work with 22K Ohm, but it works with 10K Ohm
  1. Clone this repository

  2. Open arduino/arduino.ino with the arduino IDE and send it to your arduino board

  3. Execute bower install, npm install, npm link and npm link coptermanager-simple

  4. Run node start-repl.js

Usage

There are 4 ways to interact with the drone:

  1. Issue commands in the node.js REPL: start the REPL with node start-repl.js and then execute commands like client.takeoff(), client.throttle(30), ...
  2. Control the drone with your keyboard: open the webapp at http://localhost:3000/copter/keyboard
  3. Upload code in the webapp: open http://localhost:3000/copter/code in your browser
  4. Execute autonomous scripts: see the examples directory

Code example

var coptermanager = require('coptermanager-simple');
var client = new coptermanager.Client({serialport: '/dev/tty.usbmodem1411'});

client.bind(function() {

  client.takeoff()
  .after(5000, function() {
    this.elevator(112);
  })
  .after(1000, function() {
    this.ledOff();
  })
  .after(1000, function() {
    this.land();
  })
  .after(1000, function() {
    this.disconnect();
  });

});

More examples

About

simple version of coptermanager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 44.1%
  • CoffeeScript 29.8%
  • HTML 8.5%
  • C 8.2%
  • JavaScript 6.6%
  • CSS 2.8%