From 8312acf175f0fae34f2f2952d77c203fb1dd8c97 Mon Sep 17 00:00:00 2001
From: ft-Demo <fischertechnik-team@fischer.de>
Date: Fri, 22 Oct 2021 09:32:15 +0000
Subject: [PATCH] commit by robo pro coding

---
 omniwheels_x4_soccer_goal.blockly | 60 ++++++++++++++++++-------------
 omniwheels_x4_soccer_goal.py      | 19 +++++-----
 2 files changed, 45 insertions(+), 34 deletions(-)

diff --git a/omniwheels_x4_soccer_goal.blockly b/omniwheels_x4_soccer_goal.blockly
index 5677788..31fc7b0 100644
--- a/omniwheels_x4_soccer_goal.blockly
+++ b/omniwheels_x4_soccer_goal.blockly
@@ -42,7 +42,7 @@
                 <field name="VAR" id="Ym/+Qo0YZe25;%N1d!*f">x_min</field>
                 <value name="VALUE">
                   <block type="math_number" id="@Esp)^vGnSXO=QsK)N9~">
-                    <field name="NUM">-3</field>
+                    <field name="NUM">-20</field>
                   </block>
                 </value>
                 <next>
@@ -50,7 +50,7 @@
                     <field name="VAR" id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</field>
                     <value name="VALUE">
                       <block type="math_number" id="[r2m=DpI#8/tg+.FmdbN">
-                        <field name="NUM">3</field>
+                        <field name="NUM">20</field>
                       </block>
                     </value>
                     <next>
@@ -58,7 +58,7 @@
                         <field name="VAR" id="}*jl@)UA_Hjh5rc,Gt)c">y_ball_far</field>
                         <value name="VALUE">
                           <block type="math_number" id="+Lh~UibuYaJ$9i{V2?E5">
-                            <field name="NUM">7</field>
+                            <field name="NUM">-5</field>
                           </block>
                         </value>
                         <next>
@@ -66,7 +66,7 @@
                             <field name="VAR" id="09n]XF2CKURQs)nHOfam">y_ball_near</field>
                             <value name="VALUE">
                               <block type="math_number" id="7S}[)qBEl/AotP|IAi0!">
-                                <field name="NUM">50</field>
+                                <field name="NUM">60</field>
                               </block>
                             </value>
                             <next>
@@ -510,6 +510,16 @@
                                                                                                     <field name="TEXT">touch</field>
                                                                                                   </shadow>
                                                                                                 </value>
+                                                                                                <next>
+                                                                                                  <block type="procedures_callnoreturn" id=",]C1bWi3P6{]+TEpo{?R">
+                                                                                                    <mutation name="stop"/>
+                                                                                                  </block>
+                                                                                                </next>
+                                                                                              </block>
+                                                                                            </statement>
+                                                                                            <statement name="ELSE">
+                                                                                              <block type="procedures_callnoreturn" id="sx~{uZ4bCDN4vbG6oz~)">
+                                                                                                <mutation name="stop"/>
                                                                                               </block>
                                                                                             </statement>
                                                                                           </block>
@@ -843,7 +853,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="N2EC5uK:$~0ERXAdK0!y" x="0" y="2455">
+  <block type="procedures_defnoreturn" id="N2EC5uK:$~0ERXAdK0!y" x="0" y="2491">
     <field name="NAME">checkTimeouts</field>
     <statement name="STACK">
       <block type="controls_if" id="o.;j7*F0}TW}ju0E18(_">
@@ -989,7 +999,7 @@
       </block>
     </statement>
   </block>
-  <block type="camera_on_ball_detected" id="dgC*A|KHMC_R5S#ZRk}d" x="0" y="2908">
+  <block type="camera_on_ball_detected" id="dgC*A|KHMC_R5S#ZRk}d" x="0" y="2944">
     <field name="instance_name">ball_detector</field>
     <statement name="statement">
       <block type="variables_set" id="=2/,IQfcLO{_5PNd3UK~">
@@ -1163,7 +1173,7 @@
       </block>
     </statement>
   </block>
-  <block type="camera_on_ball_detected" id="Rg2Gt(0WT:J2|Us~[j.3" x="0" y="3469">
+  <block type="camera_on_ball_detected" id="Rg2Gt(0WT:J2|Us~[j.3" x="0" y="3505">
     <field name="instance_name">ball_detector_goal_left</field>
     <statement name="statement">
       <block type="variables_set" id="kvK,D4e%04[?+!jq*Lch">
@@ -1234,7 +1244,7 @@
       </block>
     </statement>
   </block>
-  <block type="camera_on_ball_detected" id="(?slhGsN^:d1`vP{j9#|" x="0" y="3730">
+  <block type="camera_on_ball_detected" id="(?slhGsN^:d1`vP{j9#|" x="0" y="3766">
     <field name="instance_name">ball_detector_goal_right</field>
     <statement name="statement">
       <block type="variables_set" id="0!1?#@4|tcM8+U6E[$Tl">
