From d3d3857cda8b4307d8f03bf15ec9fb2c98c34b64 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 17 十二月 2024 09:58:39 +0800
Subject: [PATCH] #

---
 zy-acs-manager/src/main/resources/agv.py |   37 ++++++++++++++-----------------------
 1 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/zy-acs-manager/src/main/resources/agv.py b/zy-acs-manager/src/main/resources/agv.py
index 1b2669a..a366634 100644
--- a/zy-acs-manager/src/main/resources/agv.py
+++ b/zy-acs-manager/src/main/resources/agv.py
@@ -8,12 +8,6 @@
 
 radiusLen = None
 
-#with open("./codeMatrix.txt", "r") as file:
-#    codeMatrix = np.array(json.loads(file.read()))
-
-#with open("./cdaMatrix.txt", "r") as file:
-#    data = json.loads(file.read())
-#    cdaMatrix = np.array(data)
 
 # 灏嗗瓧绗︿覆杞崲涓烘诞鐐瑰瀷鏁扮粍
 def convert_to_float_array(str_array):
@@ -121,31 +115,28 @@
 radiusLenStr = sys.argv[1]
 radiusLen = float(radiusLenStr)
 
-codeMatrixPath = sys.argv[2]
-cdaMatrixPath = sys.argv[3]
-
-redisHost = sys.argv[4]
-redisPwd = sys.argv[5]
-redisPort = sys.argv[6]
-redisIdx = sys.argv[7]
-
-with open(codeMatrixPath, "r") as file:
-    codeMatrix = np.array(json.loads(file.read()))
-
-with open(cdaMatrixPath, "r") as file:
-    data = json.loads(file.read())
-    cdaMatrix = np.array(data)
+redisHost = sys.argv[2]
+redisPwd = sys.argv[3]
+redisPort = sys.argv[4]
+redisIdx = sys.argv[5]
 
 startTime = time.perf_counter()
-
-waveMatrix = initWaveMatrix()
 
 # 鍒涘缓涓�涓繛鎺ユ睜
 pool = redis.ConnectionPool(host=redisHost, port=int(redisPort), password=redisPwd, db=int(redisIdx))
 r = redis.Redis(connection_pool=pool)
-dynamicMatrixStr = r.get('KV.AGV_MAP_ASTAR_DYNAMIC_FLAG.1')
 
+codeMatrixStr = r.get('KV.AGV_MAP_ASTAR_CODE_FLAG.1')
+codeMatrix = np.array(json.loads(codeMatrixStr))
+
+cdaMatrixStr = r.get('KV.AGV_MAP_ASTAR_CDA_FLAG.1')
+cdaMatrix = np.array(json.loads(cdaMatrixStr))
+
+dynamicMatrixStr = r.get('KV.AGV_MAP_ASTAR_DYNAMIC_FLAG.1')
 dynamicMatrix = np.array(json.loads(dynamicMatrixStr))
+
+waveMatrix = initWaveMatrix()
+
 # # 浣跨敤 numpy 鍔犻�熺殑浠g爜
 process_dynamic_matrix(dynamicMatrix, codeMatrix)
 

--
Gitblit v1.9.1