| | |
| | | if (!lastCode.getData().equals(code.getData())) { |
| | | |
| | | // 走行路径节点 |
| | | // 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++) { |
| | |
| | | |
| | | // 巷道强制转弯,优先级 > workDirection |
| | | if (null != nextLaneDir) { |
| | | nextDirection = nextLaneDir; |
| | | final double oppNextLaneDir = (nextLaneDir + 180) % 360; |
| | | |
| | | if (!lastDirection.equals(nextDirection)) { |
| | | if (!lastDirection.equals(nextLaneDir)) { |
| | | if (!lastCode.getCornerBool()) { |
| | | throw new CoolException(agvNo + "号小车进入巷道需调整方向为 " + nextDirection + "°,请推至转弯点手动调整"); |
| | | throw new CoolException(agvNo + "号小车进入巷道需调整方向为 " + nextLaneDir + "°,请推至转弯点手动调整"); |
| | | } |
| | | // turn |
| | | actionList.add(new Action( |
| | |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | (double) mapService.spinDirection(lastCode).val, // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(nextDirection), // 动作参数 |
| | | String.valueOf(nextLaneDir), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | lastDirection = nextDirection; |
| | | lastDirection = nextLaneDir; |
| | | |
| | | if (nextDirection.equals(oppNextLaneDir)) { |
| | | reverse = true; |
| | | } |
| | | } else { |
| | | if (nextDirection.equals(oppNextLaneDir)) { |
| | | nextDirection = nextLaneDir; |
| | | reverse = true; |
| | | } |
| | | } |
| | | |
| | | nextDirection = nextLaneDir; |
| | | } else if (null != lastLaneDir) { |
| | | final double oppLastLaneDir = (lastLaneDir + 180) % 360; |
| | | if (nextDirection.equals(oppLastLaneDir)) { |
| | | reverse = true; |
| | | } |
| | | nextDirection = lastLaneDir; |
| | | |
| | | if (!lastDirection.equals(nextDirection)) { |