diff --git a/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs b/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs index 27fdc2a..c8e7ffc 100644 --- a/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs +++ b/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs @@ -56,7 +56,7 @@ namespace AGVNavigationCore.Models private AgvDirection _prevDirection; private AGVState _currentState; private float _currentSpeed; - + private MapNode _targetnode = null; // 경로 관련 private AGVPathResult _currentPath; private List _remainingNodes; @@ -311,7 +311,6 @@ namespace AGVNavigationCore.Models /// 다음에 수행할 모터/마그넷/속도 명령 public AGVCommand Predict() { - // 1. 위치 미확정 상태 (RFID 2개 미만 감지) if (!_isPositionConfirmed) { @@ -365,10 +364,10 @@ namespace AGVNavigationCore.Models { //움직이지 않는다면 움직이게하고, 움직인다면 마크스탑하낟.i - + //도킹노드라면 markstop 을 나머지는 바로 스탑한다. eAGVCommandReason reason = eAGVCommandReason.MarkStop; - if (_targetnode.StationType == StationType.Normal || _targetnode.StationType == StationType.Limit) + if (TargetNode.StationType == StationType.Normal || TargetNode.StationType == StationType.Limit) { //일반노드는 마크스탑포인트가 없으니 바로 종료되도록 한다 reason = eAGVCommandReason.Complete; @@ -388,8 +387,8 @@ namespace AGVNavigationCore.Models } // 4. 경로이탈 - var TargetNode = _currentPath.DetailedPath.Where(t => t.IsPass == false && t.NodeId.Equals(_currentNode.Id)).FirstOrDefault(); - if (TargetNode == null) + var checkPathOutNode = _currentPath.DetailedPath.Where(t => t.IsPass == false && t.NodeId.Equals(_currentNode.Id)).FirstOrDefault(); + if (checkPathOutNode == null) { return new AGVCommand( MotorCommand.Stop, @@ -835,9 +834,7 @@ namespace AGVNavigationCore.Models } public MapNode StartNode { get; set; } = null; - - private MapNode _targetnode = null; - + /// /// 목적지를 설정합니다. 목적지가 변경되면 경로계산정보가 삭제 됩니다. /// @@ -857,6 +854,10 @@ namespace AGVNavigationCore.Models } } + + + + private void ProcessNextNode() { if (_remainingNodes == null || _currentNodeIndex >= _remainingNodes.Count - 1)