| | |
| | | package com.zy.acs.manager.core.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.acs.common.enums.AgvDirectionType; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.manager.common.utils.MapDataUtils; |
| | |
| | | |
| | | |
| | | // 角度计算 |
| | | public Double calculateDirection(Code startCode, Code endCode) { |
| | | public Double calculateDirection(Code startCode, Code endCode, int angleOffsetVal) { |
| | | Double x0 = startCode.getX(); |
| | | Double y0 = startCode.getY(); |
| | | |
| | |
| | | double deltaX = x1 - x0; |
| | | double deltaY = y1 - y0; |
| | | double angle = -Math.atan2(deltaX, deltaY); |
| | | int angleOffsetVal = configService.getVal("mapAngleOffsetVal", Integer.class); |
| | | angle = Math.toDegrees(angle) + angleOffsetVal; |
| | | angle = (angle + 360) % 360; // 将角度转换为正值 |
| | | |
| | |
| | | } |
| | | |
| | | // 坐标货架阈值 todo:luxiaotao |
| | | public AgvDirectionType calculateAgvWorkDirection(JSONObject storeDirection, Loc loc, Code code) { |
| | | storeDirection.getString("key"); |
| | | public AgvDirectionType calculateAgvWorkDirection(Loc loc, Code code) { |
| | | Integer compDirect = loc.getCompDirect(); |
| | | AgvDirectionType agvDirectionType = null; |
| | | if (compDirect == 0) { |