| | |
| | | import com.zy.acs.manager.core.domain.DirectionDto; |
| | | import com.zy.acs.manager.core.domain.SortCodeDto; |
| | | import com.zy.acs.manager.core.domain.UnlockPathTask; |
| | | import com.zy.acs.manager.core.domain.type.CodeDirectionType; |
| | | import com.zy.acs.manager.core.service.astart.*; |
| | | import com.zy.acs.manager.core.service.astart.domain.AStarNavigateNode; |
| | | import com.zy.acs.manager.core.service.astart.domain.DynamicNode; |
| | |
| | | return angle; |
| | | } |
| | | |
| | | // 坐标货架阈值 todo:luxiaotao |
| | | // 坐标货架阈值 |
| | | public AgvDirectionType calculateAgvWorkDirectionByShelf(Loc loc, Code code) { |
| | | Integer compDirect = loc.getCompDirect(); |
| | | AgvDirectionType agvDirectionType = null; |
| | | if (compDirect == 0) { |
| | | agvDirectionType = AgvDirectionType.RIGHT; |
| | | } |
| | | if (compDirect == 1) { |
| | | agvDirectionType = AgvDirectionType.LEFT; |
| | | } |
| | | return agvDirectionType; |
| | | return AgvDirectionType.fromVal(compDirect); |
| | | } |
| | | |
| | | public Double getStaAngle(Sta sta, Double workDirection) { |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | CodeSpinType codeSpinType = calcSpinDirection(null, 260.0, 10.0); |
| | | List<DirectionDto> directionDtoList = DirectionDto.initCodeDirections(); |
| | | System.out.println(JSON.toJSONString(directionDtoList)); |
| | | System.out.println(codeSpinType.toString()); |
| | | } |
| | | |
| | | public CodeSpinType calcSpinDirection(Code code, Double currDir, Double nextDir) { |
| | | public static CodeSpinType calcSpinDirection(Code code, Double currDir, Double nextDir) { |
| | | if (Cools.isEmpty(code, currDir, nextDir)) { |
| | | return CodeSpinType.NA; |
| | | } |
| | | List<Double> disableAngleList = new ArrayList<>(); |
| | | List<DirectionDto> directionDtoList = DirectionDto.initCodeDirections(); |
| | | List<DirectionDto> directionDtoList; |
| | | if (!Cools.isEmpty(code.getDirRule())) { |
| | | directionDtoList = JSON.parseArray(code.getDirRule(), DirectionDto.class); |
| | | } else { |
| | | directionDtoList = DirectionDto.initCodeDirections(); |
| | | } |
| | | for (DirectionDto dto : directionDtoList) { |
| | | if (null != dto.getEnabled() && !dto.getEnabled()) { |
| | | disableAngleList.add(dto.getAngle()); |
| | |
| | | return CodeSpinType.NA; |
| | | } |
| | | |
| | | double cwDelta = cwDelta(curr, next); // (0, 360) |
| | | double ccwDelta = 360.0 - cwDelta; // (0, 360) |
| | | double cwDelta = cwDelta(curr, next); |
| | | double ccwDelta = 360.0 - cwDelta; |
| | | |
| | | boolean cwBlocked = false; |
| | | boolean ccwBlocked = false; |