feat: 更新扫黑除暴
This commit is contained in:
@@ -9,8 +9,8 @@ GetBBall_enable = false # 整装上阵使能
|
||||
UpTower_enable = false # 通信抢修使能
|
||||
GetRBall_enable = false # 高空排险使能
|
||||
PutBBall_enable = false # 派发物资使能
|
||||
PutHanoi_enable = true # 物资盘点使能
|
||||
MoveArea_enable = true # 应急避险使能
|
||||
PutHanoi_enable = false # 物资盘点使能
|
||||
MoveArea_enable = false # 应急避险使能
|
||||
KickAss_enable = true # 扫黑除暴使能
|
||||
|
||||
[find_counts]
|
||||
|
||||
@@ -23,4 +23,4 @@ llm_enable = false # 大模型机器人
|
||||
[kick_ass]
|
||||
pos_gap1 = 150 # 目标牌和第一个 person 之间的距离
|
||||
pos_gap2 = 80 # person 之间的距离
|
||||
target_person = 3
|
||||
target_person = 1
|
||||
|
||||
@@ -70,19 +70,19 @@ class main_task():
|
||||
error_abs = abs(self.lane_error)
|
||||
|
||||
if error_abs > 45:
|
||||
speed = 10
|
||||
speed = 8
|
||||
# pid_out = self.lane_error * 1.1
|
||||
# self.pid1.set(1, 0, 0)
|
||||
elif error_abs > 35:
|
||||
speed = 10
|
||||
speed = 13
|
||||
# pid_out = self.lane_error * 1
|
||||
# self.pid1.set(1, 0, 0)
|
||||
elif error_abs > 25:
|
||||
speed = 13
|
||||
speed = 15
|
||||
# pid_out = self.lane_error * 1
|
||||
# self.pid1.set(1.8, 0, 0)
|
||||
elif error_abs > 15:
|
||||
speed = 13
|
||||
speed = 15
|
||||
# pid_out = self.lane_error * 0.8
|
||||
# self.pid1.set(1.8, 0, 0)
|
||||
else:
|
||||
|
||||
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