| | |
| | | List<Action> actionList = new ArrayList<>(); |
| | | // start node |
| | | Code lastCode = codeService.getCacheById(agvDetail.getRecentCode()); |
| | | Double lastDirection = agvDetail.getAgvAngle(); |
| | | Double lastDirection = MapService.mapToNearest(agvDetail.getAgvAngle()); |
| | | if (!lastCode.getData().equals(pathList.get(0))) { |
| | | throw new CoolException("AGV[" + agvNo + "]定位偏移..."); |
| | | } |
| | |
| | | Code nextCode = codeService.getCacheByData(next); |
| | | Double nextDirection = mapService.calculateDirection(lastCode, nextCode, angleOffsetVal); |
| | | |
| | | // 第一步:如果下一个方向正好是作业方向的相反方向,则重置下一个方向为作业方向,标记reverse |
| | | // 第一步:如果下一个方向正好是作业方向的相反方向,则重置下一个方向为作业方向,标记 reverse = true |
| | | boolean reverse = false; |
| | | if (nextDirection.equals((workDirection + 180) % 360)) { |
| | | nextDirection = workDirection; |