pref: 扫黑除暴动作修改
This commit is contained in:
@@ -557,7 +557,7 @@ class put_block():
|
||||
ret, box = filter.get(tlabel.HOSPITAL)
|
||||
if ret > 0:
|
||||
width = box[0][2] - box[0][0]
|
||||
if width > 135:
|
||||
if width > 130: #135
|
||||
return True
|
||||
return False
|
||||
def exec(self):
|
||||
@@ -568,7 +568,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, 50) # 20
|
||||
by_cmd.send_position_axis_x(1, 30) # 20
|
||||
time.sleep(1)
|
||||
by_cmd.send_angle_claw(63)
|
||||
time.sleep(1)
|
||||
@@ -593,7 +593,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, 50)
|
||||
by_cmd.send_position_axis_x(1, 30)
|
||||
time.sleep(1.5)
|
||||
by_cmd.send_angle_claw(45)
|
||||
time.sleep(1)
|
||||
@@ -666,7 +666,7 @@ class get_bball():
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_distance_axis_z(30, -40)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_angle_claw_arm(80)
|
||||
by_cmd.send_angle_claw_arm(90)
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_angle_claw(54)
|
||||
time.sleep(0.5)
|
||||
@@ -1018,7 +1018,7 @@ class put_hanoi2():
|
||||
time.sleep(0.5)
|
||||
logger.info("抓大平台")
|
||||
if utils.direction is tlabel.RMARK:
|
||||
by_cmd.send_position_axis_z(30, 30)
|
||||
by_cmd.send_position_axis_z(30, 40)
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
by_cmd.send_angle_claw(63)
|
||||
time.sleep(2)
|
||||
@@ -1030,7 +1030,7 @@ class put_hanoi2():
|
||||
time.sleep(1)
|
||||
pass
|
||||
else:
|
||||
by_cmd.send_position_axis_z(30, 30)
|
||||
by_cmd.send_position_axis_z(30, 40)
|
||||
by_cmd.send_position_axis_x(1, 40)
|
||||
by_cmd.send_angle_claw(63)
|
||||
time.sleep(2)
|
||||
@@ -1078,7 +1078,7 @@ class put_hanoi2():
|
||||
time.sleep(0.5)
|
||||
logger.info("抓中平台")
|
||||
if utils.direction is tlabel.RMARK:
|
||||
by_cmd.send_position_axis_z(30, 30)
|
||||
by_cmd.send_position_axis_z(30, 40)
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
by_cmd.send_angle_claw(55)
|
||||
time.sleep(2)
|
||||
@@ -1090,7 +1090,7 @@ class put_hanoi2():
|
||||
time.sleep(1)
|
||||
pass
|
||||
else:
|
||||
by_cmd.send_position_axis_z(30, 30)
|
||||
by_cmd.send_position_axis_z(30, 40)
|
||||
by_cmd.send_position_axis_x(1, 40)
|
||||
by_cmd.send_angle_claw(55)
|
||||
time.sleep(2)
|
||||
@@ -1109,7 +1109,7 @@ class put_hanoi2():
|
||||
time.sleep(0.5)
|
||||
logger.info("放中平台")
|
||||
if utils.direction is tlabel.RMARK:
|
||||
by_cmd.send_position_axis_z(30, 140)
|
||||
by_cmd.send_position_axis_z(30, 150)
|
||||
time.sleep(2)
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
time.sleep(2)
|
||||
@@ -1121,7 +1121,7 @@ class put_hanoi2():
|
||||
time.sleep(1)
|
||||
pass
|
||||
else:
|
||||
by_cmd.send_position_axis_z(30, 140)
|
||||
by_cmd.send_position_axis_z(30, 150)
|
||||
time.sleep(2)
|
||||
by_cmd.send_position_axis_x(1, 40)
|
||||
time.sleep(2)
|
||||
@@ -1139,7 +1139,7 @@ class put_hanoi2():
|
||||
time.sleep(0.5)
|
||||
logger.info("抓小平台")
|
||||
if utils.direction is tlabel.RMARK:
|
||||
by_cmd.send_position_axis_z(30, 30)
|
||||
by_cmd.send_position_axis_z(30, 40)
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
by_cmd.send_angle_claw(50)
|
||||
time.sleep(2)
|
||||
@@ -1151,7 +1151,7 @@ class put_hanoi2():
|
||||
time.sleep(2)
|
||||
pass
|
||||
else:
|
||||
by_cmd.send_position_axis_z(30, 30)
|
||||
by_cmd.send_position_axis_z(30, 40)
|
||||
by_cmd.send_position_axis_x(1, 40)
|
||||
by_cmd.send_angle_claw(50)
|
||||
time.sleep(2)
|
||||
@@ -1170,7 +1170,7 @@ class put_hanoi2():
|
||||
time.sleep(0.5)
|
||||
logger.info("放小平台")
|
||||
if utils.direction is tlabel.RMARK:
|
||||
by_cmd.send_position_axis_z(30, 200) # 170 #190(new)
|
||||
by_cmd.send_position_axis_z(30, 210) # 170 #190(new)
|
||||
time.sleep(1.5)
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
time.sleep(2)
|
||||
@@ -1186,7 +1186,7 @@ class put_hanoi2():
|
||||
# car_stop()
|
||||
pass
|
||||
else:
|
||||
by_cmd.send_position_axis_z(30, 200)
|
||||
by_cmd.send_position_axis_z(30, 210)
|
||||
time.sleep(1.5)
|
||||
by_cmd.send_position_axis_x(1, 40)
|
||||
time.sleep(2)
|
||||
@@ -1537,6 +1537,14 @@ 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)
|
||||
@@ -1607,44 +1615,26 @@ class kick_ass():
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
|
||||
# 移动到中间
|
||||
by_cmd.send_distance_x(10, 295)
|
||||
time.sleep(1)
|
||||
by_cmd.send_angle_claw(15)
|
||||
by_cmd.send_angle_claw_arm(225)
|
||||
time.sleep(1)
|
||||
by_cmd.send_position_axis_z(30, 80)
|
||||
time.sleep(1)
|
||||
|
||||
# 先移动到第一个人的地方
|
||||
by_cmd.send_distance_x(10, self.pos_gap1)
|
||||
time.sleep(1.5)
|
||||
if self.target_person == 1:
|
||||
by_cmd.send_distance_x(-10, 150)
|
||||
time.sleep(1.5)
|
||||
car_stop()
|
||||
elif self.target_person == 2:
|
||||
by_cmd.send_distance_x(-10, 50)
|
||||
time.sleep(1.5)
|
||||
car_stop()
|
||||
elif self.target_person == 3:
|
||||
by_cmd.send_distance_x(10, 50)
|
||||
time.sleep(1.5)
|
||||
car_stop()
|
||||
# target_distance = self.pos_gap1
|
||||
pass
|
||||
else:
|
||||
by_cmd.send_distance_x(10, 150)
|
||||
time.sleep(1.5)
|
||||
car_stop()
|
||||
|
||||
# 先移动到第一个人的地方 假动作
|
||||
# by_cmd.send_distance_x(10, self.pos_gap1)
|
||||
# time.sleep(1.5)
|
||||
|
||||
# if self.target_person == 1:
|
||||
# # target_distance = self.pos_gap1
|
||||
# pass
|
||||
# else:
|
||||
# # target_distance = self.pos_gap1 + (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1) * 10
|
||||
# target_distance = (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1) * 10
|
||||
# by_cmd.send_distance_x(10, target_distance)
|
||||
# logger.info(f"target distance {target_distance}")
|
||||
# time.sleep(1.5 + (self.target_person - 1) * 0.7 )
|
||||
# car_stop()
|
||||
# target_distance = self.pos_gap1 + (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1) * 10
|
||||
target_distance = (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1 - 1) * 10
|
||||
by_cmd.send_distance_x(10, target_distance)
|
||||
logger.info(f"target distance {target_distance}")
|
||||
time.sleep(1.5 + (self.target_person - 1) * 0.7 )
|
||||
car_stop()
|
||||
|
||||
# by_cmd.send_angle_claw_arm(225)
|
||||
# time.sleep(0.5)
|
||||
|
||||
Reference in New Issue
Block a user