Skip to content

Commit 925c76d

Browse files
committed
feat: make car can recatch ball when miss catch
1 parent ed7a680 commit 925c76d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ def main():
6464
current_obs = robot.get_observation()
6565
frame = current_obs["front"]
6666
if get_robot_status() == RobotStatus.FIND_BUCKET:
67+
gripper_pos = current_obs.get('arm_gripper.pos', 5)
68+
is_gripper_holding = gripper_pos > 25
69+
70+
if is_gripper_holding is False:
71+
set_robot_status(RobotStatus.SEARCH)
72+
reset_robot()
73+
continue
74+
6775
result = get_red_bucket_local(frame) # 找桶的算法
6876
else:
6977
result = yolo_infer(frame) # 找球的算法

0 commit comments

Comments
 (0)