This commit is contained in:
backuppc
2026-02-26 14:36:33 +09:00
parent d57b00095c
commit c1670ddcbe

View File

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