fix: up
This commit is contained in:
parent
3eaf411bde
commit
8e837473ca
@ -49,8 +49,8 @@ def run_task_1(ctrl, msg, time_sleep=5000):
|
|||||||
qr_check_interval=0.3 # 每 0.3 秒检查一次扫描结果
|
qr_check_interval=0.3 # 每 0.3 秒检查一次扫描结果
|
||||||
)
|
)
|
||||||
|
|
||||||
if res and res['qr_result']:
|
if res and res.get('qr_result'):
|
||||||
success(f"在任务1-1中成功扫描到QR码: {res['qr_result']}", "扫描")
|
success(f"在任务1-1中成功扫描到QR码: {res.get('qr_result')}", "扫描")
|
||||||
else:
|
else:
|
||||||
warning("任务1-1中未能扫描到任何QR码", "警告")
|
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)
|
move_to_hori_line(ctrl, msg, target_distance=1.1, observe=observe)
|
||||||
|
|
||||||
section('任务1-3:转弯', "旋转")
|
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(
|
turn_success, res = arc_turn_around_hori_line(
|
||||||
ctrl=ctrl,
|
ctrl=ctrl,
|
||||||
msg=msg,
|
msg=msg,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user