Champagne 4 months ago
parent 30b8d04a7a
commit 4504f2ef84

@ -177,11 +177,15 @@ def vs_measurement(txt_name,position):
if not os.path.exists(txt_name): if not os.path.exists(txt_name):
return None,None,None,None return None,None,None,None
# 获取数据 # 获取数据
x_bot, y_bot, x_top, y_top = get_data.get_data(txt_name) try:
x_bot = np.array(x_bot) x_bot, y_bot, x_top, y_top = get_data.get_data(txt_name)
y_bot = np.array(y_bot) x_bot = np.array(x_bot)
x_top = np.array(x_top) y_bot = np.array(y_bot)
y_top = np.array(y_top) x_top = np.array(x_top)
y_top = np.array(y_top)
except Exception as e:
print(f"处理过程中发生错误: {e}")
return 1,1,1,1
# 拟合路沿上下直线方程 # 拟合路沿上下直线方程
slope_bot, intercept_bot, r2_bot = calc_slope_line.linear_regression(x_bot, y_bot) slope_bot, intercept_bot, r2_bot = calc_slope_line.linear_regression(x_bot, y_bot)

Loading…
Cancel
Save