diff --git a/.project.json b/.project.json index b8d6c4b44e2da079f546e674c027ab74b982e319..97fbb60c7d8a17cb69a94713c8d63643e902e989 100644 --- a/.project.json +++ b/.project.json @@ -1 +1 @@ -{"name":"Buggy_Line_Follower_with_P_Controller","mode":"ADVANCED","uuid":"d5afebef-2128-72cb-331e-53289dcee298"} \ No newline at end of file +{"uuid":"d5afebef-2128-72cb-331e-53289dcee298","name":"Buggy_Line_Follower_with_P_Controller","mode":"ADVANCED","version":"1.0","controller":"TXT4"} \ No newline at end of file diff --git a/Buggy_Line_Follower_with_P_Controller.blockly b/Buggy_Line_Follower_with_P_Controller.blockly index cebe850ea27756624912e2f2feb6232d98cb391e..046831d1ceec44f6545864654dd2baa6ad3f53f4 100644 --- a/Buggy_Line_Follower_with_P_Controller.blockly +++ b/Buggy_Line_Follower_with_P_Controller.blockly @@ -1,4 +1,4 @@ -<xml xmlns="https://developers.google.com/blockly/xml" version="12"> +<xml xmlns="https://developers.google.com/blockly/xml" version="13"> <variables> <variable id="P(Xg1a%]+(B5J8i#Br*0">speed</variable> <variable id="|9bZ^?[0p276=t3[1Fh4">index</variable> diff --git a/Buggy_Line_Follower_with_P_Controller.py b/Buggy_Line_Follower_with_P_Controller.py index d47232934b4b8d2e6f9b9e3b3f3397f26ed18c97..1b2a9eb1864a62eb85766db9328a6232a0289ac0 100644 --- a/Buggy_Line_Follower_with_P_Controller.py +++ b/Buggy_Line_Follower_with_P_Controller.py @@ -1,9 +1,9 @@ -import time import math +import time -from lib.controller import * from fischertechnik.controller.Motor import Motor from lib.camera import * +from lib.controller import * from numbers import Number diff --git a/lib/camera.py b/lib/camera.py index 683272eb6b8d39cba31ee58a119b566171754bd9..c3d252489114416f52f310b0f938e9d7fd5118aa 100644 --- a/lib/camera.py +++ b/lib/camera.py @@ -2,12 +2,12 @@ from lib.controller import * import fischertechnik.factories as txt_factory -TXT_M_USB_1_camera.set_rotate(False) -TXT_M_USB_1_camera.set_height(240) -TXT_M_USB_1_camera.set_width(320) -TXT_M_USB_1_camera.set_fps(15) -TXT_M_USB_1_camera.start() +TXT_M_USB1_1_camera.set_rotate(False) +TXT_M_USB1_1_camera.set_height(240) +TXT_M_USB1_1_camera.set_width(320) +TXT_M_USB1_1_camera.set_fps(15) +TXT_M_USB1_1_camera.start() line_detector = txt_factory.camera_factory.create_line_detector(0, 60, 320, 20, 30, 130, -160, 160, 3) -TXT_M_USB_1_camera.add_detector(line_detector) +TXT_M_USB1_1_camera.add_detector(line_detector) diff --git a/lib/camera.xml b/lib/camera.xml index 2b159fb39bf2986d49cec2ffe33416d5167533c8..10bdb5e75623bd0fd219c8cbf4ab93193bafc197 100644 --- a/lib/camera.xml +++ b/lib/camera.xml @@ -1 +1 @@ -<xml type="camera" verion="1" width="320" height="240" fps="15" version="2"><item id="2" class="LineDetector"><name>line_detector</name><min_line_width>30</min_line_width><max_line_width>130</max_line_width><start_range_value>-160</start_range_value><end_range_value>160</end_range_value><number_of_lines>3</number_of_lines><geometry><x>0</x><y>60</y><width>320</width><height>20</height></geometry></item></xml> \ No newline at end of file +<xml type="camera" verion="1" width="320" height="240" fps="15" version="2" camera_name="TXT_M_USB1_1_camera"><item id="2" class="LineDetector"><name>line_detector</name><min_line_width>30</min_line_width><max_line_width>130</max_line_width><start_range_value>-160</start_range_value><end_range_value>160</end_range_value><number_of_lines>3</number_of_lines><geometry><x>0</x><y>60</y><width>320</width><height>20</height></geometry></item></xml> \ No newline at end of file diff --git a/lib/controller.blockly b/lib/controller.blockly index 7f54bfe69067d0b4f98d8fa59f6c5ddc85d4abfe..e862e2d9393e4aab71409c70be9a3496929b92d1 100644 --- a/lib/controller.blockly +++ b/lib/controller.blockly @@ -1,4 +1,4 @@ -<xml xmlns="https://developers.google.com/blockly/xml" version="12"> +<xml xmlns="https://developers.google.com/blockly/xml" version="13"> <block type="txt4_controller" id="v}Wf^VN(H6-Q3:$II]KJ" x="86" y="69"> <mutation> <arg type="Input" name="Input-0" value="-"/> @@ -10,7 +10,7 @@ <arg type="Servomotor" name="Servomotor-0" value="-"/> <arg type="Counter" name="Counter-0" value="-"/> <arg type="I2C" name="I2C-0" value="-"/> - <arg type="USB" name="USB-0" value="USB_1"/> + <arg type="USB" name="USB-0" value="USB1_1"/> <arg type="USB" name="USB-1" value="-"/> </mutation> <field name="mode">0</field> @@ -24,7 +24,7 @@ <field name="Servomotor-0">-</field> <field name="Counter-0">-</field> <field name="I2C-0">-</field> - <field name="USB-0">USB_1</field> + <field name="USB-0">USB1_1</field> <field name="USB-1">-</field> <value name="Output-0"> <block type="led" id="kh$y;?n1!R6~k@Hvxg{u"/> diff --git a/lib/controller.py b/lib/controller.py index 2768703a8836ce385a18c986dd8ea6ce1da02829..7c6b182a3f452a5824f75bb6c08f62c3c39b740f 100644 --- a/lib/controller.py +++ b/lib/controller.py @@ -10,6 +10,6 @@ TXT_M = txt_factory.controller_factory.create_graphical_controller() TXT_M_O5_led = txt_factory.output_factory.create_led(TXT_M, 5) TXT_M_M1_encodermotor = txt_factory.motor_factory.create_encodermotor(TXT_M, 1) TXT_M_M2_encodermotor = txt_factory.motor_factory.create_encodermotor(TXT_M, 2) -TXT_M_USB_1_camera = txt_factory.usb_factory.create_camera(TXT_M, 1) +TXT_M_USB1_1_camera = txt_factory.usb_factory.create_camera(TXT_M, 1) txt_factory.initialized() \ No newline at end of file