# nitic-robot-club/nhk2025b_ros2 architecture

> Architecture diagram of the GitHub repository nitic-robot-club/nhk2025b_ros2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nitic-robot-club/nhk2025b_ros2
- Repository: https://github.com/nitic-robot-club/nhk2025b_ros2

## Overview

##### Project type and purpose
- This is a ROS2-based robotics software stack (“nhk2025b_ros2”) for controlling and simulating a robot platform, including perception, localization, planning, control, behavior, and visualization, all organized into ROS2 packages.

##### File structure
- Top-level directories correspond to key ROS2 domains:
- src/message: custom ROS2 message definitions (nhk2025b_msgs)
- src/common: hardware interfaces, utility libraries, URDF/meshes
- src/localization: odometry, EKF, MCL, ICP, pose initialization
- src/planning: path planner node
- src/control: pure pursuit & swerve kinematics calculators
- src/behavior: high-level state machine driving the robot
- src/simulation: simulated sensors/actuators for test runs
- src/launch: XML/Python launch definitions with parameter files
- Build and deploy artifacts (CMakeLists.txt, package.xml, setup.py) indicate a standard ROS2/CMake + Python package layout.

##### README for additional insights
- The README confirms ROS2 Humble, simulation vs. real-hardware launches, dependencies (xacro, joint-state-publisher, can-utils), and CAN/V-CAN setup.
- It implies a layered ROS graph: sensor → perception → localization → planning → control → actuation/behavior, with supporting visualization.

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Hardware Layer"
    can["nhk2025b_canable"]:::hardware
    lidar["nhk2025b_lidar_merger"]:::hardware
    joint["nhk2025b_joint_state_publisher"]:::hardware
    initbox["nhk2025b_initial_box_publisher"]:::hardware
    mappub["nhk2025b_map_publisher"]:::hardware
    desc["nhk2025b_description"]:::hardware
  end

  subgraph "Common Utilities"
    utils["nhk2025b_utils"]:::common
    monitor["nhk2025b_monitor"]:::common
    msgs["nhk2025b_msgs"]:::common
  end

  subgraph "Perception Layer"
    ebox["nhk2025b_e_box_perception"]:::perception
  end

  subgraph "Localization Layer"
    odo["nhk2025b_wheel_odometry"]:::localization
    ekf["nhk2025b_ekf"]:::localization
    mcl["nhk2025b_mcl"]:::localization
    icp["nhk2025b_icp"]:::localization
    initpose["nhk2025b_pose_initializer"]:::localization
  end

  subgraph "Planning Layer"
    planner["nhk2025b_path_planner"]:::planning
  end

  subgraph "Control Layer"
    purep["nhk2025b_pure_pursuit"]:::control
    swerve["nhk2025b_swerve_calculator"]:::control
  end

  subgraph "Behavior Layer"
    behavior["nhk2025b_behavior"]:::behavior
  end

  subgraph "Simulation & Visualization"
    sim["nhk2025b_simulation"]:::simulation
    viz["nhk2025b_visualization"]:::visualization
  end

  launch["Launch & Parameters"]:::launch
  ros["ROS2 Core (DDS)"]:::ros

  %% Data Flows
  can -->|"scan /cmd| ebox
  lidar -->|"scan merged| ebox
  joint -->|"joint_states| ebox
  initbox -->|"initial_boxes| ebox
  ebox -->|"boxes| ekf
  odo -->|"odom| ekf
  initpose -->|"init_pose| ekf
  ebox -->|"boxes| mcl
  odo -->|"odom| mcl
  mcl -->|"pose| planner
  ekf -->|"pose| planner
  planner -->|"path| purep
  planner -->|"path| swerve
  purep -->|"cmd_vel| can
  swerve -->|"swerve_cmd| can
  behavior -->|"high_level_cmd| planner
  sim -->|"fake_scan| ebox
  sim -->|"fake_odom| odo
  sim -->|"fake_boxes| ebox
  viz -->|"subscribe topics| ros

  %% ROS Core
  ros --> ebox
  ros --> odo
  ros --> ekf
  ros --> mcl
  ros --> planner
  ros --> purep
  ros --> swerve
  ros --> behavior
  ros --> sim
  ros --> viz

  %% Launch
  launch --> can
  launch --> lidar
  launch --> joint
  launch --> initbox
  launch --> mappub
  launch --> desc
  launch --> utils
  launch --> monitor
  launch --> msgs
  launch --> ebox
  launch --> odo
  launch --> ekf
  launch --> mcl
  launch --> icp
  launch --> initpose
  launch --> planner
  launch --> purep
  launch --> swerve
  launch --> behavior
  launch --> sim
  launch --> viz

  %% Click Events
  click msgs "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/message/nhk2025b_msgs"
  click can "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_canable"
  click lidar "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_lidar_merger"
  click joint "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_joint_state_publisher"
  click initbox "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_initial_box_publisher"
  click mappub "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_map_publisher"
  click desc "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_description"
  click utils "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_utils"
  click monitor "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/common/nhk2025b_monitor"
  click ebox "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/perception/nhk2025b_e_box_perception"
  click odo "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/localization/nhk2025b_wheel_odometry"
  click ekf "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/localization/nhk2025b_ekf"
  click mcl "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/localization/nhk2025b_mcl"
  click icp "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/localization/nhk2025b_icp"
  click initpose "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/localization/nhk2025b_pose_initializer"
  click planner "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/planning/nhk2025b_path_planner"
  click purep "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/control/nhk2025b_pure_pursuit"
  click swerve "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/control/nhk2025b_swerve_calculator"
  click behavior "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/behavior/nhk2025b_behavior"
  click sim "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/simulation/nhk2025b_simulation"
  click viz "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/visualization/nhk2025b_visualization"
  click launch "https://github.com/nitic-robot-club/nhk2025b_ros2/tree/main/src/launch/nhk2025b_launch"

  %% Styles
  classDef hardware fill:#d3d3d3,stroke:#333,stroke-width:1px
  classDef common fill:#e0e0e0,stroke:#333,stroke-width:1px
  classDef perception fill:#87cefa,stroke:#333,stroke-width:1px
  classDef localization fill:#98fb98,stroke:#333,stroke-width:1px
  classDef planning fill:#ffa500,stroke:#333,stroke-width:1px
  classDef control fill:#ff7f7f,stroke:#333,stroke-width:1px
  classDef behavior fill:#dda0dd,stroke:#333,stroke-width:1px
  classDef simulation fill:#ffc0cb,stroke:#333,stroke-width:1px
  classDef visualization fill:#ffdead,stroke:#333,stroke-width:1px
  classDef launch fill:#add8e6,stroke:#333,stroke-width:1px
  classDef ros fill:#f5f5f5,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
```
