fix: Prevent returning to previous node when direction is maintained

방향 유지 시 이전 노드로 되돌아가는 문제 수정

- 방향 유지(prevDirection == direction): 이전 노드 제외
- 방향 전환(prevDirection != direction): 모든 연결 노드 허용 (U-turn 가능)

수정 파일: DirectionalHelper.cs:61-73

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
backuppc
2025-10-28 17:32:59 +09:00
parent 859a84cd22
commit e8b9fceb88

View File

@@ -58,9 +58,19 @@ namespace AGVNavigationCore.Utils
if (connectedNodeIds == null || connectedNodeIds.Count == 0)
return null;
var candidateNodes = allNodes.Where(n =>
List<MapNode> candidateNodes = new List<MapNode>();
if (prevDirection == direction)
{
candidateNodes = allNodes.Where(n => n.NodeId != prevNode.NodeId &&
connectedNodeIds.Contains(n.NodeId)
).ToList();
}
else
{
candidateNodes = allNodes.Where(n =>
connectedNodeIds.Contains(n.NodeId)
).ToList();
}
if (candidateNodes.Count == 0)
return null;