国赛出发前版本
fix: 补充 action 列表检查 pref: 修改 BBALL offset 值 (未同步到其他备份 subtask.py 中) 套用8822参数
This commit is contained in:
@@ -555,7 +555,7 @@ class put_block():
|
||||
ret, box = filter.get(tlabel.HOSPITAL)
|
||||
if ret > 0:
|
||||
width = box[0][2] - box[0][0]
|
||||
if width > 130: #135
|
||||
if width > 125: #135
|
||||
return True
|
||||
return False
|
||||
def exec(self):
|
||||
@@ -650,7 +650,7 @@ class get_bball():
|
||||
time.sleep(0.5)
|
||||
for _ in range(3):
|
||||
by_cmd.send_position_axis_z(30, 155)
|
||||
calibrate_right_new(tlabel.BBALL, offset = 18, run = True, run_speed = 5)
|
||||
calibrate_right_new(tlabel.BBALL, offset = 10, run = True, run_speed = 5)
|
||||
logger.info("抓蓝色球")
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_angle_claw_arm(45)
|
||||
@@ -775,7 +775,7 @@ class get_rball():
|
||||
by_cmd.send_angle_scoop(20)
|
||||
# 上古參數
|
||||
# by_cmd.send_distance_y(-15, 50) # 50 # 70
|
||||
by_cmd.send_istance_y(-15, 40) # 50 # 70
|
||||
by_cmd.send_distance_y(-15, 40) # 50 # 70
|
||||
time.sleep(0.5)
|
||||
# 6_9 參數
|
||||
# by_cmd.send_distance_y(-15, 35)
|
||||
@@ -1548,6 +1548,16 @@ class move_area2():
|
||||
if len(resp_commands) == 0:
|
||||
return
|
||||
action_list = resp_commands
|
||||
|
||||
# 先检查一下 action 是否生成正确,如果不正确直接跳过
|
||||
actions_keys = self.action_dict.keys()
|
||||
try:
|
||||
for action in action_list:
|
||||
if not (action.get('action') in actions_keys):
|
||||
return
|
||||
except:
|
||||
return
|
||||
|
||||
# 进入停车区域
|
||||
by_cmd.send_distance_y(10, 450)
|
||||
time.sleep((450 * 5 / 1000) + 0.5)
|
||||
|
||||
Reference in New Issue
Block a user