Skip to content

Commit 06ad987

Browse files
committed
fix 4.1 bugs
1 parent 795fd4c commit 06ad987

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

camera.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class Camera(object):
4949
# pylint: disable=too-many-public-methods
5050

5151
_instance = None
52-
_img_template = image.Image.load("static/media/coderdojo-logo.png")
5352

5453
@classmethod
5554
def get_instance(cls):
@@ -252,18 +251,6 @@ def find_line(self):
252251
self.set_image_cv(img)
253252
return coords
254253

255-
def find_signal(self):
256-
angle = None
257-
ts = time.time()
258-
img = self.get_image()
259-
signals = img.find_template(self._img_template)
260-
261-
logging.info("signal: %s", str(time.time() - ts))
262-
if signals:
263-
angle = signals[0].angle
264-
265-
return angle
266-
267254
def find_face(self):
268255
face_x = face_y = face_size = None
269256
img = self.get_image()

static/js/blockly/blocks.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -572,27 +572,6 @@ Blockly.Python['coderbot_adv_findLine'] = function(block) {
572572
return [code, Blockly.Python.ORDER_ATOMIC];
573573
};
574574

575-
Blockly.Blocks['coderbot_adv_findSignal'] = {
576-
/**
577-
* Block for findSignal function.
578-
* @this Blockly.Block
579-
*/
580-
init: function() {
581-
this.setHelpUrl(Blockly.Msg.LOGIC_BOOLEAN_HELPURL);
582-
this.setColour(250);
583-
this.appendDummyInput()
584-
.appendField(Blockly.Msg.CODERBOT_SENSOR_FINDSIGNAL);
585-
this.setOutput(true, 'Number');
586-
this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP);
587-
}
588-
};
589-
590-
Blockly.Python['coderbot_adv_findSignal'] = function(block) {
591-
// Boolean values true and false.
592-
var code = 'get_cam().find_signal()';
593-
return [code, Blockly.Python.ORDER_ATOMIC];
594-
};
595-
596575
Blockly.Blocks['coderbot_adv_findFace'] = {
597576
/**
598577
* Block for findSignal function.

templates/blocks_adv.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@
304304
<block type="coderbot_cam_average"></block>
305305
<block type="coderbot_adv_pathAhead"></block>
306306
<block type="coderbot_adv_findLine"></block>
307-
<block type="coderbot_adv_findSignal"></block>
308307
<block type="coderbot_adv_findFace"></block>
309308
<block type="coderbot_adv_findColor">
310309
<value name="COLOR">

templates/blocks_std.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
<category name="{% trans %}Vision{% endtrans %}" colour="290">
6262
<block type="coderbot_adv_pathAhead"></block>
6363
<block type="coderbot_adv_findLine"></block>
64-
<block type="coderbot_adv_findSignal"></block>
6564
<block type="coderbot_adv_findFace"></block>
6665
<block type="coderbot_adv_findColor">
6766
<value name="COLOR">

0 commit comments

Comments
 (0)