feat: 更新扫黑除暴
This commit is contained in:
19
subtask.py
19
subtask.py
@@ -603,7 +603,8 @@ class put_hanoi1():
|
||||
time.sleep(0.5)
|
||||
car_stop()
|
||||
time.sleep(0.5)
|
||||
by_cmd.send_distance_x(10, 200)
|
||||
# by_cmd.send_distance_x(10, 200)
|
||||
by_cmd.send_distance_x(10, 180)
|
||||
time.sleep(0.5)
|
||||
|
||||
# 根据方向初始化执行器位置
|
||||
@@ -613,7 +614,7 @@ class put_hanoi1():
|
||||
by_cmd.send_angle_storage(0)
|
||||
else:
|
||||
by_cmd.send_position_axis_x(1, 150)
|
||||
by_cmd.send_angle_claw_arm(215)
|
||||
by_cmd.send_angle_claw_arm(220)
|
||||
by_cmd.send_angle_storage(55)
|
||||
time.sleep(1.5)
|
||||
|
||||
@@ -823,9 +824,12 @@ class move_area2():
|
||||
def nexec(self):
|
||||
by_cmd.send_position_axis_z(20, 0)
|
||||
pass
|
||||
|
||||
# 扫黑除暴
|
||||
class kick_ass():
|
||||
def init(self):
|
||||
while (by_cmd.send_angle_camera(180) == -1):
|
||||
by_cmd.send_angle_camera(180)
|
||||
logger.info("扫黑除暴初始化")
|
||||
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
||||
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
||||
@@ -842,15 +846,22 @@ class kick_ass():
|
||||
time.sleep(1)
|
||||
calibrate_new(tlabel.SIGN, offset = 8, run = True)
|
||||
time.sleep(0.5)
|
||||
|
||||
by_cmd.send_position_axis_z(20, 60)
|
||||
|
||||
if self.target_person == 1:
|
||||
target_distance = self.pos_gap1
|
||||
else:
|
||||
target_distance = self.pos_gap1 + (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1) * 10
|
||||
by_cmd.send_distance_x(10, target_distance)
|
||||
time.sleep(2)
|
||||
time.sleep(5)
|
||||
by_cmd.send_angle_claw_arm(220)
|
||||
by_cmd.send_angle_claw(15)
|
||||
by_cmd.send_position_axis_x(1, 160)
|
||||
time.sleep(2)
|
||||
by_cmd.send_position_axis_x(1, 0)
|
||||
time.sleep(4)
|
||||
by_cmd.send_position_axis_x(1, 160)
|
||||
time.sleep(3)
|
||||
pass
|
||||
def nexec(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user