This commit is contained in:
backuppc
2026-01-15 17:34:17 +09:00
parent 64ff2ecfb9
commit ddf111c69f
6 changed files with 232 additions and 81 deletions

View File

@@ -157,31 +157,20 @@ namespace AGVNavigationCore.PathFinding.Planning
//갈림길에 있다면 미리 방향을 저장해준다.
if ((node.ConnectedNodes?.Count ?? 0) > 2 && nextNode != null)
{
switch (node.RfidId)
//다음 노드ID를 확인해서 마그넷 방향 데이터를 찾는다.
if (node.MagnetDirections.ContainsKey(nextNode.Id) == false)
{
case 6:
if (nextNode.RfidId == 7)
magnetDirection = MagnetDirection.Left;
else if (nextNode.RfidId == 13)
magnetDirection = MagnetDirection.Right;
else
return AGVPathResult.CreateFailure($"{node.ID2}->{nextNode.ID2} 의 (목표)갈림길 방향이 입력되지 않았습니다", 0, 0);
break;
case 7:
if (nextNode.RfidId == 6)
magnetDirection = MagnetDirection.Right;
else
return AGVPathResult.CreateFailure( $"{node.ID2}->{nextNode.ID2} 의 (목표)갈림길 방향이 입력되지 않았습니다", 0, 0);
break;
case 13:
if (nextNode.RfidId == 6)
magnetDirection = MagnetDirection.Left;
else
return AGVPathResult.CreateFailure( $"{node.ID2}->{nextNode.ID2} 의 (목표)갈림길 방향이 입력되지 않았습니다", 0, 0);
break;
default:
return AGVPathResult.CreateFailure( $"{node.ID2}->{nextNode.ID2} 의 (시작)갈림길 방향이 입력되지 않았습니다", 0, 0);
return AGVPathResult.CreateFailure($"{node.ID2}->{nextNode.ID2} 의 (목표)갈림길 방향이 입력되지 않았습니다", 0, 0);
}
else
{
var magdir = node.MagnetDirections[nextNode.Id].ToString();
if (magdir == "L") magnetDirection = MagnetDirection.Left;
else if (magdir == "R") magnetDirection = MagnetDirection.Right;
}
}
var nodeInfo = new NodeMotorInfo(i + 1, node.Id, node.RfidId, prevDirection, nextNode, magnetDirection);