区域赛版本
This commit is contained in:
33
subtask.py
33
subtask.py
@@ -546,7 +546,7 @@ class put_block():
|
||||
ret, box = filter.get(tlabel.HOSPITAL)
|
||||
if ret > 0:
|
||||
width = box[0][2] - box[0][0]
|
||||
if width > 130:
|
||||
if width > 135:
|
||||
return True
|
||||
return False
|
||||
def exec(self):
|
||||
@@ -557,7 +557,7 @@ class put_block():
|
||||
by_cmd.send_distance_x(10, 100)
|
||||
by_cmd.send_position_axis_z(30, 0)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_position_axis_x(1, 20)
|
||||
by_cmd.send_position_axis_x(1, 50) # 20
|
||||
time.sleep(1)
|
||||
by_cmd.send_angle_claw(63)
|
||||
time.sleep(1)
|
||||
@@ -582,7 +582,7 @@ class put_block():
|
||||
time.sleep(1)
|
||||
by_cmd.send_position_axis_z(30, 0)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_position_axis_x(1, 20)
|
||||
by_cmd.send_position_axis_x(1, 50)
|
||||
time.sleep(1.5)
|
||||
by_cmd.send_angle_claw(45)
|
||||
time.sleep(1)
|
||||
@@ -702,12 +702,12 @@ class up_tower():
|
||||
by_cmd.send_distance_x(-10, 120)
|
||||
time.sleep(1)
|
||||
# 上古參數
|
||||
# by_cmd.send_distance_y(-10, 50)
|
||||
by_cmd.send_distance_y(-10, 80)
|
||||
# 6_9 模型參數
|
||||
by_cmd.send_distance_y(-10, 40)
|
||||
# by_cmd.send_distance_y(-10, 40)
|
||||
# 7_12_3 模型參數
|
||||
# by_cmd.send_distance_y(-10, 50)
|
||||
# time.sleep(1)
|
||||
time.sleep(2)
|
||||
car_stop()
|
||||
# FIXME 如果下發 distance 後直接 car_stop,則 distance 執行時間僅由指令間處理延時決定
|
||||
# time.sleep(3)
|
||||
@@ -758,21 +758,23 @@ class get_rball():
|
||||
# 靠近塔
|
||||
by_cmd.send_angle_scoop(20)
|
||||
# 上古參數
|
||||
# by_cmd.send_distance_y(-15, 45) # 50
|
||||
by_cmd.send_distance_y(-15, 70) # 50
|
||||
# 6_9 參數
|
||||
by_cmd.send_distance_y(-15, 35)
|
||||
time.sleep(2)
|
||||
# by_cmd.send_distance_y(-15, 35)
|
||||
# time.sleep(2)
|
||||
# 7_12_3 參數
|
||||
# by_cmd.send_distance_y(-15, 45)
|
||||
# time.sleep(2)
|
||||
time.sleep(2)
|
||||
car_stop()
|
||||
calibrate_new(tlabel.RBALL,offset = 44, run = True)
|
||||
time.sleep(1)
|
||||
logger.info("抓红球")
|
||||
# by_cmd.send_angle_scoop(15)
|
||||
# by_cmd.send_angle_scoop(12)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_position_axis_z(30, 170)
|
||||
time.sleep(2.5)
|
||||
by_cmd.send_angle_scoop(12)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_angle_scoop(7)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_speed_y(15)
|
||||
@@ -811,7 +813,7 @@ class put_bball():
|
||||
calibrate_new(tlabel.BASKET,offset = -40, run = True, run_speed = 6)
|
||||
# by_cmd.send_distance_x(10, 10)
|
||||
# 向左运动
|
||||
# by_cmd.send_distance_y(-10, 35)
|
||||
by_cmd.send_distance_y(-10, 35)
|
||||
# by_cmd.send_angle_storage(10)
|
||||
# time.sleep(1)
|
||||
|
||||
@@ -944,7 +946,7 @@ class put_hanoi1():
|
||||
def after(self):
|
||||
# var.switch_lane_model = True
|
||||
if utils.direction == tlabel.RMARK:
|
||||
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"] - 0.3, cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"] - 0.2, cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||
else:
|
||||
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"], cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||
pass
|
||||
@@ -1184,7 +1186,7 @@ class put_hanoi2():
|
||||
# while True:
|
||||
# pass
|
||||
by_cmd.send_speed_x(12)
|
||||
time.sleep(1.5)
|
||||
time.sleep(1.2)
|
||||
def nexec(self):
|
||||
pass
|
||||
def after(self):
|
||||
@@ -1194,6 +1196,7 @@ class put_hanoi2():
|
||||
else:
|
||||
var.pid_turning.set(cfg["put_hanoi2"]["pid_kp"], cfg["put_hanoi2"]["pid_ki"], cfg["put_hanoi2"]["pid_kd"])
|
||||
# time.sleep(2)
|
||||
var.task_speed = 13
|
||||
pass
|
||||
|
||||
class put_hanoi3():
|
||||
@@ -1485,7 +1488,7 @@ class kick_ass():
|
||||
ret, box = filter.get(tlabel.BASE)
|
||||
if ret:
|
||||
error = (box[0][2] + box[0][0] - 320) / 2
|
||||
by_cmd.send_speed_omega(-error * 0.8)
|
||||
by_cmd.send_speed_omega(-error * 0.8)
|
||||
time.sleep(0.02)
|
||||
# by_cmd.send_speed_x(25)
|
||||
# time.sleep(4)
|
||||
|
||||
Reference in New Issue
Block a user