This commit is contained in:
havoc420ubuntu 2025-05-19 06:26:45 +00:00
parent 8782fdc092
commit 405fb116ec

View File

@ -45,6 +45,8 @@ def align_to_horizontal_line(ctrl, msg, observe=False, max_attempts=3):
# 检测横向线边缘
edge_point, edge_info = detect_horizontal_track_edge(ctrl.image_processor.get_current_image(), observe=observe, delay=1000 if observe else 0, save_log=True)
print('😺', edge_info)
if edge_point is None or edge_info is None:
error("未检测到横向线,无法进行校准", "失败")
@ -112,7 +114,9 @@ def align_to_horizontal_line(ctrl, msg, observe=False, max_attempts=3):
info(f"当前累积旋转: {accumulated_angle:.2f}", "累积")
# 使用turn_degree函数执行旋转增加精度参数
info(f"旋转角度: {angle_to_rotate:.2f}", "旋转")
turn_success = turn_degree(ctrl, msg, angle_to_rotate, absolute=False, precision=True)
info(f"旋转结果: {turn_success}", "旋转结果")
# 等待稳定
time.sleep(0.3)