diff --git a/app.py b/app.py index f32521f..249671a 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ server_command = [ {"path": "/home/evan/Workplace/project_capture/build/", "script": "./capture"}, {"path": "/home/evan/Workplace/project_infer/lane_server/", "script": "lane_infer_server.py"}, {"path": "/home/evan/Workplace/project_infer/yolo_server/", "script": "yolo_infer_server.py"}, - {"path": "/home/evan/Workplace/project_infer/ocr_server/", "script": "ocr_infer_server.py"}, + # {"path": "/home/evan/Workplace/project_infer/ocr_server/", "script": "ocr_infer_server.py"}, ] processes = [] @@ -167,4 +167,7 @@ if __name__ == '__main__': if server_process != None: server_process.terminate() if task_process != None: - task_process.terminate() \ No newline at end of file + task_process.terminate() + for process in processes: + logger.error(process.pid) + os.kill(process.pid, signal.SIGINT) \ No newline at end of file diff --git a/cfg_args.toml b/cfg_args.toml index 5b963e1..75d2e0a 100644 --- a/cfg_args.toml +++ b/cfg_args.toml @@ -1,5 +1,5 @@ [kick_ass] -target_person = 3 +target_person = 4 [task] Subtask_enable = true diff --git a/cfg_subtask.toml b/cfg_subtask.toml index e04a701..6ad28f2 100644 --- a/cfg_subtask.toml +++ b/cfg_subtask.toml @@ -15,7 +15,7 @@ pid_ki = 0 pid_kd = 0 [up_tower] -pid_kp = 1.2 +pid_kp = 1.3 pid_ki = 0 pid_kd = 0 @@ -25,7 +25,7 @@ pid_ki = 0 pid_kd = 0 [put_bball] -pid_kp = 1.2 +pid_kp = 1.3 pid_ki = 0 pid_kd = 0 @@ -35,7 +35,7 @@ pid_ki = 0 pid_kd = 0 [put_hanoi2] -pid_kp = 1.0 +pid_kp = 1 pid_ki = 0 pid_kd = 0 pos_gap = 160 diff --git a/cfg_subtask.toml.bak.7102 b/cfg_subtask.toml.bak.7102 new file mode 100644 index 0000000..63978ac --- /dev/null +++ b/cfg_subtask.toml.bak.7102 @@ -0,0 +1,61 @@ +[get_block] +pid_kp = 2.0 +pid_ki = 0 +pid_kd = 0 +first_block = "blue" + +[put_block] +pid_kp = 2.0 +pid_ki = 0 +pid_kd = 0.1 + +[get_bball] +pid_kp = 2.0 +pid_ki = 0 +pid_kd = 0 + +[up_tower] +pid_kp = 2.8 +pid_ki = 0 +pid_kd = 0 + +[get_rball] +pid_kp = 2.0 +pid_ki = 0 +pid_kd = 0 + +[put_bball] +pid_kp = 2.4 +pid_ki = 0 +pid_kd = 0 + +[put_hanoi1] +pid_kp = +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 = 2.5 +pid_ki = 0 +pid_kd = 0 + +[move_area] +pid_kp = 2.0 +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 diff --git a/subtask.py b/subtask.py index d9bc461..777561e 100644 --- a/subtask.py +++ b/subtask.py @@ -203,7 +203,7 @@ def explore_calibrate_new(label, offset, run_direc ,run_speed = 3.5): by_cmd.send_speed_x(-run_speed) if label == tlabel.TPLATFORM: - stop_error = 10 + stop_error = 8 else: stop_error = 15 while True: @@ -371,7 +371,7 @@ class task_queuem(task): # 人员施救 class get_block1(): def init(self): - var.task_speed = 0 + var.task_speed = 15 act.cmd.camera(0) act.cmd.z2(20, 60, 0) filter.switch_camera(1) @@ -484,6 +484,7 @@ class get_block2(): # TODO 完成不执行任务的空动作 pass def after(self): + var.task_speed = 0 var.pid_turning.set(cfg["get_block"]["pid_kp"], cfg["get_block"]["pid_ki"], cfg["get_block"]["pid_kd"]) # 任务检查间隔 time.sleep(7) @@ -601,7 +602,7 @@ class get_bball(): by_cmd.send_angle_claw_arm(36) by_cmd.send_angle_claw(54) by_cmd.send_position_axis_x(1, 160) - time.sleep(1.5) + time.sleep(1.2) by_cmd.send_angle_claw(25) time.sleep(1) by_cmd.send_distance_axis_z(30, 20) @@ -613,7 +614,7 @@ class get_bball(): by_cmd.send_angle_claw_arm(80) time.sleep(0.5) by_cmd.send_angle_claw(54) - time.sleep(1) + time.sleep(0.5) by_cmd.send_angle_claw_arm(36) time.sleep(1) by_cmd.send_position_axis_z(30, 135) @@ -660,8 +661,8 @@ class up_tower(): time.sleep(3) by_cmd.send_angle_zhuan(10) time.sleep(12) - by_cmd.send_distance_y(10, 60) - time.sleep(1) + by_cmd.send_speed_y(10) + time.sleep(0.3) car_stop() by_cmd.send_angle_zhuan(0) # while True: @@ -712,8 +713,8 @@ class get_rball(): time.sleep(2.5) by_cmd.send_angle_scoop(7) time.sleep(0.5) - by_cmd.send_distance_y(15, 70) - time.sleep(1) + by_cmd.send_speed_y(15) + time.sleep(0.2) car_stop() # by_cmd.send_angle_omega(-55,30) # while True: @@ -745,8 +746,8 @@ class put_bball(): def exec(self): logger.info("找到篮筐") car_stop() - calibrate_new(tlabel.BASKET,offset = -21, run = True, run_speed = 6) - by_cmd.send_distance_x(10, 20) + 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_angle_storage(10) @@ -917,9 +918,7 @@ class put_hanoi2(): by_cmd.send_position_axis_z(30, 10) by_cmd.send_position_axis_x(1, 130) by_cmd.send_angle_claw(63) - time.sleep(1) - by_cmd.send_angle_claw(78) - time.sleep(1) + time.sleep(2) by_cmd.send_angle_claw(40) time.sleep(0.5) by_cmd.send_distance_axis_z(30, 20) @@ -931,9 +930,7 @@ class put_hanoi2(): by_cmd.send_position_axis_z(30, 10) by_cmd.send_position_axis_x(1, 40) by_cmd.send_angle_claw(63) - time.sleep(1) - by_cmd.send_angle_claw(78) - time.sleep(1) + time.sleep(2) by_cmd.send_angle_claw(40) time.sleep(0.5) by_cmd.send_distance_axis_z(30, 20) @@ -981,9 +978,7 @@ class put_hanoi2(): by_cmd.send_position_axis_z(30, 10) by_cmd.send_position_axis_x(1, 130) by_cmd.send_angle_claw(63) - time.sleep(1) - by_cmd.send_angle_claw(70) - time.sleep(1) + time.sleep(2) by_cmd.send_angle_claw(35) time.sleep(0.5) by_cmd.send_distance_axis_z(30, 20) @@ -995,9 +990,7 @@ class put_hanoi2(): by_cmd.send_position_axis_z(30, 10) by_cmd.send_position_axis_x(1, 40) by_cmd.send_angle_claw(63) - time.sleep(1) - by_cmd.send_angle_claw(70) - time.sleep(1) + time.sleep(2) by_cmd.send_angle_claw(35) time.sleep(0.5) by_cmd.send_distance_axis_z(30, 20) @@ -1045,9 +1038,7 @@ class put_hanoi2(): by_cmd.send_position_axis_z(30, 10) by_cmd.send_position_axis_x(1, 130) by_cmd.send_angle_claw(50) - time.sleep(1) - by_cmd.send_angle_claw(58) - time.sleep(1) + time.sleep(2) by_cmd.send_angle_claw(27) time.sleep(1) by_cmd.send_distance_axis_z(30, 10) @@ -1059,9 +1050,7 @@ class put_hanoi2(): by_cmd.send_position_axis_z(30, 10) by_cmd.send_position_axis_x(1, 40) by_cmd.send_angle_claw(50) - time.sleep(1) - by_cmd.send_angle_claw(58) - time.sleep(1) + time.sleep(2) by_cmd.send_angle_claw(27) time.sleep(1) by_cmd.send_distance_axis_z(30, 10) @@ -1085,7 +1074,10 @@ class put_hanoi2(): by_cmd.send_angle_claw(80) time.sleep(0.5) by_cmd.send_position_axis_x(1, 10) - time.sleep(1.5) + time.sleep(1) + by_cmd.send_speed_y(15) + time.sleep(0.1) + car_stop() pass else: by_cmd.send_position_axis_z(30, 170) @@ -1385,6 +1377,9 @@ class kick_ass(): 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) pass def nexec(self): pass diff --git a/variable.py b/variable.py index 7a802f0..154ee8a 100644 --- a/variable.py +++ b/variable.py @@ -6,7 +6,7 @@ lane_error = 0 task_speed = 0 # pid 参数 -pid_argv = {"kp" : 1.2, "ki" : 0, "kd" : 0} +pid_argv = {"kp" : 2, "ki" : 0, "kd" : 0} # 1.2 # 转向 pid 对象 pid_turning = PidWrap(pid_argv["kp"], pid_argv["ki"], pid_argv["kd"], output_limits=50)