Skip to content
Snippets Groups Projects
Commit db3c56bc authored by ft-Demo's avatar ft-Demo
Browse files

commit by robo pro coding

parent f938db76
Branches master
No related tags found
No related merge requests found
{"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
<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>
......
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
......
......@@ -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)
<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
<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"/>
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment