Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
近藤健
authored and
近藤健
committed
Jun 20, 2014
1 parent
2339c10
commit 3699aed
Showing
10 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/node_modules/ | ||
npm-debug.log | ||
*.swp | ||
*.swo | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
var express = require('express') | ||
, routes = require('./routes') | ||
, app = express() | ||
, path = require('path') | ||
, server = require("http").createServer(app) | ||
; | ||
|
||
|
||
app.configure(function () { | ||
app.set('views', __dirname + '/views'); | ||
app.set('view engine', 'jade', { pretty: true }); | ||
app.use(express.favicon()); | ||
app.use(express.logger('dev')); | ||
app.use(app.router); | ||
app.use(express.static(path.join(__dirname, 'public'))); | ||
}); | ||
|
||
app.configure('development', function () { | ||
app.use(express.errorHandler()); | ||
app.locals.pretty = true; | ||
}); | ||
|
||
app.get('/', routes.index); | ||
|
||
/* | ||
* Important: | ||
* | ||
* pass in the server object to listen, not the express app | ||
* call 'listen' on the server, not the express app | ||
*/ | ||
// should be require("dronestream").listen(server); | ||
require("dronestream").listen(server); | ||
server.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "dronestream-example", | ||
"version": "0.1.1", | ||
"dependencies": { | ||
"express": "3.0.x", | ||
"jade": "*", | ||
"dronestream":"1.1.1" | ||
|
||
}, | ||
"scripts": { | ||
"start": "node app" | ||
}, | ||
"author": "Bernhard K. Weisshuhn <bkw@codingforce.com>", | ||
"license": "BSD" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/*! normalize.css v1.0.1 | MIT License | git.io/normalize */ | ||
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block} | ||
audio,canvas,video{display:inline-block;*display:inline;*zoom:1} | ||
audio:not([controls]){display:none;height:0} | ||
[hidden]{display:none} | ||
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%} | ||
html,button,input,select,textarea{font-family:sans-serif} | ||
body{margin:0} | ||
a:focus{outline:thin dotted} | ||
a:active,a:hover{outline:0} | ||
h1{font-size:2em;margin:.67em 0} | ||
h2{font-size:1.5em;margin:.83em 0} | ||
h3{font-size:1.17em;margin:1em 0} | ||
h4{font-size:1em;margin:1.33em 0} | ||
h5{font-size:.83em;margin:1.67em 0} | ||
h6{font-size:.75em;margin:2.33em 0} | ||
abbr[title]{border-bottom:1px dotted} | ||
b,strong{font-weight:bold} | ||
blockquote{margin:1em 40px} | ||
dfn{font-style:italic} | ||
mark{background:#ff0;color:#000} | ||
p,pre{margin:1em 0} | ||
code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em} | ||
pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word} | ||
q{quotes:none} | ||
q:before,q:after{content:'';content:none} | ||
small{font-size:80%} | ||
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} | ||
sup{top:-0.5em} | ||
sub{bottom:-0.25em} | ||
dl,menu,ol,ul{margin:1em 0} | ||
dd{margin:0 0 0 40px} | ||
menu,ol,ul{padding:0 0 0 40px} | ||
nav ul,nav ol{list-style:none;list-style-image:none} | ||
img{border:0;-ms-interpolation-mode:bicubic} | ||
svg:not(:root){overflow:hidden} | ||
figure{margin:0} | ||
form{margin:0} | ||
fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} | ||
legend{border:0;padding:0;white-space:normal;*margin-left:-7px} | ||
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle} | ||
button,input{line-height:normal} | ||
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible} | ||
button[disabled],input[disabled]{cursor:default} | ||
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px} | ||
input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box} | ||
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none} | ||
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} | ||
textarea{overflow:auto;vertical-align:top} | ||
table{border-collapse:collapse;border-spacing:0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
body { | ||
padding: 50px; | ||
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; | ||
} | ||
|
||
a { | ||
color: #00B7FF; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
/* | ||
* GET home page. | ||
*/ | ||
|
||
exports.index = function (req, res) { | ||
res.render('index', { title: 'Express' }); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
extends layout | ||
|
||
block append head | ||
script(type='text/javascript', src='/dronestream/nodecopter-client.js') | ||
|
||
-# for developing the client, use those url:s | ||
-# script(type='text/javascript', src='/dronestream/vendor/broadway/sylvester.js') | ||
-# script(type='text/javascript', src='/dronestream/vendor/broadway/glUtils.js') | ||
-# script(type='text/javascript', src='/dronestream/vendor/broadway/util.js') | ||
-# script(type='text/javascript', src='/dronestream/vendor/broadway/avc-codec.js') | ||
-# script(type='text/javascript', src='/dronestream/vendor/broadway/avc.js') | ||
-# script(type='text/javascript', src='/dronestream/vendor/broadway/canvas.js') | ||
-# script(type='text/javascript', src='/dronestream/nodecopter-stream.js') | ||
-# concatenated version of client | ||
|
||
|
||
block append bodyscripts | ||
script. | ||
var copterStream = new NodecopterStream(document.querySelector('#dronestream')); | ||
|
||
block content | ||
div#dronestream(width=640, height=360) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
html | ||
block head | ||
head | ||
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1') | ||
meta(name='viewport', content='width=device-width') | ||
title= title | ||
link(rel='stylesheet', href='/css/normalize.min.css') | ||
link(rel='stylesheet', href='/css/style.css') | ||
body | ||
div.header-container | ||
header.wrapper.clearfix | ||
block header | ||
nav | ||
block navigation | ||
|
||
div.main-container | ||
div.main.wrapper.clearfix | ||
|
||
block content | ||
|
||
|
||
div.footer-container | ||
footer.wrapper | ||
block footer | ||
|
||
block bodyscripts | ||
// script(src='//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js') | ||
// script | ||
// window.jQuery || document.write('<script src="/js/vendor/h5bp/jquery-1.8.2.min.js"><\\x3C/script>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var arDrone = require('ar-drone'); | ||
// var http = require('http'); | ||
|
||
//var pngStream = arDrone.createClient().getPngStream(); | ||
var client = arDrone.createClient(); | ||
client.disableEmergency(); | ||
|
||
// console.log('Connecting png stream ...'); | ||
// var pngStream = client.getPngStream(); | ||
|
||
// var lastPng; | ||
// pngStream | ||
// .on('error', console.log) | ||
// .on('data', function(pngBuffer) { | ||
// lastPng = pngBuffer; | ||
// }); | ||
|
||
// var server = http.createServer(function(req, res) { | ||
// if (!lastPng) { | ||
// res.writeHead(503); | ||
// res.end('Did not receive any png data yet.'); | ||
// return; | ||
// } | ||
|
||
// res.writeHead(200, {'Content-Type': 'image/png'}); | ||
// res.end(lastPng); | ||
// }); | ||
|
||
// server.listen(8080, function() { | ||
// console.log('Serving latest png on port 8080 ...'); | ||
client.takeoff(); | ||
|
||
client | ||
.after(5000, function() { | ||
// this.clockwise(0.5); | ||
}) | ||
.after(1000, function() { | ||
this.stop(); | ||
this.land(); | ||
}); | ||
|
||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var arDrone = require('ar-drone'); | ||
var client = arDrone.createClient(); | ||
// client.disableEmergency(); | ||
|
||
// client.takeoff(); | ||
|
||
client | ||
// .after(1000, function() { | ||
// this.clockwise(0.5); | ||
// }) | ||
.after(1000, function() { | ||
this.stop(); | ||
this.land(); | ||
}); | ||
|