提交 6_9 巡线模型参数和子任务

This commit is contained in:
bmy
2024-07-12 20:31:12 +08:00
parent 326bfb4d9a
commit 6d9fb5b42a
8 changed files with 4378 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
[kick_ass]
target_person = 4
target_person = 3
[task]
Subtask_enable = true

61
cfg_subtask.toml.6_9.bak Normal file
View File

@@ -0,0 +1,61 @@
[get_block]
pid_kp = 0.9
pid_ki = 0
pid_kd = 0
first_block = "blue"
[put_block]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
[get_bball]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
[up_tower]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[get_rball]
pid_kp = 0.6
pid_ki = 0
pid_kd = 0
[put_bball]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[put_hanoi1]
pid_kp = 0.7
pid_ki = 0
pid_kd = 0
[put_hanoi2]
pid_kp = 1
pid_ki = 0
pid_kd = 0
pos_gap = 160
first_target = "mp"
[put_hanoi3]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[move_area]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
llm_enable = false
[kick_ass]
pid_kp = 0.8
pid_ki = 0
pid_kd = 0
pos_gap1 = 150
pos_gap2 = 80
target_person = 1

61
cfg_subtask.toml.7126.bak Normal file
View File

@@ -0,0 +1,61 @@
[get_block]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
first_block = "blue"
[put_block]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[get_bball]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
[up_tower]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[get_rball]
pid_kp = 1.0
pid_ki = 0
pid_kd = 0
[put_bball]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[put_hanoi1]
pid_kp = 1.3
pid_ki = 0
pid_kd = 0
[put_hanoi2]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
pos_gap = 160
first_target = "mp"
[put_hanoi3]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
[move_area]
pid_kp = 1.4
pid_ki = 0
pid_kd = 0
llm_enable = false
[kick_ass]
pid_kp = 1.2
pid_ki = 0
pid_kd = 0
pos_gap1 = 150
pos_gap2 = 80
target_person = 1

View File

@@ -657,8 +657,19 @@ class up_tower():
# calibrate(tlabel.TOWER, 27, False, 6)
by_cmd.send_distance_x(-10, 120)
time.sleep(1)
by_cmd.send_distance_y(-10, 50)
time.sleep(3)
# 上古參數
# by_cmd.send_distance_y(-10, 50)
# 6_9 模型參數
by_cmd.send_distance_y(-10, 40)
# 7_12_3 模型參數
# by_cmd.send_distance_y(-10, 50)
# time.sleep(1)
car_stop()
# FIXME 如果下發 distance 後直接 car_stop則 distance 執行時間僅由指令間處理延時決定
# time.sleep(3)
# by_cmd.send_speed_y(-10)
# time.sleep(0.15)
by_cmd.send_angle_zhuan(10)
time.sleep(12)
by_cmd.send_speed_y(10)
@@ -702,8 +713,15 @@ class get_rball():
time.sleep(0.5)
# 靠近塔
by_cmd.send_angle_scoop(20)
by_cmd.send_distance_y(-15, 45) # 50
# 上古參數
# by_cmd.send_distance_y(-15, 45) # 50
# 6_9 參數
by_cmd.send_distance_y(-15, 35)
time.sleep(2)
# 7_12_3 參數
# by_cmd.send_distance_y(-15, 45)
# time.sleep(2)
car_stop()
calibrate_new(tlabel.RBALL,offset = 44, run = True)
time.sleep(1)
logger.info("抓红球")
@@ -826,7 +844,8 @@ class put_hanoi1():
# time.sleep(0.5)
# by_cmd.send_distance_x(10, 200)
by_cmd.send_distance_x(10, 180)
# by_cmd.send_distance_x(10, 180)
by_cmd.send_distance_x(10, 250)
time.sleep(1)
car_stop()
@@ -1358,9 +1377,10 @@ class kick_ass():
car_stop()
time.sleep(1)
calibrate_new(tlabel.SIGN, offset = 8, run = True)
by_cmd.send_angle_claw(15)
time.sleep(0.5)
by_cmd.send_position_axis_z(30, 60)
by_cmd.send_position_axis_x(1, 120)
by_cmd.send_position_axis_x(1, 130)
if self.target_person == 1:
target_distance = self.pos_gap1
@@ -1371,15 +1391,15 @@ class kick_ass():
time.sleep(1.5 + (self.target_person - 1) * 0.7 )
car_stop()
by_cmd.send_angle_claw_arm(220)
by_cmd.send_angle_claw(15)
# by_cmd.send_angle_claw_arm(220)
# time.sleep(0.5)
by_cmd.send_position_axis_x(1, 20)
time.sleep(3)
by_cmd.send_position_axis_x(1, 120)
time.sleep(1)
logger.debug("結束任務,前進四")
by_cmd.send_speed_x(25)
time.sleep(4)
# by_cmd.send_speed_x(25)
# time.sleep(4)
pass
def nexec(self):
pass

1407
subtask_69.py Normal file

File diff suppressed because it is too large Load Diff

1412
subtask_7123.py Normal file

File diff suppressed because it is too large Load Diff

1406
subtask_7126.py Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ lane_error = 0
task_speed = 0
# pid 参数
pid_argv = {"kp" : 2, "ki" : 0, "kd" : 0} # 1.2
pid_argv = {"kp" : 1.2, "ki" : 0, "kd" : 0} # 1.2
# 转向 pid 对象
pid_turning = PidWrap(pid_argv["kp"], pid_argv["ki"], pid_argv["kd"], output_limits=50)