First Commit for AR Drone Browser controller
Esse commit está contido em:
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
gerado
+1
@@ -0,0 +1 @@
|
||||
ardrone-nodejs-browser-control
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
gerado
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
</project>
|
||||
|
||||
gerado
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" />
|
||||
</project>
|
||||
|
||||
gerado
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/ardrone-nodejs-browser-control.iml" filepath="$PROJECT_DIR$/.idea/ardrone-nodejs-browser-control.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<state>
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</state>
|
||||
</component>
|
||||
gerado
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
gerado
+314
@@ -0,0 +1,314 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f188893c-2c4c-444d-a925-084a4f6d4970" name="Default" comment="" />
|
||||
<ignored path="ardrone-nodejs-browser-control.iws" />
|
||||
<ignored path=".idea/workspace.xml" />
|
||||
<file path="/Dummy.txt" changelist="f188893c-2c4c-444d-a925-084a4f6d4970" time="1372550629709" ignored="false" />
|
||||
<file path="/index.html" changelist="f188893c-2c4c-444d-a925-084a4f6d4970" time="1372551367184" ignored="false" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="DaemonCodeAnalyzer">
|
||||
<disable_hints />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FavoritesManager">
|
||||
<favorites_list name="ardrone-nodejs-browser-control" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="package.json" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="README.md" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="server.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/server.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="controller.js" pinned="false" current="true" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/drone/controller.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="index.html" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/public/index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="128" column="35" selection-start="4134" selection-end="4134" vertical-scroll-proportion="-8.28">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FindManager">
|
||||
<FindUsagesManager>
|
||||
<setting name="OPEN_NEW_TAB" value="false" />
|
||||
</FindUsagesManager>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitLogSettings">
|
||||
<option name="myDateState">
|
||||
<MyDateState />
|
||||
</option>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="changedFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/README.md" />
|
||||
<option value="$PROJECT_DIR$/public/index.html" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="10" />
|
||||
<option name="y" value="22" />
|
||||
<option name="width" value="1420" />
|
||||
<option name="height" value="790" />
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectReloadState">
|
||||
<option name="STATE" value="0" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents ProjectPane="true" />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="public" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ardrone-nodejs-browser-control" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="drone" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<list size="0" />
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="f188893c-2c4c-444d-a925-084a4f6d4970" name="Default" comment="" />
|
||||
<created>1372550628348</created>
|
||||
<updated>1372550628348</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="10" y="22" width="1420" height="790" extended-state="0" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24982105" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
|
||||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
<option name="CHECK_NEW_TODO" value="true" />
|
||||
<option name="myTodoPanelSettings">
|
||||
<value>
|
||||
<are-packages-shown value="false" />
|
||||
<are-modules-shown value="false" />
|
||||
<flatten-packages value="false" />
|
||||
<is-autoscroll-to-source value="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
|
||||
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
|
||||
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
|
||||
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
|
||||
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
|
||||
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
|
||||
<option name="SHORT_DIFF_HORIZONTALLY" value="true" />
|
||||
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
|
||||
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
|
||||
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
|
||||
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
|
||||
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
|
||||
<option name="SHOW_DIRTY_RECURSIVELY" value="false" />
|
||||
<option name="LIMIT_HISTORY" value="true" />
|
||||
<option name="MAXIMUM_HISTORY_ROWS" value="1000" />
|
||||
<option name="UPDATE_FILTER_SCOPE_NAME" />
|
||||
<option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
|
||||
<option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
|
||||
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
|
||||
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
|
||||
<option name="LAST_COMMIT_MESSAGE" />
|
||||
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
|
||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
|
||||
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
|
||||
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
||||
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
||||
<option name="ACTIVE_VCS_NAME" />
|
||||
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
|
||||
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
|
||||
<option name="UPDATE_FILTER_BY_SCOPE" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
|
||||
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/public/index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="128" column="35" selection-start="4134" selection-end="4134" vertical-scroll-proportion="-8.28">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/server.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/drone/controller.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
AR Drone Browser Controller
|
||||
==========================
|
||||
|
||||
This is a simplified Node JS Browser Controller built on top of NodeJs
|
||||
|
||||
It shows Feed from
|
||||
* Ar Drone Parrot 2
|
||||
* Laptop Camera
|
||||
|
||||
and allows following commands to control the drone
|
||||
* takeoff
|
||||
* spin
|
||||
* stop
|
||||
* land
|
||||
|
||||
and updates the battery level constantly
|
||||
|
||||
References
|
||||
------------
|
||||
This project internally uses following libraries
|
||||
* node-ar-drone
|
||||
* dronestream
|
||||
* socket.io
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Created with JetBrains WebStorm.
|
||||
* User: rohitghatol
|
||||
* Date: 6/28/13
|
||||
* Time: 5:47 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
var arDrone = require('ar-drone');
|
||||
|
||||
|
||||
|
||||
|
||||
//client.createRepl();
|
||||
//client.animateLeds('blinkRed', 5, 10);
|
||||
|
||||
//client.on('navdata', console.log);
|
||||
|
||||
//client.takeoff();
|
||||
//client
|
||||
// .after(5000, function() {
|
||||
//
|
||||
// this.clockwise(0.5);
|
||||
// client.animateLeds('blinkRed', 5, 2);
|
||||
// })
|
||||
// .after(3000, function() {
|
||||
// //this.animate('flipLeft', 15);
|
||||
// })
|
||||
// .after(1000, function() {
|
||||
// this.stop();
|
||||
// this.land();
|
||||
// });
|
||||
|
||||
var io = require('socket.io-client'),
|
||||
socket = io.connect('localhost', {
|
||||
port: 3111
|
||||
});
|
||||
socket.on('connect', function () { console.log("socket connected"); });
|
||||
socket.emit('image', { image: 'whazzzup?' });
|
||||
|
||||
|
||||
var client = arDrone.createClient();
|
||||
client.getPngStream()
|
||||
.on('error', console.log)
|
||||
.on('data', function(frame) {
|
||||
socket.emit('image', { image: frame });
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Created with JetBrains WebStorm.
|
||||
* User: rohitghatol
|
||||
* Date: 6/29/13
|
||||
* Time: 6:36 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
|
||||
require("dronestream").listen(3001);
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Created with JetBrains WebStorm.
|
||||
* User: rohitghatol
|
||||
* Date: 6/29/13
|
||||
* Time: 6:32 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
|
||||
var io = require('socket.io').listen(3002);
|
||||
io.set('log level', 1);
|
||||
|
||||
io.sockets.on('connection', function (socket) {
|
||||
var arDrone = require('ar-drone');
|
||||
var client = arDrone.createClient();
|
||||
|
||||
setInterval(function(){
|
||||
var batteryLevel = client.battery();
|
||||
socket.emit('event', { name: 'battery',value: batteryLevel});
|
||||
},1000);
|
||||
|
||||
socket.on('event', function (data) {
|
||||
if(data.name=="takeoff"){
|
||||
console.log("Browser asked Ar Drone to Take Off");
|
||||
client.takeoff();
|
||||
}
|
||||
if(data.name=="spin"){
|
||||
console.log("Browser asked Ar Drone to Start Spinning");
|
||||
client.clockwise(1);
|
||||
}
|
||||
if(data.name=="stop"){
|
||||
console.log("Browser asked Ar Drone to Stay and Hover");
|
||||
client.stop();
|
||||
}
|
||||
if(data.name=="land"){
|
||||
console.log("Browser asked Ar Drone to Land");
|
||||
client.land();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
var arDrone = require('ar-drone');
|
||||
var client = arDrone.createClient();
|
||||
client.createRepl();
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "NodeCopter-Trail",
|
||||
"description": "NodeCopter Trail",
|
||||
"author": "Rohit Ghatol",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"ar-drone": "latest",
|
||||
"express": "latest",
|
||||
"socket.io":"latest",
|
||||
"socket.io-client":"latest",
|
||||
"dronestream":"latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
},
|
||||
"engine": "node >= 0.6.6"
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Node JS Copter Demo</title>
|
||||
<script src="nodecopter-client.js"></script>
|
||||
<script src="socket.io.min.js"></script>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
function startArDRoneStream() {
|
||||
new NodecopterStream(document.getElementById("placeholder"), {port: 3001});
|
||||
}
|
||||
|
||||
function startCameraFeed() {
|
||||
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
|
||||
|
||||
var constraints = {audio: false, video: true};
|
||||
var video = document.querySelector("video");
|
||||
|
||||
function successCallback(stream) {
|
||||
window.stream = stream; // stream available to console
|
||||
if (window.URL) {
|
||||
video.src = window.URL.createObjectURL(stream);
|
||||
} else {
|
||||
video.src = stream;
|
||||
}
|
||||
video.play();
|
||||
}
|
||||
|
||||
function errorCallback(error){
|
||||
console.log("navigator.getUserMedia error: ", error);
|
||||
}
|
||||
|
||||
navigator.getUserMedia(constraints, successCallback, errorCallback);
|
||||
|
||||
}
|
||||
|
||||
startArDRoneStream();
|
||||
startCameraFeed();
|
||||
|
||||
var socket = io.connect('http://localhost:3002');
|
||||
socket.on('connect', function () { // TIP: you can avoid listening on `connect` and listen on events directly too!
|
||||
console.log("Connection Successful");
|
||||
|
||||
});
|
||||
|
||||
socket.on('event', function (data) {
|
||||
|
||||
if(data.name=="battery"){
|
||||
$("#battery-indicator").css('width',data.value+'%');
|
||||
$("#battery-value").html(data.value+'%');
|
||||
}
|
||||
});
|
||||
|
||||
$("#takeoff").click(function(){
|
||||
console.log("Asking Server to send takeoff command to Ar Drone");
|
||||
socket.emit('event',{name:"takeoff"});
|
||||
});
|
||||
$("#spin").click(function(){
|
||||
console.log("Asking Server to send spin command to Ar Drone");
|
||||
socket.emit('event',{name:"spin"});
|
||||
});
|
||||
$("#stop").click(function(){
|
||||
console.log("Asking Server to send stop command to Ar Drone");
|
||||
socket.emit('event',{name:"stop"});
|
||||
});
|
||||
$("#land").click(function(){
|
||||
console.log("Asking Server to send land command to Ar Drone");
|
||||
socket.emit('event',{name:"land"});
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
td {
|
||||
border:1px solid black;
|
||||
border-radius:10px;
|
||||
padding:10px;
|
||||
}
|
||||
button{
|
||||
font-size: 10pt;
|
||||
}
|
||||
#battery{
|
||||
border:1px solid black;
|
||||
width:500px;
|
||||
height:20px;
|
||||
text-align: center;
|
||||
}
|
||||
.bar {
|
||||
margin: 5px 0 3px;
|
||||
border: 6px solid #333;
|
||||
background: #333;
|
||||
overflow: hidden;
|
||||
border-radius: 50px;
|
||||
-moz-border-radius: 50px;
|
||||
-webkit-border-radius: 50px;
|
||||
box-shadow: 1px 1px 1px #777;
|
||||
-moz-box-shadow: 1px 1px 1px #777;
|
||||
-webkit-box-shadow: 1px 1px 1px #777;
|
||||
}
|
||||
.bar > span {
|
||||
display: block;
|
||||
height: 20px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
.color0 > span {
|
||||
background-color: #FF0000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ar Drone NodeJs Demo</h1>
|
||||
<h4>Built using nodejs, socket.io, node-ar-drone and dronestream - By Rohit Ghatol</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td >
|
||||
<button id="takeoff">Take Off</button>
|
||||
<button id="spin">Start Spinning</button>
|
||||
<button id="stop">Stop & Hover</button>
|
||||
<button id="land">Land</button>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<span>Battery</span> - <span id="battery-value"></span>
|
||||
<div class="bar color0">
|
||||
<span id="battery-indicator" style="width:50%"></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h1>Ar Drone Parrot Feed</h1>
|
||||
<div id="placeholder"></div>
|
||||
</td>
|
||||
<td>
|
||||
<h1>Laptop Camera Feed</h1>
|
||||
<video id="live" width="640" height="360" autoplay></video>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
externo
+2
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
externo
+2
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Created with JetBrains WebStorm.
|
||||
* User: rohitghatol
|
||||
* Date: 6/29/13
|
||||
* Time: 3:10 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
|
||||
var express = require('express')
|
||||
, app = express()
|
||||
, server = require("http").createServer(app)
|
||||
|
||||
app.use(express.static(__dirname + '/public'));
|
||||
|
||||
|
||||
require("./drone/camera-feed");
|
||||
require("./drone/controller");
|
||||
|
||||
app.listen(3000);
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário