This commit is contained in:
havocrao 2025-08-20 12:36:03 +08:00
parent 3eaf411bde
commit 8e837473ca

View File

@ -49,8 +49,8 @@ def run_task_1(ctrl, msg, time_sleep=5000):
qr_check_interval=0.3 # 每 0.3 秒检查一次扫描结果
)
if res and res['qr_result']:
success(f"在任务1-1中成功扫描到QR码: {res['qr_result']}", "扫描")
if res and res.get('qr_result'):
success(f"在任务1-1中成功扫描到QR码: {res.get('qr_result')}", "扫描")
else:
warning("任务1-1中未能扫描到任何QR码", "警告")
@ -59,7 +59,7 @@ def run_task_1(ctrl, msg, time_sleep=5000):
move_to_hori_line(ctrl, msg, target_distance=1.1, observe=observe)
section('任务1-3转弯', "旋转")
direction = False if res['qr_result'] == 'A-1' else True # TODO 需要检查一下,这个方向是否正确
direction = False if res.get('qr_result') == 'A-1' else True # TODO 需要检查一下,这个方向是否正确
turn_success, res = arc_turn_around_hori_line(
ctrl=ctrl,
msg=msg,