| | |
| | | } |
| | | |
| | | public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, List<NavigationMapType> mapTypes, List<int[]> whites, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread, String moveType) { |
| | | long getStartTime = System.currentTimeMillis(); |
| | | |
| | | ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); |
| | | if (shuttleProtocol == null) { |
| | | return null; |
| | |
| | | //获取分段路径 |
| | | List<List<NavigateNode>> data = navigateUtils.getSectionPath(nodeList); |
| | | long endTime = System.currentTimeMillis(); |
| | | News.info("getSection path time:{}", (endTime - startTime)); |
| | | News.info("[RCS Debug] getSection path time:{}", (endTime - startTime)); |
| | | //将每一段路径分成command指令 |
| | | for (int i = 0; i < data.size(); i++) { |
| | | List<NavigateNode> nodes = data.get(i); |
| | |
| | | } |
| | | } |
| | | assignCommand.setShuttleMoveCommandsContinuously(shuttleMoveCommandsContinuously); |
| | | |
| | | News.info("{}任务,{}小车,{} - {} 路径命令包计算成功,耗时:{}ms", assignCommand.getTaskNo(), shuttleProtocol.getShuttleNo(), startLocNo, endLocNo, System.currentTimeMillis() - startTime); |
| | | return commands; |
| | | } |
| | | |
| | |
| | | return commands; |
| | | } |
| | | |
| | | //检测障碍物车 |
| | | public synchronized boolean checkObstacle(String locNo, List<Integer> whiteShuttles, List<NavigateNode> whiteNodes) { |
| | | /** |
| | | * 检测障碍物车 |
| | | * @return 0:无障碍 1:有障碍调度成功 2:有障碍调度失败 |
| | | */ |
| | | public synchronized int checkObstacle(String locNo, List<Integer> whiteShuttles, List<NavigateNode> whiteNodes) { |
| | | int innerCircle = 0; |
| | | int outerCircle = 3; |
| | | Config avoidInnerCircleConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "avoidInnerCircle")); |
| | |
| | | List<NavigateNode> innerNodes = getInnerNodes(locNo, innerCircle, whiteShuttlePointList); |
| | | List<Integer> nodesCar = findNodesCar(innerNodes); |
| | | if (nodesCar.isEmpty()) { |
| | | return false;//内圈中无车 |
| | | return 0;//内圈中无车 |
| | | } |
| | | |
| | | //获取外圈节点 |
| | |
| | | if (targetLocNo == null) { |
| | | continue; |
| | | } |
| | | shuttleDispatchUtils.dispatchShuttle(null, targetLocNo, shuttleNo); |
| | | boolean dispatched = shuttleDispatchUtils.dispatchShuttle(null, targetLocNo, shuttleNo); |
| | | return dispatched ? 1 : 2; |
| | | } |
| | | |
| | | return true;//内圈中有车 |
| | | return 2;//内圈中有车 |
| | | } |
| | | |
| | | private HashMap<String, Integer> findCarMap() { |