From db3c56bc16b46e07c212b177db3a5d385db73a50 Mon Sep 17 00:00:00 2001 From: ft-Demo <fischertechnik-team@fischer.de> Date: Tue, 23 Aug 2022 08:23:56 +0000 Subject: [PATCH] commit by robo pro coding --- .project.json | 2 +- Buggy_Line_Follower_with_P_Controller.blockly | 2 +- Buggy_Line_Follower_with_P_Controller.py | 4 ++-- lib/camera.py | 12 ++++++------ lib/camera.xml | 2 +- lib/controller.blockly | 6 +++--- lib/controller.py | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.project.json b/.project.json index b8d6c4b..97fbb60 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 cebe850..046831d 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 d472329..1b2a9eb 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 683272e..c3d2524 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 2b159fb..10bdb5e 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 7f54bfe..e862e2d 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 2768703..7c6b182 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 -- GitLab