..
This commit is contained in:
@@ -110,30 +110,17 @@ namespace Project
|
||||
PUB.AGV.AGVMoveStop("경로재생성");
|
||||
}
|
||||
|
||||
var PathResult = CalcPath(PUB._virtualAGV.StartNode, PUB._virtualAGV.TargetNode);
|
||||
if(PathResult.result !=null &&
|
||||
PathResult.result.Success == true &&
|
||||
PathResult.result.DetailedPath.Where(t => t.NodeId == currentNode.Id).Any() == false)
|
||||
{
|
||||
PUB._virtualAGV.StartNode = PUB._virtualAGV.CurrentNode;
|
||||
PathResult = CalcPath(PUB._virtualAGV.StartNode, PUB._virtualAGV.TargetNode);
|
||||
}
|
||||
|
||||
|
||||
if (PathResult.result == null)
|
||||
PUB._virtualAGV.StartNode = PUB._virtualAGV.CurrentNode;
|
||||
var PathResult = CalcPath(currentNode, PUB._virtualAGV.TargetNode);
|
||||
if (PathResult.Success == false)
|
||||
{
|
||||
PUB.log.AddE($"경로가 계산되지 않았습니다");
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
PUB._mapCanvas.CurrentPath = PathResult.result;
|
||||
PUB._virtualAGV.SetPath(PathResult.result);
|
||||
|
||||
}
|
||||
|
||||
PUB._mapCanvas.CurrentPath = PathResult;
|
||||
PUB._virtualAGV.SetPath(PathResult);
|
||||
PUB.log.AddI($"경로생성 {PUB._virtualAGV.StartNode.RfidId} -> {PUB._virtualAGV.TargetNode.RfidId}");
|
||||
}
|
||||
|
||||
@@ -161,23 +148,22 @@ namespace Project
|
||||
if (PUB._virtualAGV.CurrentPath.DetailedPath.Count > 5)
|
||||
{
|
||||
var PathResult2 = CalcPath(PUB._virtualAGV.CurrentNode, PUB._virtualAGV.TargetNode);
|
||||
if (PathResult2.result != null && PathResult2.result.Success)
|
||||
if (PathResult2 != null && PathResult2.Success)
|
||||
{
|
||||
//절반이상 경로가 짧을때에는 재계산을 하게한다
|
||||
var halfcnt = (int)(PUB._virtualAGV.CurrentPath.DetailedPath.Count / 2.0);
|
||||
if (PathResult2.result.DetailedPath.Count < halfcnt)
|
||||
if (PathResult2.DetailedPath.Count < halfcnt)
|
||||
{
|
||||
var msg = $"단축경로가 확인되었습니다. 경로를 삭제 합니다";
|
||||
PUB.log.AddE(msg);
|
||||
Console.WriteLine(msg);
|
||||
PUB._virtualAGV.SetPath(null);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//predict 를 이용하여 다음 이동을 모두 확인한다.
|
||||
var nextAction = PUB._virtualAGV.Predict();
|
||||
if (nextAction.Reason == AGVNavigationCore.Models.eAGVCommandReason.PathOut)
|
||||
|
||||
Reference in New Issue
Block a user