# ivaros/dynamicgap architecture

> Architecture diagram of the GitHub repository ivaros/dynamicgap, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ivaros/dynamicgap
- Repository: https://github.com/ivaros/dynamicgap

## Overview

##### Main Components Identification
The system can be broken down into these major components:

a. Core Planning Components:
- Gap Detection (gap_detection/)
- Gap Estimation (gap_estimation/)
- Gap Feasibility (gap_feasibility/)
- Trajectory Generation (trajectory_generation/)
- Trajectory Evaluation (trajectory_evaluation/)
- Trajectory Tracking (trajectory_tracking/)

b. Support Components:
- Scan Processing (scan_processing/)
- Global Plan Management (global_plan_management/)
- Visualization (visualization/)
- Configuration (config/)

**┌─────────────────────────── Input Layer ───────────────────────────┐**
- Laser Scans  │  Robot State  │  Global Plan  │  Dynamic Objects  │
- ┬───────────────────────────────────┘
- ▼
**┌─────────────────────── Processing Layer ──────────────────────────┐**
- ┌─────────────────┐    ┌─────────────────┐    ┌──────────────┐  │
- Scan Processing│───▶│  Gap Detection  │───▶│Gap Estimation│  │
- ┘    └─────────────────┘    └──────┬───────┘  │
- ▼           │
- ┌─────────────────┐    ┌─────────────────┐    ┌──────────────┐  │
- Gap Feasibility  │◀───│Gap Manipulation │◀───│ Gap Analysis │  │
- ┬─────────┘    └─────────────────┘    └──────────────┘  │
- ┼──────────────────────────────────────────────────────┘
- ▼
**┌─────────────────────── Planning Layer ───────────────────────────┐**
- ┌─────────────────┐    ┌─────────────────┐    ┌──────────────┐  │
- Trajectory    │───▶│   Trajectory    │───▶│  Trajectory  │  │
- Generation    │    │   Evaluation    │    │  Tracking    │  │
- ┘    └─────────────────┘    └──────────────┘  │
- ┬────────────────────────────────┘
- ▼
**┌─────────────────────── Output Layer ────────────────────────────┐**
- Robot Commands         │        Visualization Data        │
- ┘

##### Connection Types
- Double lines: ROS topic communication

##### Additional Elements
- Version information
- ROS node integration points
- Configuration parameters

##### Implementation Details
- Use standardized UML or similar notation
- Clear labels for all components
- Data types at interface points
- Critical timing loops

##### Key Relationships to Highlight
- Gap detection → Gap estimation → Trajectory generation pipeline
- Feedback loop between trajectory tracking and planning
- Integration with global plan management
- Visualization system connections

Remember to include notes about:
- ROS integration points
- Key configuration parameters
- Performance considerations
- Safety-critical components

This will provide a comprehensive view of the system while maintaining clarity about the core gap-based navigation concept.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Input Layer
    subgraph Input
        LaserScans["Laser Scans"]
        RobotState["Robot State"]
        GlobalPlan["Global Plan"]
        DynamicObjects["Dynamic Objects"]
    end

    %% Processing Layer
    subgraph Processing
        ScanProcessing["Scan Processing"]:::processing
        GapDetection["Gap Detection"]:::processing
        GapEstimation["Gap Estimation"]:::processing
        GapAnalysis["Gap Analysis"]:::processing
        GapManipulation["Gap Manipulation"]:::processing
        GapFeasibility["Gap Feasibility"]:::processing
    end

    %% Planning Layer
    subgraph Planning
        TrajGeneration["Trajectory Generation"]:::planning
        TrajEvaluation["Trajectory Evaluation"]:::planning
        TrajTracking["Trajectory Tracking"]:::planning
    end

    %% Output Layer
    subgraph Output
        RobotCommands["Robot Commands"]
        VisualizationData["Visualization Data"]
    end

    %% Support Components
    Config["Configuration"]:::support
    Visualization["Visualization"]:::support
    GlobalPlanMgmt["Global Plan Management"]:::support

    %% Connections
    LaserScans --> ScanProcessing
    RobotState --> GapEstimation
    GlobalPlan --> GlobalPlanMgmt
    DynamicObjects --> GapEstimation

    ScanProcessing --> GapDetection
    GapDetection --> GapEstimation
    GapEstimation --> GapAnalysis
    GapAnalysis --> GapManipulation
    GapManipulation --> GapFeasibility
    GapFeasibility --> TrajGeneration

    TrajGeneration --> TrajEvaluation
    TrajEvaluation --> TrajTracking
    TrajTracking --> RobotCommands

    Config -.-> Processing
    Config -.-> Planning
    
    GlobalPlanMgmt --> GapManipulation
    
    Processing --> VisualizationData
    Planning --> VisualizationData
    VisualizationData --> Visualization

    %% Styles
    classDef processing fill:#90EE90
    classDef planning fill:#FFA500
    classDef support fill:#D3D3D3

    %% Click Events
    click GapDetection "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/gap_detection/GapDetector.h"
    click GapEstimation "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/gap_estimation/Estimator.h"
    click GapFeasibility "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/gap_feasibility/GapFeasibilityChecker.h"
    click TrajGeneration "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/trajectory_generation/GapTrajectoryGenerator.h"
    click TrajEvaluation "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/trajectory_evaluation/TrajectoryEvaluator.h"
    click TrajTracking "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/trajectory_tracking/TrajectoryController.h"
    click ScanProcessing "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/scan_processing/DynamicScanPropagator.h"
    click GlobalPlanMgmt "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/global_plan_management/GlobalPlanManager.h"
    click Visualization "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/visualization/Visualizer.h"
    click Config "https://github.com/ivaROS/DynamicGap/blob/main/include/dynamic_gap/config/DynamicGapConfig.h"
```
