Commit Graph

7 Commits

Author SHA1 Message Date
backuppc
4a50b4064d feat: Strengthen magnet direction weighting in path prediction
마그넷 방향(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>
2025-10-27 17:36:29 +09:00
backuppc
177309c5c9 feat: Add comprehensive debug logging to path validation functions
- 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>
2025-10-27 17:13:04 +09:00
backuppc
f4ec63330a feat: Add magnet direction support to GetNextNodeByDirection function
- 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>
2025-10-27 16:55:13 +09:00
backuppc
735b7dccec refactor: Convert AGVPathResult.Path from List<string> to List<MapNode>
## 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>
2025-10-27 16:46:13 +09:00
backuppc
dbf81bfc60 .. 2025-10-27 12:00:59 +09:00
backuppc
d932b8d332 fix: Add motor direction parameter to magnet direction calculation in pathfinding
- 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>
2025-10-24 15:46:16 +09:00
backuppc
dbaf647d4e refactor: Move AGV development projects to separate AGVLogic folder
- 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>
2025-10-23 10:00:40 +09:00