feat: 初步增加抓取第二个物块和放置动作

This commit is contained in:
bmy
2024-06-12 20:33:32 +08:00
parent 6f426d9576
commit 21ac0f773e
6 changed files with 328 additions and 152 deletions

View File

@@ -276,7 +276,31 @@ class LLM:
self.messages.append(self.resp.to_message())
return self.resp.get_result()
class CountRecord:
def __init__(self, stop_count=2) -> None:
self.last_record = None
self.count = 0
self.stop_cout = stop_count
def get_count(self, val):
try:
if val == self.last_record:
self.count += 1
else:
self.count=0
self.last_record = val
return self.count
except Exception as e:
print(e)
def __call__(self, val):
self.get_count(val)
if self.count >= self.stop_cout:
if type(val) == bool:
return val
return True
else:
return False