From 91c9896ad01fbfb09591a677c43a4e1315156c00 Mon Sep 17 00:00:00 2001 From: havoc420ubuntu <2993167370@qq.com> Date: Fri, 16 May 2025 07:59:36 +0000 Subject: [PATCH] refactor(base_move): remove QR code scanning in move_base_hori_line - Remove QR code scanning functionality from arc_turn_around_hori_line function - Comment out QR code related code in task_1.py - Adjust base_w value for rotation speed --- base_move/move_base_hori_line.py | 15 ++++----------- task_1/task_1.py | 9 +++++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/base_move/move_base_hori_line.py b/base_move/move_base_hori_line.py index 8537e92..baf250f 100644 --- a/base_move/move_base_hori_line.py +++ b/base_move/move_base_hori_line.py @@ -373,13 +373,6 @@ def arc_turn_around_hori_line(ctrl, msg, angle_deg=90, left=True, target_distanc else: print("跳过对准步骤") - # 校准后检查是否已经扫描到QR码 - if scan_qrcode: - qr_data, scan_time = ctrl.image_processor.get_last_qr_result() - if qr_data: - qr_result = qr_data - print(f"🔍 校准过程中已扫描到QR码: {qr_data}") - # 2. 检测横线并计算距离 image = ctrl.image_processor.get_current_image() edge_point, edge_info = detect_horizontal_track_edge(image, observe=observe) @@ -432,10 +425,10 @@ def arc_turn_around_hori_line(ctrl, msg, angle_deg=90, left=True, target_distanc # 设定角速度(rad/s),可根据实际调整 # 减小基础角速度,增加精度 - if angle_deg >= 170: - base_w = 0.5 # 大角度旋转时使用更小的基础角速度,提高精度 - else: - base_w = 0.8 # 原来是0.6 + # if angle_deg >= 170: + # base_w = 0.5 # 大角度旋转时使用更小的基础角速度,提高精度 + # else: + base_w = 0.8 # 原来是0.6 w = base_w if left else -base_w # 左转为正,右转为负 diff --git a/task_1/task_1.py b/task_1/task_1.py index 1c4069e..c65b8e7 100644 --- a/task_1/task_1.py +++ b/task_1/task_1.py @@ -14,9 +14,9 @@ observe = True def run_task_1(ctrl, msg): print('🐶 Running task 1...') - # # v2 - # print('😺 task 1 - 1') - # # 在 arc_turn_around_hori_line 中启用 QR 码扫描 + # v2 + print('😺 task 1 - 1') + # 在 arc_turn_around_hori_line 中启用 QR 码扫描 # turn_success, qr_result = arc_turn_around_hori_line( # ctrl=ctrl, # msg=msg, @@ -26,6 +26,7 @@ def run_task_1(ctrl, msg): # scan_qrcode=True, # 启用 QR 码扫描 # qr_check_interval=0.3 # 每 0.3 秒检查一次扫描结果 # ) + # return # if qr_result: # print(f"🎯 在任务 1-1 中成功扫描到 QR 码: {qr_result}") @@ -45,7 +46,7 @@ def run_task_1(ctrl, msg): angle_deg=180, target_distance=0.5, left=direction, - pass_align=True, + # pass_align=True, observe=observe, )