@@ -1305,7 +1315,7 @@
       </block>
     </statement>
   </block>
-  <block type="input_event" id="j(TuhJ0G}{^qGSq:26FY" x="0" y="3991">
+  <block type="input_event" id="j(TuhJ0G}{^qGSq:26FY" x="0" y="4027">
     <value name="condition">
       <block type="input_photo_transistor_if_state" id="dX]-jf`=2/tNnEnHfKvx">
         <field name="instance_name">TXT_M_I8_photo_transistor</field>
@@ -1328,7 +1338,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="RyK*td9aN5aR;@gw4f)+" collapsed="true" x="0" y="4128">
+  <block type="procedures_defnoreturn" id="RyK*td9aN5aR;@gw4f)+" collapsed="true" x="0" y="4164">
     <field name="NAME">shotBall</field>
     <statement name="STACK">
       <block type="servomotor_set_position" id="9C*rGH2+bsy8H4Xzz#gk">
@@ -1442,7 +1452,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="+FKt%DE[[q%Zp0T.Fn}d" collapsed="true" x="0" y="4195">
+  <block type="procedures_defnoreturn" id="+FKt%DE[[q%Zp0T.Fn}d" collapsed="true" x="0" y="4231">
     <field name="NAME">stop</field>
     <statement name="STACK">
       <block type="encodermotor_stop" id="}]1#.xeDc*.k9aGX5P?4">
@@ -1454,7 +1464,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="/pGK)WReTLfX`L_7oAMD" collapsed="true" x="0" y="4262">
+  <block type="procedures_defnoreturn" id="/pGK)WReTLfX`L_7oAMD" collapsed="true" x="0" y="4298">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="{M*n_!I)eN0.4..0Bzo#"/>
     </mutation>
@@ -1482,7 +1492,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="qX~e_RBh^tj];fOb=cq6" collapsed="true" x="0" y="4329">
+  <block type="procedures_defnoreturn" id="qX~e_RBh^tj];fOb=cq6" collapsed="true" x="0" y="4365">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="{M*n_!I)eN0.4..0Bzo#"/>
     </mutation>
@@ -1510,7 +1520,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="!zD7YDZ.5n?En8cYle4R" collapsed="true" x="0" y="4396">
+  <block type="procedures_defnoreturn" id="!zD7YDZ.5n?En8cYle4R" collapsed="true" x="0" y="4432">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid=",q%qjDTJ~Z@[BoMwORuq"/>
     </mutation>
@@ -1538,7 +1548,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="}KXL0=RKLgCT~yQ];aw:" collapsed="true" x="0" y="4463">
+  <block type="procedures_defnoreturn" id="}KXL0=RKLgCT~yQ];aw:" collapsed="true" x="0" y="4499">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid=",q%qjDTJ~Z@[BoMwORuq"/>
     </mutation>
@@ -1566,7 +1576,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="dhS+rZWE[`RZz:fU3A)e" collapsed="true" x="0" y="4530">
+  <block type="procedures_defnoreturn" id="dhS+rZWE[`RZz:fU3A)e" collapsed="true" x="0" y="4566">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid=",q%qjDTJ~Z@[BoMwORuq"/>
     </mutation>
@@ -1594,7 +1604,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id=")G33?J{l2sdl+nL3hpBp" collapsed="true" x="0" y="4597">
+  <block type="procedures_defnoreturn" id=")G33?J{l2sdl+nL3hpBp" collapsed="true" x="0" y="4633">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid=",q%qjDTJ~Z@[BoMwORuq"/>
     </mutation>
@@ -1622,7 +1632,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="oSa9Ly*^-c^M{$gkMZt1" collapsed="true" x="0" y="4664">
+  <block type="procedures_defnoreturn" id="oSa9Ly*^-c^M{$gkMZt1" collapsed="true" x="0" y="4700">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="K)Z,8|d5@gck+Q]pnW01"/>
       <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="(Id`t]O(jxfZJay}20X{"/>
@@ -1688,7 +1698,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="G@]xamrhDPW$7uQ6oPo#" collapsed="true" x="0" y="4731">
+  <block type="procedures_defnoreturn" id="G@]xamrhDPW$7uQ6oPo#" collapsed="true" x="0" y="4767">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="_mFFsmoZwL{(llRvf-eW"/>
       <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="aNHXtqe[T`=Y[mqp`ZDN"/>
@@ -1754,7 +1764,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="5Hv=PFtVvPQA=IZrkJfU" collapsed="true" x="0" y="4798">
+  <block type="procedures_defnoreturn" id="5Hv=PFtVvPQA=IZrkJfU" collapsed="true" x="0" y="4834">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="~d8Z+AHZ!wz|G]JHW0lQ"/>
       <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="jRMx@L,Ya|zd@/bBb#1T"/>
