Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
complete project
Browse files Browse the repository at this point in the history
  • Loading branch information
aCard0s0 committed Dec 28, 2016
0 parents commit b3a884c
Show file tree
Hide file tree
Showing 1,118 changed files with 159,267 additions and 0 deletions.
Binary file not shown.
20 changes: 20 additions & 0 deletions Drone-NodeJS/DroneCom/DroneCom/DroneCom.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "PythonApplication1", "PythonApplication1\PythonApplication1.pyproj", "{1498F8F8-6C41-4419-9164-8B9C06B58FC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1498F8F8-6C41-4419-9164-8B9C06B58FC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1498F8F8-6C41-4419-9164-8B9C06B58FC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from Naked.toolshed.shell import execute_js

print "calling flightplan.js"
success = execute_js('testscript.js')
if success:
print "sucess"
else:
print "error"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>1498f8f8-6c41-4419-9164-8b9c06b58fc7</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>PythonApplication1.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>PythonApplication1</Name>
<RootNamespace>PythonApplication1</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="PythonApplication1.py" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<Import Condition="Exists($(PtvsTargetsFile))" Project="$(PtvsTargetsFile)" />
<Import Condition="!Exists($(PtvsTargetsFile))" Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
11 changes: 11 additions & 0 deletions Drone-NodeJS/drone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var bebop = require('node-bebop');

var drone = bebop.createClient();

drone.connect(function() {
drone.takeOff();

setTimeout(function() {
drone.land();
}, 5000);
});
9 changes: 9 additions & 0 deletions Drone-NodeJS/flightPlan.mavlink
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
QGC WPL 120
0 0 3 178 0.000000 6.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1
1 0 3 16 0.000000 5.000000 0.000000 359.079987 40.632979 -8.659350 3.000000 1
2 0 3 178 0.000000 10.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1
3 0 3 2800 0.000000 -96.000000 0.000000 45.000000 0.000000 0.000000 0.000000 1
4 0 3 2000 6.200000 0.710668 12.582912 0.000000 0.000000 0.000000 0.000000 1
5 0 3 16 0.000000 5.000000 0.000000 0.790000 40.634045 -8.660464 3.000000 1
6 0 3 2001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
7 0 3 21 0.000000 0.000000 0.000000 360.787354 40.634045 -8.660464 3.000000 1
73 changes: 73 additions & 0 deletions Drone-NodeJS/flightplan.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"use strict";

var bebop = require('node-bebop');

var drone = bebop.createClient();

var alreadyFlying = false;

drone.connect(function() {
drone.on("GPSFixStateChanged", function(data) {
console.log("GPSFixStateChanged", data);
});

drone.on("MavlinkPlayErrorStateChanged", function(data) {
console.log("MavlinkPlayErrorStateChanged", data);
});

drone.on("MavlinkFilePlayingStateChanged", function(data) {
console.log("MavlinkFilePlayingStateChanged", data);
});

drone.on("AvailabilityStateChanged", function(data) {
console.log("AvailabilityStateChanged", data);
if (data.AvailabilityState === 1 && !alreadyFlying) {
alreadyFlying = true;
drone.Mavlink.start("/data/ftp/internal_000/flightplans/flightPlan.mavlink", 0);
}
});

drone.on("ComponentStateListChanged", function(data) {
console.log("ComponentStateListChanged", data);
});

drone.on("ready", function () {
console.log("ready");
});

drone.on("battery", function (data) {
console.log(data);
});

drone.on("landed", function () {
console.log("landed");
});

drone.on("takingOff", function () {
console.log("takingOff");
});

drone.on("hovering", function () {
console.log("hovering");
});

drone.on("FlyingStateChanged", function () {
console.log("FlyingStateChanged");
});

drone.on("BatteryStateChanged", function () {
console.log("BatteryStateChanged");
});

drone.on("flying", function() {
console.log("flying");
});

drone.on("landing", function() {
console.log("landing");
});

drone.on("unknown", function(data) {
console.log("unknown", data);
});
});
5 changes: 5 additions & 0 deletions Drone-NodeJS/flightplan_parms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";
console.log("entrei");

var argv = process.argv.slice(1);
console.dir(argv[1]);
44 changes: 44 additions & 0 deletions Drone-NodeJS/ftp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import pika, os, ftplib, sys, datetime, requests

localDownloadDir = "/home/andrecajus/Desktop/ProjectImgAlgorithm/temp/"
localFinalDownloadDir = "/home/andrecajus/Desktop/ProjectImgAlgorithm/"
remoteDir = ""
ftpHost ="94.23.76.188"
ftpLogin = "testetiago"
ftpPassword = "Abm9%c80"


def getbinary(ftp, filename):
destinationFileName = "park1_drone5_" +filename.replace(".mp4",".part")
fhandle = open(localDownloadDir + destinationFileName , 'wb')
ftp.retrbinary("RETR " + filename, fhandle.write)
fhandle.flush()
fhandle.close()

os.rename("temp/" + destinationFileName, localFinalDownloadDir + destinationFileName.replace(".part",".mp4"))
print ("filename",filename, "successful downloaded..")
#successful = ftp.delete(filename)
#if successful:
# print ("filename",filename, "successful deleted")
#else:
# print ("filename",filename, "cannot be deleted")

ftp = ftplib.FTP(ftpHost)
ftp.login(ftpLogin, ftpPassword)

ftp.cwd(remoteDir)

data = []

#ftp.dir(data.append)
ftp.retrlines('LIST', callback=data.append)
files = (line.rsplit(None, 1)[1] for line in data)
files_list = list(files)
for line in files_list:
print(line)
getbinary(ftp,line)

ftp.quit()


#print ("-", line)
2 changes: 2 additions & 0 deletions Drone-NodeJS/node_modules/.bin/update-bebop-commands

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Drone-NodeJS/node_modules/.bin/update-bebop-commands.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions Drone-NodeJS/node_modules/node-bebop/.eslintrc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Drone-NodeJS/node_modules/node-bebop/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions Drone-NodeJS/node_modules/node-bebop/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Drone-NodeJS/node_modules/node-bebop/Gruntfile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Drone-NodeJS/node_modules/node-bebop/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3a884c

Please sign in to comment.