diff --git a/app.py b/app.py
index bb591ab..7e28757 100644
--- a/app.py
+++ b/app.py
@@ -79,7 +79,7 @@ def droneblocks(path):
if __name__ == "__main__":
# Initialize the drone class
- drone = Drone(is_aruco_tracking_enabled=False)
+ drone = Drone(is_aruco_tracking_enabled=True)
# Camera for stream, photo, video
camera = Camera(drone)
diff --git a/droneblocks/dist/blockly/generators/python/droneblocks.js b/droneblocks/dist/blockly/generators/python/droneblocks.js
deleted file mode 100644
index 37a1702..0000000
--- a/droneblocks/dist/blockly/generators/python/droneblocks.js
+++ /dev/null
@@ -1,116 +0,0 @@
-Blockly.Python['takeoff'] = function(block) {
- var altitude = Blockly.Python.valueToCode(block, 'altitude', Blockly.JavaScript.ORDER_NONE);
- return 'takeoff(' + altitude + ');\n';
-};
-
-Blockly.Python['flight_path'] = function(block) {
- var path = block.getFieldValue("path");
- return 'flight_path("' + path + '");\n';
-};
-
-Blockly.Python['land'] = function(block) {
- return 'land();\n';
-};
-
-Blockly.Python['land_home'] = function(block) {
- return 'landHome();\n';
-};
-
-Blockly.Python['hover'] = function(block) {
- var duration = Blockly.Python.valueToCode(block, 'duration', Blockly.JavaScript.ORDER_NONE);
- return 'hover(' + duration + ');\n';
-};
-
-Blockly.Python['yaw_right'] = function(block) {
- var angle = Blockly.Python.valueToCode(block, 'angle', Blockly.JavaScript.ORDER_NONE);
- var velocity = block.getFieldValue("velocity");
- return 'yawRight(' + angle + ', ' + velocity + ');\n';
-};
-
-Blockly.Python['yaw_left'] = function(block) {
- var angle = Blockly.Python.valueToCode(block, 'angle', Blockly.JavaScript.ORDER_NONE);
- var velocity = block.getFieldValue("velocity");
- return 'yawLeft(' + angle + ', ' + velocity + ');\n';
-};
-
-Blockly.Python['orbit'] = function(block) {
- var radius = Blockly.Python.valueToCode(block, 'radius', Blockly.JavaScript.ORDER_NONE);
- var velocity = block.getFieldValue("velocity");
- return 'orbit(' + radius + ', ' + velocity + ');\n';
-};
-
-Blockly.Python['photo'] = function(block) {
- return 'takePhoto();\n';
-};
-
-Blockly.Python['photo_interval'] = function(block) {
- var photo_count = block.getFieldValue("photo_count");
- var interval = block.getFieldValue("interval");
- return 'takePhoto(' + photo_count + ', ' + interval + ');\n';
-};
-
-Blockly.Python['pitch_gimbal_to'] = function(block) {
- var angle = Blockly.Python.valueToCode(block, 'angle', Blockly.JavaScript.ORDER_NONE);
- return 'pitchGimbal(' + angle + ');\n';
-};
-
-Blockly.Python['fly_forward'] = function(block) {
- var distance = Blockly.Python.valueToCode(block, 'distance', Blockly.JavaScript.ORDER_NONE);
- var speed = block.getFieldValue("speed");
- return 'flyForward(' + distance + ', ' + speed + ');\n';
-};
-
-Blockly.Python['video'] = function(block) {
- var action = block.getFieldValue("video_status");
- return "video('" + action + "');\n";
-};
-
-Blockly.Python['video_duration'] = function(block) {
- var duration = block.getFieldValue("duration");
- return "video('start', " + duration + ");\n";
-};
-
-Blockly.Python['change_altitude'] = function(block) {
- var altitude = Blockly.Python.valueToCode(block, 'altitude', Blockly.JavaScript.ORDER_NONE);
- return 'change_altitude(' + altitude + ');\n';
-};
-
-Blockly.Python['loop'] = function(block) {
- var loopVar = Blockly.Python.variableDB_.getDistinctName('count', Blockly.Variables.NAME_TYPE);
- var repeats = Blockly.Python.valueToCode(block, 'TIMES', Blockly.JavaScript.ORDER_NONE);
- var branch = Blockly.Python.statementToCode(block, 'DO').trim();
- var code = "\nfor (var " + loopVar + " = 0; " + loopVar + " < " + repeats + "; " + loopVar + "++) {\n";
- code += ' ' + branch + '\n';
- code += "}\n\n";
- return code;
-};
-
-Blockly.Python['controls_if'] = function(block) {
- // If/elseif/else condition.
- var n = 0;
- var code = '', branchCode, conditionCode;
- do {
- conditionCode = Blockly.Python.valueToCode(block, 'IF' + n,
- Blockly.Python.ORDER_NONE) || 'false';
- branchCode = Blockly.Python.statementToCode(block, 'DO' + n) || '';
- code += (n == 0 ? 'if (' : '} else if (' ) + conditionCode + ') {\n' + branchCode;
-
- ++n;
- } while (block.getInput('IF' + n));
-
- if (block.getInput('ELSE')) {
- branchCode = Blockly.Python.statementToCode(block, 'ELSE') ||
- Blockly.Python.PASS;
- code += '} else {\n' + branchCode + '}\n';
- }
- return code + '}';
-};
-
-Blockly.Python['variables_set'] = function(block) {
- // Variable setter.
- var argument0 = Blockly.Python.valueToCode(block, 'VALUE',
- Blockly.Python.ORDER_NONE) || '0';
- var varName = Blockly.Python.variableDB_.getName(block.getFieldValue('VAR'),
- Blockly.Variables.NAME_TYPE);
- return varName + ' = ' + argument0 + ';\n';
-};
diff --git a/droneblocks/dist/chrome_app.html b/droneblocks/dist/chrome_app.html
deleted file mode 100644
index 4315f35..0000000
--- a/droneblocks/dist/chrome_app.html
+++ /dev/null
@@ -1,319 +0,0 @@
-
-
-
-
-
-
- DroneBlocks
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- menu
-
- Untitled Mission
-
-
-
-
-
-
Please enter a mission title below and click SAVE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tello Connection Instructions
-
-
- - Power up Tello.
- - Go to your computer's network settings and look for the Tello network.
- - Connect to the Tello network. No password will be required.
- - Wait a few seconds for the network connection to be established.
- - Click the Connect button below and you should see Tello's battery percentage in the top left of DroneBlocks.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 30
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
- 20
-
-
-
-
- 20
-
-
-
-
-
-
- 25
-
-
-
-
- 25
-
-
-
-
- 0
-
-
-
-
- 0
-
-
-
-
- 50
-
-
-
-
- 0
-
-
-
-
-
-
- 5
-
-
-
-
-
-
- 90
-
-
-
-
-
-
- 90
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3
-
-
-
-
-
-
-
-
-
-
-
- 20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 5/field>
-
-
-
-
-
-
-
-
-
-
-
diff --git a/droneblocks/dist/chrome_app_metric.html b/droneblocks/dist/chrome_app_metric.html
deleted file mode 100644
index 2717338..0000000
--- a/droneblocks/dist/chrome_app_metric.html
+++ /dev/null
@@ -1,310 +0,0 @@
-
-
-
-
-
-
- DroneBlocks
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- menu
-
- Untitled Mission
-
-
-
-
-
-
Please enter a mission title below and click SAVE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tello Connection Instructions
-
-
- - Power up Tello.
- - Go to your computer's network settings and look for the Tello network.
- - Connect to the Tello network. No password will be required.
- - Wait a few seconds for the network connection to be established.
- - Click the Connect button below and you should see Tello's battery percentage in the top left of DroneBlocks.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 30
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
-
-
- 20
-
-
-
-
- 20
-
-
-
-
- 20
-
-
-
-
-
-
- 25
-
-
-
-
- 25
-
-
-
-
- 0
-
-
-
-
- 0
-
-
-
-
- 50
-
-
-
-
- 0
-
-
-
-
-
-
- 5
-
-
-
-
-
-
- 90
-
-
-
-
-
-
- 90
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3
-
-
-
-
-
-
-
-
-
-
-
- 20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 5/field>
-
-
-
-
-
-
-
-
-
-
-
diff --git a/droneblocks/dist/css/droneblocks.css b/droneblocks/dist/css/droneblocks.css
deleted file mode 100644
index 9e5bed4..0000000
--- a/droneblocks/dist/css/droneblocks.css
+++ /dev/null
@@ -1,216 +0,0 @@
-/* General styling */
-html, body {
- height: 100%;
- margin: 0;
-}
-body {
- background-color: #fff;
- font-family: sans-serif;
- overflow: hidden;
-}
-h1 {
- font-weight: normal;
- font-size: 140%;
-}
-table {
- height: 100%;
- width: 100%;
-}
-
-#helpButton {
- background-color: #7FB800;
- padding: 10px;
- text-decoration: none;
- color: #FFFFFF;
-}
-/* End general styling */
-
-/* Begin block category styling */
-.blocklyTreeRoot {
- padding: 0px !important;
-}
-.blocklyTreeRow {
- height: 30px !important;
- line-height: 30px !important;
-}
-
-div#\:1 {
- background-color: #264653 !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:1 .blocklyTreeRow:hover {
- background-color: #172B33 !important;
-}
-
-div#\:1 .blocklyTreeSelected {
- background-color: #172B33 !important;
-}
-
-div#\:2 {
- background-color: #2A9D8F !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:2 .blocklyTreeRow:hover {
- background-color: #1E7268 !important;
-}
-
-div#\:2 .blocklyTreeSelected {
- background-color: #1E7268 !important;
-}
-
-div#\:3 {
- background-color: #64c2d9 !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:3 .blocklyTreeRow:hover {
- background-color: #428a9c !important;
-}
-
-div#\:3 .blocklyTreeSelected {
- background-color: #428a9c !important;
-}
-
-div#\:4 {
- background-color: #E9C46A !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:4 .blocklyTreeRow:hover {
- background-color: #AD924E !important;
-}
-
-div#\:4 .blocklyTreeSelected {
- background-color: #AD924E !important;
-}
-
-div#\:5 {
- background-color: #aa3a3a !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:5 .blocklyTreeRow:hover {
- background-color: #662121 !important;
-}
-
-div#\:5 .blocklyTreeSelected {
- background-color: #662121 !important;
-}
-
-div#\:6 {
- background-color: #5a65a7 !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:6 .blocklyTreeRow:hover {
- background-color: #373e66 !important;
-}
-
-div#\:6 .blocklyTreeSelected {
- background-color: #373e66 !important;
-}
-
-div#\:7 {
- background-color: #a65a80 !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:7 .blocklyTreeRow:hover {
- background-color: #723e58 !important;
-}
-
-div#\:7 .blocklyTreeSelected {
- background-color: #723e58 !important;
-}
-
-div#\:8 {
- background-color: #E76F51 !important;
- padding: 10px !important;
- color: #FFFFFF !important;
-}
-
-div#\:8 .blocklyTreeRow:hover {
- background-color: #B2553E !important;
-}
-
-div#\:8 .blocklyTreeSelected {
- background-color: #B2553E !important;
-}
-/* End block category styling */
-
-div#blocklyArea {
- float: left;
- width: 100%;
- height: 100%;
-}
-
-div#blocklyArea.half {
- width: 55% !important;
-}
-
-div#blocklyArea.full {
- width: 100% !important;
-}
-
-div#codeView {
- background: #E7E7E8;
- float: left;
- width: 45%;
- padding: 10px;
- font-family: monospace;
- height: 100%;
- overflow: auto;
- padding-top: 30px;
-}
-
-div#codeView.hidden {
- display: none;
-}
-
-div#codeView.visible {
- display: block;
-}
-
-/* Material CSS stuff */
-a#hamburger {
- position: absolute;
- top: 0px;
- right: 20px;
- z-index: 1;
-}
-
-div#missionTitle {
- position: absolute;
- top: 12px;
- right: 65px;
- z-index: 2;
-}
-
-/* override medium size for hamburger icon */
-i.medium {
- font-size: 3rem !important;
-}
-/* end material css */
-
-/* This is to prevent the material css conflict with blockly's input fields */
-/*
-.blocklyHtmlInput {
- border: none !important;
- border-radius: 4px !important;
- font-family: sans-serif !important;
- height: 100% !important;
- margin: 0 !important;
- outline: none !important;
- padding: 0 1px !important;
- width: 100% !important;
-}
-*/
\ No newline at end of file
diff --git a/droneblocks/dist/droneblocks.appcache b/droneblocks/dist/droneblocks.appcache
deleted file mode 100644
index 56aeae3..0000000
--- a/droneblocks/dist/droneblocks.appcache
+++ /dev/null
@@ -1,50 +0,0 @@
-CACHE MANIFEST
-index.html
-missions.html
-blockly/blockly_compressed.js
-blockly/blocks_compressed.js
-blockly/javascript_compressed.js
-blockly/python_compressed.js
-blockly/storage.js
-blockly/prettify.css
-blockly/run_prettify.js
-blockly/generators/javascript/droneblocks.js
-blockly/generators/python/droneblocks.js
-blockly/msg/js/en.js
-blockly/blocks/droneblocks/takeoff.js
-blockly/blocks/droneblocks/land.js
-blockly/blocks/droneblocks/land_home.js
-blockly/blocks/droneblocks/hover.js
-blockly/blocks/droneblocks/yaw_right.js
-blockly/blocks/droneblocks/yaw_left.js
-blockly/blocks/droneblocks/photo.js
-blockly/blocks/droneblocks/photo_interval.js
-blockly/blocks/droneblocks/pitch_gimbal.js
-blockly/blocks/droneblocks/fly_forward.js
-blockly/blocks/droneblocks/change_altitude.js
-blockly/blocks/droneblocks/video.js
-blockly/blocks/droneblocks/orbit.js
-blockly/blocks/droneblocks/loop.js
-blockly/blocks/droneblocks/follow.js
-css/droneblocks.css
-css/style.css
-js/droneblocks.js
-js/missions.js
-js/jquery-2.2.3.min.js
-js/firebase.js
-blockly/media/sprites.png
-blockly/media/click.mp3
-blockly/media/disconnect.wav
-blockly/media/delete.mp3
-lib/materialize/css/materialize.min.css
-lib/materialize/js/materialize.min.js
-lib/firebase/firebase.js
-lib/firebase/firebase-firestore.js
-js/lib/main.min.js
-
-# Use from network if available
-NETWORK:
-*
-
-# Auto expire app cache when deploying
-# 10-10-2019
\ No newline at end of file
diff --git a/droneblocks/dist/js/chrome_app.js b/droneblocks/dist/js/chrome_app.js
deleted file mode 100644
index 1dede5b..0000000
--- a/droneblocks/dist/js/chrome_app.js
+++ /dev/null
@@ -1,20 +0,0 @@
-window.addEventListener('message', onMessage);
-
-var appWindow, appOrigin;
-
-function onMessage(e) {
- appWindow = e.source;
- appOrigin = e.origin;
-
- console.log("got some data: " + e.data);
-
- if (e.data == "displayConnectionModal") {
- $('#connectToTelloModal').openModal();
- }
-}
-
-$("#connectButton").click(function() {
- // Appwindow is so we can post to the chrome app
- appWindow.postMessage("beginTelloConnection", appOrigin);
- $("#connectToTelloModal").closeModal();
-});
\ No newline at end of file
diff --git a/droneblocks/dist/tello.html b/droneblocks/dist/tello.html
index 331c38f..c3bbf54 100644
--- a/droneblocks/dist/tello.html
+++ b/droneblocks/dist/tello.html
@@ -47,21 +47,6 @@
-
-
-
-
-
-
-
-
-
+
+
@@ -66,25 +58,12 @@
@@ -109,11 +88,6 @@ Please enter a mission title below and click SAVE
-
-
-
-
-
@@ -248,6 +222,10 @@ Please enter a mission title below and click SAVE
+
+
+
+
diff --git a/droneblocks/src/tello.html b/droneblocks/src/tello.html
index 331c38f..c3bbf54 100644
--- a/droneblocks/src/tello.html
+++ b/droneblocks/src/tello.html
@@ -47,21 +47,6 @@
-
-
-
-
-
-
-
-
-
+
+
@@ -66,25 +58,12 @@
@@ -109,11 +88,6 @@ Please enter a mission title below and click SAVE
-
-
-
-
-
@@ -248,6 +222,10 @@ Please enter a mission title below and click SAVE
+
+
+
+
diff --git a/lib/mission.py b/lib/mission.py
index c8915ca..6e6eb7d 100644
--- a/lib/mission.py
+++ b/lib/mission.py
@@ -67,7 +67,7 @@ def parse_mission(self, mission_code):
elif "down" in command:
direction = "down"
- command_to_execute = direction + " " + distance
+ command_to_execute = direction + " " + self.convert_distance(distance, units)
elif "curve" in command:
@@ -147,8 +147,13 @@ def parse_mission(self, mission_code):
print("Mission is complete")
- def execute_mission(self, mission_commands):
- return
+ # Tello only flies in units of cm so we need to convert from in to cm
+ def convert_distance(self, distance, units):
+
+ if units == "in":
+ distance = int(distance) * 2.54
+
+ return str(distance)
diff --git a/static/js/app.js b/static/js/app.js
index bd32634..6b47baa 100644
--- a/static/js/app.js
+++ b/static/js/app.js
@@ -130,6 +130,12 @@ $(document).ready(function() {
$("input[type=radio]").click(function() {
distance_units = $(this).data('value');
$("#display_units").text(distance_units);
+
+ if (distance_units == "cm") {
+ $("#droneblocks_iframe").attr('src', '/droneblocks/tello_metric.html');
+ } else {
+ $("#droneblocks_iframe").attr('src', '/droneblocks/tello.html');
+ }
});
});
diff --git a/templates/index.html b/templates/index.html
index 501f5c0..18c752c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -139,7 +139,7 @@
-
+