주요 변경사항:
- CleanupOrphanConnections() 함수 추가
- 저장 시 고아 연결 자동 정리
- 로드 시 고아 연결 자동 제거
- 경로 예측에서 삭제된 노드 연결 사용 방지
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- ConnectedMapNodes 속성 추가로 런타임 객체 참조 지원
- 이미지 에디터 UI 개선 (ImageEditorCanvas 추가)
- 연결 생성 버그 수정: 양방향 연결 생성
- 연결 삭제 버그 수정: 양방향 모두 제거
- CleanupDuplicateConnections 비활성화 (단방향 변환 버그)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add ProgressLogForm.cs for test result logging with ListView
- Implement real UI workflow simulation in path prediction test
- Test all connected node pairs to all docking targets
- Support CSV export for test results
- Keep List<string> ConnectedNodes structure (reverted List<MapNode> changes)
- Display RFID values in log for better readability
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
방향 유지 시 이전 노드로 되돌아가는 문제 수정
- 방향 유지(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>
마그넷 방향(Straight/Left/Right) 가중치 강화:
- Straight 보너스: 0.3 → 0.5
- 올바른 회전 보너스: 0.25 → 1.0
- 잘못된 회전 페널티: 0.2 → 0.8
이를 통해 GetNextNodeByDirection에서 마그넷 방향이 주요 결정 요소로 작동.
실제 경로 예측 정확도 개선 (Left 마그넷 방향 테스트: 100% 일치).
## 발견된 이슈 (다음 세션)
- 기본 내적(dot product) 차이가 큰 경우 (>1.0) 마그넷 보너스(+1.0)로 극복 못함
- 경로 계산 결과는 올바르지만, 검증 단계에서 다르게 평가되는 경우 존재
- 예: N022→N004→N011 경로, 마그넷 Right일 때
- 경로 생성: N011 선택 (내적 -0.1275, 마그넷 Right 일치)
- 검증 예측: N031 선택 (내적 0.9646, 마그넷 Right 일치)
- 원인: 내적 차이(1.0921) > 마그넷 보너스 효과(1.0)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Added detailed debug output to GetNextNodeByDirection() with:
- Initial node information (positions, movement vectors)
- All candidate nodes evaluation with step-by-step scoring
- Score calculations: base score → motor direction → magnet direction
- Final selection with best score
- Added detailed debug output to ValidateDockingDirection() with:
- Path validation stage information
- Expected vs actual next node comparison
- Movement vector analysis for mismatch debugging
- Success/failure status for each path segment
Debug output includes:
- Node IDs, RFIDs, positions, and vectors
- Normalized vectors and dot products
- Score progression through each bonus/penalty application
- Direction consistency analysis
- Final scoring results with selection indicators
This enables detailed tracing of path prediction and validation issues.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added MagnetDirection parameter to GetNextNodeByDirection() function in DirectionalHelper
- Implemented ApplyMagnetDirectionBonus() helper method using vector cross product for turn direction detection
- Straight magnet direction: +0.3f bonus for consistent forward direction
- Left/Right magnet direction: +0.25f bonus for correct turn, -0.2f penalty for wrong turn direction
- Updated DockingValidator to pass actual magnet direction from DetailedPath
- Updated AGVPathfinder calls to use MagnetDirection.Straight as default during path planning phase
- Includes debug output for scoring decisions with magnet direction analysis
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Summary
- Changed Path property type from List<string> to List<MapNode> for better type safety
- Eliminated O(n) node lookups throughout pathfinding system
- Added DirectionalHelper with motor direction consistency bonus/penalty
- Updated all path processing to work with MapNode objects directly
## Files Modified
- AGVPathResult.cs: Path property and CreateSuccess() method signature
- AStarPathfinder.cs: Path generation and node lookup optimization
- AGVPathfinder.cs: Path processing with MapNode objects
- DirectionChangePlanner.cs: Direction change planning with MapNode paths
- DockingValidator.cs: Docking validation with direct node access
- UnifiedAGVCanvas.Events.cs: Path visualization with MapNode iteration
- UnifiedAGVCanvas.cs: Destination node access
- VirtualAGV.cs: Path conversion to string IDs for storage
- DirectionalHelper.cs: Enhanced with motor direction awareness
- NodeMotorInfo.cs: Updated for new path structure
## Benefits
- Performance: Eliminated O(n) lookup searches
- Type Safety: Compile-time checking for node properties
- Code Quality: Direct property access instead of repeated lookups
- Maintainability: Single source of truth for node data
## Build Status
✅ AGVNavigationCore: Build successful (0 errors, 2 warnings)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Path Direction Detection (AGVPathfinder.cs):
- Added GetNextNodeByDirection() method to determine next node based on Forward/Backward direction
- Implements vector-based angle calculation for intelligent node selection
- Forward: selects node in continuous direction
- Backward: selects node in opposite direction
- Validates if selected direction matches path requirements
Logic additions at line 150-167:
- Detects next node for Forward and Backward directions
- Checks if backward movement aligns with path's next node
- Returns path with appropriate motor direction (ReverseDirection when applicable)
Improved Path Visualization (UnifiedAGVCanvas.Events.cs):
- Refined equilateral triangle arrows (8 pixels, symmetric)
- 50% transparency for purple path lines with 2x thickness
- Bidirectional path detection (darker color for repeated segments)
- Better visual distinction for calculated paths
Technical Details:
- Added System.Drawing using statement for PointF operations
- Added DirectionalPathfinder initialization
- Vector normalization for angle-based decisions
- Dot product calculation for direction similarity scoring
Result: AGV can now intelligently select next node based on current movement direction and validate path feasibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced path drawing with better visibility:
1. Arrow improvements:
- Changed from line-based arrows to filled triangle shapes
- Increased arrow size by 1.5x for better visibility
- Added polygon fill with outline for clearer identification
2. Path line improvements:
- Added 50% transparency to purple path color (Alpha: 128)
- Increased line thickness by 2x (from 4 to 8 pixels)
- Improved visual contrast and clarity
3. Bidirectional path detection:
- Detect routes that traverse the same segment multiple times
- Display bidirectional paths with higher opacity (darker color, Alpha: 200)
- Visual distinction helps identify round-trip routes
Changes in UnifiedAGVCanvas.Events.cs:
- Modified DrawDirectionArrow() to use FillPolygon instead of DrawLine
- Enhanced DrawPath() with transparency, thickness, and bidirectional detection
- Added System.Collections.Generic using statement
Result: Much better visual identification of calculated paths in HMI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Removed from AGVPathfinder.cs:
- ConvertToDetailedPath() - unused private method
- CalculatePathDistance() - unused private method
- ValidatePath() - unused public method
- ValidatePhysicalConstraints() - only called by ValidatePath (now removed)
- OptimizePath() - unused public method (TODO placeholder only)
- GetPathSummary() - unused public method (debug helper)
Kept essential methods:
- FindNearestJunction() - used by FindPath_test
- FindNearestJunctionOnPath() - used by FindPath_test
- MakeDetailData() - used by FindPath_test
- MakeMagnetDirection() - used by FindPath_test
Removed from VirtualAGV.cs:
- _targetId field - never used
- _currentId field - never used
- _rotationSpeed field - never used (read-only, no references)
Removed from UnifiedAGVCanvas.cs:
- AGVSelected event - unused
- AGVStateChanged event - unused
Result: Cleaner codebase, reduced technical debt, easier maintenance
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed critical issue in ConvertToDetailedPath where motor direction was not passed to GetRequiredMagnetDirection
- Motor direction is essential for backward movement as Left/Right directions must be inverted
- Modified AGVPathfinder.cs line 280 to pass currentDirection parameter
- Ensures backward motor direction properly inverts magnet sensor directions
feat: Add waypoint support to pathfinding system
- Added FindPath overload with params string[] waypointNodeIds in AStarPathfinder
- Supports sequential traversal through multiple intermediate nodes
- Validates waypoints and prevents duplicates in sequence
- Returns combined path result with aggregated metrics
feat: Implement path result merging with DetailedPath preservation
- Added CombineResults method in AStarPathfinder for intelligent path merging
- Automatically deduplicates nodes when last of previous path equals first of current
- Preserves DetailedPath information including motor and magnet directions
- Essential for multi-segment path operations
feat: Integrate magnet direction with motor direction awareness
- Modified JunctionAnalyzer.GetRequiredMagnetDirection to accept AgvDirection parameter
- Inverts Left/Right magnet directions when moving Backward
- Properly handles motor direction context throughout pathfinding
feat: Add automatic start node selection in simulator
- Added SetStartNodeToCombo method to SimulatorForm
- Automatically selects start node combo box when AGV position is set via RFID
- Improves UI usability and workflow efficiency
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix grid line coordinate transformation (world to screen)
- Properly align grid with zoom and pan transformations
- Calculate grid start position at GRID_SIZE multiples
- Draw grid lines across entire visible canvas area
- Ensure grid lines render completely regardless of zoom level
- Grid now displays consistently at all zoom magnifications
Fixes: Grid no longer disappears or renders incompletely when zoomed in
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Support middle mouse button (wheel) for map panning alongside left button
- Middle button drag always enables panning regardless of edit mode
- Change cursor to hand icon during middle button panning for clarity
- Left button panning remains unchanged (mode-dependent behavior preserved)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix ScreenToWorld coordinate transformation bug in wheel event
- Implement proper mouse cursor-centered zoom calculation
- Calculate world coordinates before zoom and maintain them after zoom
- Adjust pan offset to keep mouse cursor pointing at same world position
- Remove matrix-based transformation that was causing coordinate issues
Fixes: Wheel zoom now correctly centers on mouse cursor position and no longer causes erratic panning
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Reorganized AGVMapEditor, AGVNavigationCore, AGVSimulator into AGVLogic folder
- Removed deleted project files from root folder tracking
- Updated CLAUDE.md with AGVLogic-specific development guidelines
- Clean separation of independent project development from main codebase
- Projects now ready for independent development and future integration
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>