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

commit by robo pro coding

parent 16a85225
No related branches found
No related tags found
No related merge requests found
import threading
from lib.controller import *
from lib.machine_learning import *
from lib.sorting_line import *
threading.Thread(target=thread_SLD, daemon=True).start()
threading.Thread(target=thread_blink, daemon=True).start()
while True:
......
......@@ -15,6 +15,11 @@ TXTWindow {
id: img_label
text: ""
font.pixelSize: 16
font.bold: false
font.italic: false
font.underline: false
horizontalAlignment: Text.AlignLeft
color: "#ffffff"
elide: Text.ElideRight
x: 20
y: 20
......@@ -52,6 +57,11 @@ TXTWindow {
id: version_label
text: "Add-On AI: Version 2023/04/20"
font.pixelSize: 16
font.bold: false
font.italic: false
font.underline: false
horizontalAlignment: Text.AlignLeft
color: "#ffffff"
elide: Text.ElideRight
x: 20
y: 0
......@@ -62,6 +72,11 @@ TXTWindow {
id: part_pass_fail
text: ""
font.pixelSize: 16
font.bold: false
font.italic: false
font.underline: false
horizontalAlignment: Text.AlignLeft
color: "#ffffff"
elide: Text.ElideRight
x: 20
y: 170
......
......@@ -4,7 +4,6 @@ import datetime
import numpy as np
import subprocess
import time
from datetime import datetime
from fischertechnik.camera.VideoStream import VideoStream
from fischertechnik.machine_learning.ObjectDetector import ObjectDetector
......@@ -12,7 +11,6 @@ from lib.camera import *
from lib.controller import *
from lib.display import *
tag = None
value = None
num = None
......
......@@ -105,7 +105,7 @@
<statement name="STACK">
<block type="motor_set_speed" id="EcmXtEb26D15JRM3t0JO">
<field name="instance_name">TXT_SLD_M_M2_encodermotor</field>
<field name="direction">Motor.CCW</field>
<field name="direction">Motor.CW</field>
<value name="speed">
<shadow type="motor_number" id="2qy=15?s`qS^Mn0,rQWl">
<field name="MOTOR_NUM">200</field>
......@@ -295,7 +295,7 @@
<statement name="DO0">
<block type="encodermotor_set_values" id=";0kCCgi4,xTbb}ac~J])">
<field name="instance_name_0">TXT_SLD_M_M2_encodermotor</field>
<field name="direction_0">Motor.CW</field>
<field name="direction_0">Motor.CCW</field>
<value name="speed">
<shadow type="motor_number" id="oq`6vK!o~IK6]CTf-!}s">
<field name="MOTOR_NUM">300</field>
......@@ -376,7 +376,7 @@
<next>
<block type="encodermotor_set_values" id="M@2sYg,Em~3{Nn?JC}?K">
<field name="instance_name_0">TXT_SLD_M_M2_encodermotor</field>
<field name="direction_0">Motor.CW</field>
<field name="direction_0">Motor.CCW</field>
<value name="speed">
<shadow type="motor_number" id="O.E6kQ)40ay7LL~8OF$_">
<field name="MOTOR_NUM">300</field>
......
import time
from fischertechnik.controller.Motor import Motor
from lib.controller import *
from lib.machine_learning import *
MovementSpeedCam = None
MovementSpeed = None
posRED = None
......@@ -31,7 +29,7 @@ def thread_SLD():
def moveRefM2():
global MovementSpeedCam, MovementSpeed, posRED, posBLUE, posCam, i, posFinish, num
TXT_SLD_M_M2_encodermotor.set_speed(int(200), Motor.CCW)
TXT_SLD_M_M2_encodermotor.set_speed(int(200), Motor.CW)
TXT_SLD_M_M2_encodermotor.start()
while True:
if (TXT_SLD_M_I2_mini_switch.is_closed()):
......@@ -62,7 +60,7 @@ def mainSLDexternal():
print('pos camera')
num = MakePictureRunKiReturnFoundPart()
if num == 1:
TXT_SLD_M_M2_encodermotor.set_speed(int(300), Motor.CW)
TXT_SLD_M_M2_encodermotor.set_speed(int(300), Motor.CCW)
TXT_SLD_M_M2_encodermotor.set_distance(int(posRED))
while True:
if (not TXT_SLD_M_M2_encodermotor.is_running()):
......@@ -76,7 +74,7 @@ def mainSLDexternal():
time.sleep(0.010)
elif num == 3:
print('BLUE')
TXT_SLD_M_M2_encodermotor.set_speed(int(300), Motor.CW)
TXT_SLD_M_M2_encodermotor.set_speed(int(300), Motor.CCW)
TXT_SLD_M_M2_encodermotor.set_distance(int(posBLUE))
while True:
if (not TXT_SLD_M_M2_encodermotor.is_running()):
......
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