simple version of coptermanager
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
arduino
examples
src
.gitignore
CREDITS
LICENSE
README.md
bower.json
gulpfile.js
package.json
start-repl.js
start-server.js

README.md

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