턴동작 추가

This commit is contained in:
backuppc
2026-02-27 16:55:35 +09:00
parent 43e7458866
commit 46bed6eb25
4 changed files with 185 additions and 14 deletions

View File

@@ -21,6 +21,9 @@
/// <summary>명령 이유- (디버깅/로깅용)</summary>
public eAGVCommandReason Reason { get; set; }
/// <summary>방향 전환 명령 여부 (180도 Left Turn 등)</summary>
public bool IsTurn { get; set; }
/// <summary>
/// 생성자
/// </summary>

View File

@@ -720,24 +720,34 @@ namespace AGVNavigationCore.Models
// MotorDirection → MotorCommand 변환
MotorCommand motorCmd;
switch (nodeInfo.MotorDirection)
eAGVCommandReason reason = eAGVCommandReason.Normal;
if (nodeInfo.IsTurn)
{
case AgvDirection.Forward:
motorCmd = MotorCommand.Forward;
break;
case AgvDirection.Backward:
motorCmd = MotorCommand.Backward;
break;
default:
motorCmd = MotorCommand.Stop;
break;
motorCmd = MotorCommand.Stop;
reason = eAGVCommandReason.MarkStop;
}
else
{
switch (nodeInfo.MotorDirection)
{
case AgvDirection.Forward:
motorCmd = MotorCommand.Forward;
break;
case AgvDirection.Backward:
motorCmd = MotorCommand.Backward;
break;
default:
motorCmd = MotorCommand.Stop;
break;
}
}
// MagnetDirection → MagnetPosition 변换
MagnetPosition magnetPos;
switch (nodeInfo.MagnetDirection)
{
case MagnetDirection.Left:
case MagnetDirection.Left:
magnetPos = MagnetPosition.L;
break;
case MagnetDirection.Right:
@@ -761,9 +771,12 @@ namespace AGVNavigationCore.Models
motorCmd,
magnetPos,
speed,
eAGVCommandReason.Normal,
reason,
$"{actionDescription} → {targetNode.Id} (Motor:{motorCmd}, Magnet:{magnetPos})"
);
)
{
IsTurn = nodeInfo.IsTurn
};
}
private void StartMovement()