diff --git a/task_1/task_1.py b/task_1/task_1.py index f0c5221..48f540e 100644 --- a/task_1/task_1.py +++ b/task_1/task_1.py @@ -17,7 +17,7 @@ from utils.log_helper import LogHelper, get_logger, section, info, debug, warnin # 创建本模块特定的日志记录器 logger = get_logger("任务1") -observe = False +observe = True def run_task_1(ctrl, msg): section('任务1:寻找横线并绕行', "启动") @@ -26,7 +26,7 @@ def run_task_1(ctrl, msg): # v2 section('任务1-1:转弯并扫描QR码', "移动") # 在 arc_turn_around_hori_line 中启用 QR 码扫描 - success, res = arc_turn_around_hori_line( + turn_success, res = arc_turn_around_hori_line( ctrl=ctrl, msg=msg, angle_deg=85, @@ -47,17 +47,20 @@ def run_task_1(ctrl, msg): section('任务1-3:转弯', "旋转") direction = True if res['qr_result'] == 'A-1' else False - success, res = arc_turn_around_hori_line( + turn_success, res = arc_turn_around_hori_line( ctrl=ctrl, msg=msg, angle_deg=170, target_distance=0.4, # TODO 优化这里的参数 left=direction, + # pass_align=True, observe=observe, # TODO clear bad_big_angle_corret=True ) + + return section('任务1-4:直线移动', "移动") move_distance = 0.4 @@ -86,7 +89,7 @@ def run_task_1(ctrl, msg): turn_degree(ctrl, msg, degree=-90, absolute=True) section('任务1-7:90度转弯', "旋转") - success, res = arc_turn_around_hori_line( + turn_success, res = arc_turn_around_hori_line( ctrl=ctrl, msg=msg, angle_deg=-85,