..
This commit is contained in:
@@ -101,8 +101,7 @@ namespace Project
|
||||
}
|
||||
|
||||
//경로 생성(경로정보가 없거나 현재노드가 경로에 없는경우)
|
||||
if (PUB._virtualAGV.CurrentPath == null ||
|
||||
PUB._virtualAGV.CurrentPath.DetailedPath.Any() == false ||
|
||||
if (PUB._virtualAGV.HasPath() == false ||
|
||||
PUB._virtualAGV.CurrentPath.DetailedPath.Where(t => t.NodeId.Equals(currentNode.Id)).Any() == false)
|
||||
{
|
||||
if (PUB.AGV.system1.agv_run)
|
||||
@@ -112,6 +111,15 @@ namespace Project
|
||||
}
|
||||
|
||||
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.log.AddE($"경로가 계산되지 않았습니다");
|
||||
@@ -120,9 +128,10 @@ namespace Project
|
||||
}
|
||||
else
|
||||
{
|
||||
//계산은 되었으나 현재위치가 전체 경로 없다면 시작노드를 현재로 변경해야한다.
|
||||
PUB._mapCanvas.CurrentPath = PathResult.result;
|
||||
PUB._virtualAGV.SetPath(PathResult.result);
|
||||
|
||||
PUB._mapCanvas.CurrentPath = PathResult.result;
|
||||
PUB._virtualAGV.SetPath(PathResult.result);
|
||||
|
||||
}
|
||||
|
||||
PUB.log.AddI($"경로생성 {PUB._virtualAGV.StartNode.RfidId} -> {PUB._virtualAGV.TargetNode.RfidId}");
|
||||
@@ -136,12 +145,12 @@ namespace Project
|
||||
PUB.AGV.AGVMoveStop("Path Integrity Fail");
|
||||
}
|
||||
PUB.log.AddE($"경로 무결성 오류로 인해 경로를 삭제 합니다");
|
||||
Console.WriteLine($"경로 무결성 오류로 인해 경로를 삭제 합니다");
|
||||
PUB._virtualAGV.SetPath(null);
|
||||
VAR.I32[eVarInt32.PathValidationError] += 1;
|
||||
if (VAR.I32[eVarInt32.PathValidationError] > 50)
|
||||
{
|
||||
PUB.log.AddE($"연속 경로 무결성 오류로 인해 중지 합니다");
|
||||
PUB._mapCanvas.SetAlertMessage($"연속 경로 무결성 오류로 인해 중지 합니다");
|
||||
PUB.sm.SetNewRunStep(ERunStep.ERROR);
|
||||
}
|
||||
return false;
|
||||
@@ -182,16 +191,6 @@ namespace Project
|
||||
return false;
|
||||
}
|
||||
|
||||
var message = $"[다음 행동 예측]\n\n" +
|
||||
$"모터: {nextAction.Motor}\n" +
|
||||
$"마그넷: {nextAction.Magnet}\n" +
|
||||
$"속도: {nextAction.Speed}\n" +
|
||||
$"이유: {nextAction.Message}\n\n" +
|
||||
$"---\n" +
|
||||
$"현재 상태: {PUB._virtualAGV.CurrentState}\n" +
|
||||
$"현재 방향: {PUB._virtualAGV.CurrentDirection}\n" +
|
||||
$"위치 확정: {PUB._virtualAGV.IsPositionConfirmed} (RFID {PUB._virtualAGV.DetectedRfidCount}개)\n" +
|
||||
$"현재 노드: {PUB._virtualAGV.CurrentNodeID2}";
|
||||
|
||||
//모터에서 정지를 요청했다
|
||||
if (nextAction.Motor == AGVNavigationCore.Models.MotorCommand.Stop)
|
||||
|
||||
Reference in New Issue
Block a user