From 97e0bddd5a8b54ba0007af1f70d3e910a4dd81c0 Mon Sep 17 00:00:00 2001
From: yy <yy123>
Date: 星期二, 06 一月 2026 19:44:07 +0800
Subject: [PATCH] 测试修馥版
---
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
index c5a9b1c..b717ce4 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -765,7 +765,6 @@
boolean first = true;
for (Segment segment : segmentList) {
-
// 鍒嗘鎵�灞炵殑Task
Task task = taskService.getById(segment.getTaskId());
TaskPosDto.PosType posType = Objects.requireNonNull(TaskPosDto.queryPosType(segment.getPosType()));
@@ -785,21 +784,17 @@
// 璧拌璺緞鑺傜偣
// List<String> pathList = mapService.checkoutPath(agv.getUuid(), lastCode, code);
List<String> pathListPart = pathList.subList(pathList.indexOf(lastCode.getData()), pathList.indexOf(code.getData()) + 1);
-
for (int i = 0; i < pathListPart.size(); i++) {
if (i == 0) {
continue;
}
-
String next = pathListPart.get(i);
-
Code nextCode = codeService.getCacheByData(next);
Double nextDirection = mapService.calculateDirection(lastCode, nextCode, angleOffsetVal);
-
// 绗竴姝ワ細濡傛灉涓嬩竴涓柟鍚戞濂芥槸浣滀笟鏂瑰悜鐨勭浉鍙嶆柟鍚戯紝鍒欓噸缃笅涓�涓柟鍚戜负浣滀笟鏂瑰悜锛屾爣璁� reverse = true
boolean reverse = false;
if (nextDirection.equals((workDirection + 180) % 360)) {
- if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(lastCode.getData()))) {
+ if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(nextCode.getData()) && locTurnCodes.contains(lastCode.getData()))) {
reverse = false;
lastDirection = nextDirection;
} else {
@@ -826,7 +821,7 @@
nextDirection = lastDirection;
reverse = true;
} else {
- if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) {
+ if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
// turn
reverse = false;
actionList.add(new Action(
@@ -852,8 +847,9 @@
180);
} else {
Double turnDirection = nextDirection;
- if (turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) {
+ if (turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050") || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
turnDirection = 180.0;
+ reverse = false;
}
// turn
actionList.add(new Action(
@@ -881,8 +877,7 @@
lastDirection = nextDirection;
}
} else {
- // if (isStation && lastCode.getData().equals("00000050")) {
- if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) {
+ if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
// turn
reverse = false;
actionList.add(new Action(
@@ -901,7 +896,6 @@
now // 宸ヤ綔鏃堕棿
));
- reverse = false;
log.info("3TurnCorner posType={}, code={}, corner={}, nextDirection={}, finalAngle={}",
posType,
lastCode.getData(),
@@ -971,8 +965,16 @@
if (first) {
if (Cools.isEmpty(actionList) || !actionList.get(0).getActionType().equals(ActionTypeType.TurnCorner.val())) {
Double turnDirection = workDirection;
- // if (isStation && turnCodes.contains(lastCode.getData())) {
- if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(lastCode.getData()))) {
+ Code nextCode = null;
+ //娣诲姞鍒ゆ柇鏄惁瀛樺湪涓嬩竴涓湴鐮�
+ int index = pathList.indexOf(lastCode.getData());
+ if (index != -1 && index + 1 < pathList.size()) {
+ String nextCodeData = pathList.get(index + 1);
+ nextCode = codeService.getCacheByData(nextCodeData);
+ } else {
+ nextCode = codeService.getCacheByData(lastCode.getData());
+ }
+ if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
turnDirection = workDirection + 180.0;
}
if (lastCode.getCornerBool()) {
--
Gitblit v1.9.1