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
This commit is contained in:
havoc420ubuntu 2025-05-16 07:59:36 +00:00
parent 95b426bf29
commit 91c9896ad0
2 changed files with 9 additions and 15 deletions

View File

@ -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 # 左转为正,右转为负

View File

@ -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,
)