修改钢针到达抓料点位后再收缩和在震动点不走的问题

This commit is contained in:
cdeyw
2025-02-26 12:29:23 +08:00
parent 0e69647b11
commit ef50aed6bb
7 changed files with 9567 additions and 3801 deletions

View File

@ -36,7 +36,7 @@ class Catch:
# 本身IO
##self.robotClient.sendIOControl(self.robotClient.con_ios[0],1)
# 网络继电器
open(1, 0, 0)
close(1, 0, 0)
self.is_send_take_command = True
if self.catch_status == CatchStatus.CDrop:
@ -45,15 +45,16 @@ class Catch:
# self.robotClient.sendIOControl(self.robotClient.con_ios[0], 0)
# 网络继电器
close(1, 0, 0)
time.sleep(1)
for _ in range(self.drop_count):
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 1, delay=self.robotClient.time_delay_put)
open(0, 1, 0)
open(0, 0, 1)
time.sleep(self.robotClient.time_delay_put) # 会造成这个时间点 其他命令插入不进去 需要另开线程
close(0, 1, 0)
close(0, 0, 1)
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 0)
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 1)
open(0, 1, 0)
close(0, 0, 1)
self.is_send_command = True
if self.drop_continue.Q(True,self.robotClient.time_delay_put*1000*self.drop_count):
# if Constant.Debug or self.robotClient.check_outputQ(self.robotClient.con_ios[1]) and not self.robotClient.check_outputQ(self.robotClient.con_ios[0]):
@ -63,23 +64,25 @@ class Catch:
if self.catch_status == CatchStatus.CShake: # 1500
self.shake_Q = not self.shake_Q # 10
if not self.shake_continue.Q(True, 600):
if not self.shake_continue.Q(True, 4000):
if self.shake_Q:
open(0, 0, 1)
open(0, 1, 0)
else:
close(0, 0, 1)
close(0, 1, 0)
else:
self.shake_continue.SetReset()
self.catch_status = CatchStatus.COk
#if Constant.Debug or self.robotClient.check_outputQ(self.robotClient.con_ios[2]):
# self.robotClient.sendIOControl(self.robotClient.con_ios[2], 0)
close(0, 0, 1)
close(0, 1, 0)
print("震动结束")
if self.catch_status == CatchStatus.COk :
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 0,emptyList='1')
open(1,0,0)
close(0, 1, 0)
close(0, 0, 1)
self.is_send_take_command = False
pass

View File

@ -76,8 +76,8 @@ def close(grasp, shake, throw):
time.sleep(0.5)
# 关闭电磁阀
# open(True, False, False) # 参数传True和False
# close(False,False,True)
# open(False, False, True) # 参数传True和False
# close(True,False,True)
# for i in range(10):
# open(False,True,True)
# close(True,True,True)

View File

@ -448,8 +448,13 @@ class Feeding(QObject):
#self.feedConfig.feedLine.set_take_position(None)
# time.sleep(self.robotClient.time_delay_take)
self.log_signal.emit(logging.INFO, Constant.str_feed_take_success)
self.next_position()
self.catch.catch_status = CatchStatus.COk
if self.catch.catch_status == CatchStatus.COk:
self.next_position()
self.catch.catch_status = CatchStatus.CNone
return
if self.catch.catch_status == CatchStatus.CTake:
self.catch.catch_status = CatchStatus.COk
else:
self.log_signal.emit(logging.ERROR, Constant.str_feed_takePhoto_fail)
@ -483,6 +488,7 @@ class Feeding(QObject):
if self.catch.catch_status == CatchStatus.COk:
self.catch.catch_status = CatchStatus.CNone
self.next_position()
return
if self.catch.catch_status == CatchStatus.CNone:
self.catch.catch_status = CatchStatus.CShake
return