Coder Social home page Coder Social logo

drone's Introduction

Drone

programming the parrat AR Drone with node.

Getting started

Connect to your drone wifi and try out various programs.

Programs

This section introduces various programs to try out. They all work by the following principle.

node <section_name>

read_data.js

This logs navigation data to standard out. You can expect a stream of the following output.

{ header: 1432778632,
  droneState:
   { flying: 0,
     videoEnabled: 0,
     visionEnabled: 0,
     controlAlgorithm: 0,
     altitudeControlAlgorithm: 1,
     startButtonState: 0,
     controlCommandAck: 0,
     cameraReady: 1,
     travellingEnabled: 0,
     usbReady: 0,
     navdataDemo: 1,
     navdataBootstrap: 1,
     motorProblem: 0,
     communicationLost: 0,
     softwareFault: 0,
     lowBattery: 0,
     userEmergencyLanding: 0,
     timerElapsed: 0,
     MagnometerNeedsCalibration: 0,
     anglesOutOfRange: 0,
     tooMuchWind: 0,
     ultrasonicSensorDeaf: 0,
     cutoutDetected: 0,
     picVersionNumberOk: 1,
     atCodecThreadOn: 1,
     navdataThreadOn: 1,
     videoThreadOn: 1,
     acquisitionThreadOn: 1,
     controlWatchdogDelay: 0,
     adcWatchdogDelay: 0,
     comWatchdogProblem: 0,
     emergencyLanding: 0 },
  sequenceNumber: 2790,
  visionFlag: 1 }

By adding any argument to the commandline call the full data is generate. E.g.

node read_data.js full

results in a stream of data like

{ header: 1432778632,
  droneState:
   { flying: 0,
     videoEnabled: 0,
     visionEnabled: 0,
     controlAlgorithm: 0,
     altitudeControlAlgorithm: 1,
     startButtonState: 0,
     controlCommandAck: 1,
     cameraReady: 1,
     travellingEnabled: 0,
     usbReady: 0,
     navdataDemo: 1,
     navdataBootstrap: 0,
     motorProblem: 0,
     communicationLost: 0,
     softwareFault: 0,
     lowBattery: 0,
     userEmergencyLanding: 0,
     timerElapsed: 1,
     MagnometerNeedsCalibration: 0,
     anglesOutOfRange: 1,
     tooMuchWind: 0,
     ultrasonicSensorDeaf: 0,
     cutoutDetected: 0,
     picVersionNumberOk: 1,
     atCodecThreadOn: 1,
     navdataThreadOn: 1,
     videoThreadOn: 1,
     acquisitionThreadOn: 1,
     controlWatchdogDelay: 0,
     adcWatchdogDelay: 0,
     comWatchdogProblem: 0,
     emergencyLanding: 1 },
  sequenceNumber: 97673,
  visionFlag: 0,
  demo:
   { controlState: 'CTRL_DEFAULT',
     flyState: 'FLYING_OK',
     batteryPercentage: 34,
     rotation:
      { frontBack: 0.821,
        pitch: 0.821,
        theta: 0.821,
        y: 0.821,
        leftRight: -4.962,
        roll: -4.962,
        phi: -4.962,
        x: -4.962,
        clockwise: -7.003,
        yaw: -7.003,
        psi: -7.003,
        z: -7.003 },
     frontBackDegrees: 0.821,
     leftRightDegrees: -4.962,
     clockwiseDegrees: -7.003,
     altitude: 0,
     altitudeMeters: 0,
     velocity: { x: 0, y: 0, z: 0 },
     xVelocity: 0,
     yVelocity: 0,
     zVelocity: 0,
     frameIndex: 0,
     detection: { camera: [Object], tagIndex: 0 },
     drone: { camera: [Object] } },
  visionDetect:
   { nbDetected: 0,
     type: [ 0, 0, 0, 0 ],
     xc: [ 0, 0, 0, 0 ],
     yc: [ 0, 0, 0, 0 ],
     width: [ 0, 0, 0, 0 ],
     height: [ 0, 0, 0, 0 ],
     dist: [ 0, 0, 0, 0 ],
     orientationAngle: [ 0, 0, 0, 0 ],
     rotation: [ [Object], [Object], [Object], [Object] ],
     translation: [ [Object], [Object], [Object], [Object] ],
     cameraSource: [ 0, 0, 0, 0 ] } }

animate_leds

node animate_leds [0-20]

will animate the leds with the following pattern.

[
  /*  0 */ 'blank',
  /*  1 */ 'blinkGreen',
  /*  2 */ 'blinkGreenRed',
  /*  3 */ 'blinkOrange',
  /*  4 */ 'blinkRed',
  /*  5 */ 'blinkStandard',
  /*  6 */ 'doubleMissile',
  /*  7 */ 'fire',
  /*  8 */ 'frontLeftGreenOthersRed',
  /*  9 */ 'frontRightGreenOthersRed',
  /* 10 */ 'green',
  /* 11 */ 'leftGreenRightRed',
  /* 12 */ 'leftMissile',
  /* 13 */ 'leftRedRightGreen',
  /* 14 */ 'rearLeftGreenOthersRed',
  /* 15 */ 'rearRightGreenOthersRed',
  /* 16 */ 'red',
  /* 17 */ 'redSnake',
  /* 18 */ 'rightMissile',
  /* 19 */ 'snakeGreenRed',
  /* 20 */ 'standard'
];

drone's People

Contributors

dvberkel avatar

Watchers

 avatar James Cloos avatar  avatar

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.