@@ -1820,7 +1830,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="[S@[MO!Z/cNt:Jsg4dd}" collapsed="true" x="0" y="4865">
+  <block type="procedures_defnoreturn" id="[S@[MO!Z/cNt:Jsg4dd}" collapsed="true" x="0" y="4901">
     <mutation>
       <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="8Z2n_ZVA.)85]V7j%3;7"/>
       <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="J(gJ~*9ZJJa,[V1)[xn#"/>
@@ -1886,7 +1896,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="UFM0X7|X:*ja#f+^7kz;" x="0" y="4932">
+  <block type="procedures_defnoreturn" id="UFM0X7|X:*ja#f+^7kz;" x="0" y="4968">
     <field name="NAME">turnBallLeft</field>
     <statement name="STACK">
       <block type="encodermotor_set_speed" id="I[S{vjf1EdjHVhk32Irr">
@@ -1897,7 +1907,7 @@
         <field name="direction_1">Motor.CW</field>
         <value name="speed">
           <shadow type="motor_number" id="KbM1XwSZ`0p4OfObK%2d">
-            <field name="MOTOR_NUM">150</field>
+            <field name="MOTOR_NUM">0</field>
           </shadow>
         </value>
         <next>
@@ -1917,7 +1927,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="*i[s2YTWD*g9HS4dxkPq" x="0" y="5125">
+  <block type="procedures_defnoreturn" id="*i[s2YTWD*g9HS4dxkPq" x="0" y="5161">
     <field name="NAME">turnBallRight</field>
     <statement name="STACK">
       <block type="encodermotor_set_speed" id="c8~SXys:o35ETKj;GX?m">
@@ -1928,7 +1938,7 @@
         <field name="direction_1">Motor.CCW</field>
         <value name="speed">
           <shadow type="motor_number" id="dD.1u9Pwx-^rnKZyWQx/">
-            <field name="MOTOR_NUM">150</field>
+            <field name="MOTOR_NUM">0</field>
           </shadow>
         </value>
         <next>
diff --git a/omniwheels_x4_soccer_goal.py b/omniwheels_x4_soccer_goal.py
index 3614165..97c5b09 100644
--- a/omniwheels_x4_soccer_goal.py
+++ b/omniwheels_x4_soccer_goal.py
@@ -225,8 +225,8 @@ def right(v, ticks):
 
 def turnBallLeft():
     global v, ticks, factor_x, ts_ball, ts_goal_left, ts_goal_right, factor_y, posx_ball, dist_x, x_min, posy_ball, speed_y, posx_goal, x_max, y_ball_far, y_ball_near, y_ball_touch, v_slow, v_fast
-    TXT_M_M1_encodermotor.set_speed(int(150), Motor.CCW)
-    TXT_M_M2_encodermotor.set_speed(int(150), Motor.CW)
+    TXT_M_M1_encodermotor.set_speed(int(0), Motor.CCW)
+    TXT_M_M2_encodermotor.set_speed(int(0), Motor.CW)
     TXT_M_M1_encodermotor.start_sync(TXT_M_M2_encodermotor)
     TXT_M_M3_encodermotor.set_speed(int(512), Motor.CW)
     TXT_M_M4_encodermotor.set_speed(int(512), Motor.CCW)
@@ -235,8 +235,8 @@ def turnBallLeft():
 
 def turnBallRight():
     global v, ticks, factor_x, ts_ball, ts_goal_left, ts_goal_right, factor_y, posx_ball, dist_x, x_min, posy_ball, speed_y, posx_goal, x_max, y_ball_far, y_ball_near, y_ball_touch, v_slow, v_fast
-    TXT_M_M1_encodermotor.set_speed(int(150), Motor.CW)
-    TXT_M_M2_encodermotor.set_speed(int(150), Motor.CCW)
+    TXT_M_M1_encodermotor.set_speed(int(0), Motor.CW)
+    TXT_M_M2_encodermotor.set_speed(int(0), Motor.CCW)
     TXT_M_M1_encodermotor.start_sync(TXT_M_M2_encodermotor)
     TXT_M_M3_encodermotor.set_speed(int(512), Motor.CCW)
     TXT_M_M4_encodermotor.set_speed(int(512), Motor.CW)
@@ -245,10 +245,10 @@ def turnBallRight():
 
 factor_x = 0.2
 factor_y = 3.5
-x_min = -3
-x_max = 3
-y_ball_far = 7
-y_ball_near = 50
+x_min = -20
+x_max = 20
+y_ball_far = -5
+y_ball_near = 60
 y_ball_touch = 74
 v_slow = 200
 v_fast = 512
@@ -282,8 +282,9 @@ while True:
                     turnBallLeft()
                 elif posy_ball <= y_ball_touch:
                     print('touch')
+                    stop()
                 else:
-                    pass
+                    stop()
         elif False:
             if posx_goal[0] < x_min:
                 sideleft_v(180)
-- 
GitLab