Skip to content

Commit 265b2c9

Browse files
committed
fix bug
1 parent 5e528aa commit 265b2c9

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
['260', '5', '140']
1+
['260', '5', '142']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
['265', '5', '93']
1+
['265', '5', '92']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
['260', '5', '140']
1+
['260', '5', '142']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
['265', '5', '93']
1+
['265', '5', '92']

libraries/res/yolov5_detect.png

3.35 KB
Loading

main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,10 +1736,14 @@ def moved(self, x, y, yaw_degrees, pos_index=None):
17361736
try:
17371737
# print('x', x)
17381738
# print('y', y)
1739-
if x < 235:
1739+
if 200 < x < 235:
17401740
self.camera_z -= 5
17411741
elif 235 < x < 239:
17421742
self.camera_z -= 3
1743+
elif x > 278:
1744+
self.camera_z += 3
1745+
elif x < 200:
1746+
return
17431747
else:
17441748
self.camera_z = self.camera_z
17451749

@@ -1898,13 +1902,16 @@ def moved(self, x, y, yaw_degrees, pos_index=None):
18981902
# open pump
18991903
if func != 'object recognition' or func != '物体识别' or func != 'Color recognition grip' or func != '颜色识别 夹爪' or func != 'Intelligent gripping' or func != '智能夹取':
19001904
self.pump_on()
1905+
19011906
time.sleep(1.5)
19021907
tmp = []
19031908
while True:
19041909
if not tmp:
19051910
tmp = self.myCobot.get_angles()
19061911
else:
19071912
break
1913+
time.sleep(0.05)
1914+
time.sleep(0.5)
19081915
self.myCobot.send_angles([tmp[0], -0.71, -54.49, -23.02, 89.56, tmp[5]],
19091916
25) # [18.8, -7.91, -54.49, -23.02, -0.79, -14.76]
19101917
time.sleep(2)
@@ -1929,7 +1936,7 @@ def moved(self, x, y, yaw_degrees, pos_index=None):
19291936
delay_time = 4
19301937
else:
19311938
color = 0
1932-
delay_time = 3.5
1939+
delay_time = 4
19331940
if func in ['特征点识别', 'Keypoints'] and self.radioButton_auto.isChecked():
19341941
print('position index:', pos_index)
19351942
self.myCobot.send_angles(self.move_coords_to_angles[pos_index], 30)

0 commit comments

Comments
 (0)