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

This commit is contained in:
cdeyw
2025-02-27 10:48:42 +08:00
parent ef50aed6bb
commit 308ac2229c
4 changed files with 1502 additions and 7 deletions

View File

@ -29,6 +29,10 @@ class Catch:
self.shake_Q = False self.shake_Q = False
def run(self): def run(self):
if self.catch_status == CatchStatus.CNone: if self.catch_status == CatchStatus.CNone:
self.shake_continue.SetReset()
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 0,emptyList='1')
close(0, 1, 0)
self.is_send_take_command = False
return return
if self.catch_status == CatchStatus.CTake: if self.catch_status == CatchStatus.CTake:
@ -64,20 +68,21 @@ class Catch:
if self.catch_status == CatchStatus.CShake: # 1500 if self.catch_status == CatchStatus.CShake: # 1500
self.shake_Q = not self.shake_Q # 10 self.shake_Q = not self.shake_Q # 10
if not self.shake_continue.Q(True, 4000): if not self.shake_continue.Q(True, 6000):
if self.shake_Q: if self.shake_Q:
open(0, 1, 0) open(0, 1, 0)
else: else:
close(0, 1, 0) close(0, 1, 0)
else: else:
self.shake_continue.SetReset() self.shake_continue.SetReset()
self.catch_status = CatchStatus.COk #self.catch_status = CatchStatus.COk
#if Constant.Debug or self.robotClient.check_outputQ(self.robotClient.con_ios[2]): #if Constant.Debug or self.robotClient.check_outputQ(self.robotClient.con_ios[2]):
# self.robotClient.sendIOControl(self.robotClient.con_ios[2], 0) # self.robotClient.sendIOControl(self.robotClient.con_ios[2], 0)
close(0, 1, 0) close(0, 1, 0)
print("震动结束") print("震动结束")
if self.catch_status == CatchStatus.COk : if self.catch_status == CatchStatus.COk :
self.shake_continue.SetReset()
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 0,emptyList='1') # self.robotClient.sendIOControl(self.robotClient.con_ios[1], 0,emptyList='1')
open(1,0,0) open(1,0,0)
close(0, 1, 0) close(0, 1, 0)

View File

@ -38,7 +38,7 @@ class Detect:
target_position, noraml_base = getPosition(*xyz, *uvw, None, points) target_position, noraml_base = getPosition(*xyz, *uvw, None, points)
position = Real_Position().init_position(*target_position[:3], *noraml_base[:3]) position = Real_Position().init_position(*target_position[:3], *noraml_base[:3])
position.Z = position.Z + 200 position.Z = position.Z
self.detect_position = position self.detect_position = position
self.detect_status = DetectStatus.DOk self.detect_status = DetectStatus.DOk

View File

@ -485,18 +485,23 @@ class Feeding(QObject):
if self.get_current_position().get_position().compare(real_position,is_action=True): if self.get_current_position().get_position().compare(real_position,is_action=True):
# TODO 震动方案 # TODO 震动方案
self.log_signal.emit(logging.INFO, Constant.str_feed_shake) self.log_signal.emit(logging.INFO, Constant.str_feed_shake)
if self.catch.catch_status == CatchStatus.COk:
self.catch.catch_status = CatchStatus.CNone
self.next_position()
return
if self.catch.catch_status == CatchStatus.CNone: if self.catch.catch_status == CatchStatus.CNone:
self.catch.catch_status = CatchStatus.CShake self.catch.catch_status = CatchStatus.CShake
return return
if self.catch.catch_status == CatchStatus.CShake: if self.catch.catch_status == CatchStatus.CShake:
# if self.feedConfig.feedLine.feeding_to_end[
# self.feedConfig.feedLine.feeding2end_pos_index + 1].status != FeedStatus.FShake:
# self.catch.catch_status = CatchStatus.COk
# else:
self.catch.shake_continue.SetReset()
self.next_position()
if self.feedStatus!=FeedStatus.FShake:
self.catch.catch_status = CatchStatus.CNone
return return
elif self.feedStatus == FeedStatus.FDropBag: elif self.feedStatus == FeedStatus.FDropBag:

File diff suppressed because it is too large Load Diff