# ferbin12/hannah_arm architecture

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

- Interactive diagram: https://gitdiagram.com/ferbin12/hannah_arm
- Repository: https://github.com/ferbin12/hannah_arm

## Overview

##### Main Components
- Robotic Description & Simulation:
- hannahbot_description: Contains URDF/XACRO files, meshes, and Gazebo/rviz launch files. It defines the physical and visual properties of the manipulator.
- Launch files like gazebo_launch.py (under hannahbot_description/launch) illustrate how the simulator is started.
- Controller & Hardware Interface:
- hannahbot_controller: Provides the ros2_control interfaces and configuration (e.g., controllers.yaml) including nodes for slider control.
- Launch files (controller.launch.py, slider_controller.launch.py) indicate how these controllers are brought up.
- Motion Planning:
- hannahbot_moveit: Houses motion planning configuration (SRDF, kinematics, joint limits, etc.) and MoveIt2 launch files (moveit.launch.py) that interface with OMPL for path planning.
- Messaging and Services:
- hannahbot_msgs: Defines custom ROS2 messages, services (e.g., AddTwoInts.srv, EulerToQuaternion.srv) and actions (Fibonacci.action, ArduinoBotTask.action) that support communication between components.
- Additional Helper Libraries & Examples:
- hannabot_remote, cpp_srvcli, py_service, hannah_bot, hannah_cpp_egs, hannahbot_utils: These contain various ROS2 client/server implementations (in C++ and Python), utility functions (e.g., simple publisher, subscriber, service servers/clients), and example code that demonstrates interfacing with the system.

##### Relationships & Interactions
- The simulation environment (Gazebo via hannahbot_description) provides the virtual world in which the robot is visualized.
- The robot’s physical configuration (URDF and meshes) is consumed by both the simulator and MoveIt2 for planning.
- The controller package (hannahbot_controller) uses ros2_control to interface with simulated or real hardware.
- The motion planning package (hannahbot_moveit) interfaces with the controllers to generate and execute collision-free trajectories.
- Communication is managed through ROS2 topics, services, and actions defined in hannahbot_msgs, with additional demonstration functionality in cpp_srvcli, py_service, and hannah_bot packages.
- Each ROS2 package is launched individually (with specific launch scripts) but are intended to work together as part of a full robotic system.

##### Architectural Patterns & Design Principles
- Modular ROS2 Package Architecture: Different functional aspects are encapsulated in individual packages.
- Clear Separation of Concerns: URDF and simulation components (description) are separate from control logic (controller) and planning (moveit).
- Client/Server and Publisher/Subscriber Communication: Demonstrated in multiple packages (cpp_srvcli, py_service, hannah_bot) to facilitate inter-node messaging.
- Use of Launch Files: Centralized configuration for node startup and interconnections.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Modules
    subgraph "Core Modules"
        A1["Simulation (hannahbot_description)"]:::simulation
        A2["Controller (hannahbot_controller)"]:::controller
        A3["Motion Planning (hannahbot_moveit)"]:::planning
    end

    %% Interfaces & Communication
    subgraph "Interfaces & Communication"
        B1["Messaging & Services (hannahbot_msgs)"]:::messaging
    end

    %% Demo and Utility Modules
    subgraph "Demo and Utility Modules"
        C1["C++ Service/Client (cpp_srvcli)"]:::demo
        C2["Python Bot (hannah_bot)"]:::demo
        C3["C++ Examples (hannah_cpp_egs)"]:::demo
        C4["Python Service (py_service)"]:::demo
        C5["Remote Interface (hannabot_remote)"]:::demo
        C6["Utility Library (hannahbot_utils)"]:::demo
    end

    %% Connections between Core Modules
    A1 -->|"launch-gazebo"| A2
    A2 -->|"send-commands"| A3
    A3 -->|"planned-trajectory"| A2

    %% Connections with Messaging
    A1 -->|"provides-desc"| B1
    A2 -->|"control-status"| B1
    A3 -->|"planning-status"| B1

    %% Connections with Demo and Utility Modules
    B1 -->|"service-calls"| C1
    B1 -->|"service-calls"| C2
    B1 -->|"service-calls"| C3
    B1 -->|"service-calls"| C4
    B1 -->|"service-calls"| C5
    B1 -->|"service-calls"| C6

    %% Click Events
    click A1 "https://github.com/ferbin12/hannah_arm/tree/main/hannahbot_description"
    click A2 "https://github.com/ferbin12/hannah_arm/tree/main/hannahbot_controller"
    click A3 "https://github.com/ferbin12/hannah_arm/tree/main/hannahbot_moveit"
    click B1 "https://github.com/ferbin12/hannah_arm/tree/main/hannahbot_msgs"
    click C1 "https://github.com/ferbin12/hannah_arm/tree/main/cpp_srvcli"
    click C2 "https://github.com/ferbin12/hannah_arm/tree/main/hannah_bot"
    click C3 "https://github.com/ferbin12/hannah_arm/tree/main/hannah_cpp_egs"
    click C4 "https://github.com/ferbin12/hannah_arm/tree/main/py_service"
    click C5 "https://github.com/ferbin12/hannah_arm/tree/main/hannabot_remote"
    click C6 "https://github.com/ferbin12/hannah_arm/tree/main/hannahbot_utils"

    %% Styles
    classDef simulation fill:#E8F5E9,stroke:#1B5E20,stroke-width:2px;
    classDef controller fill:#E3F2FD,stroke:#1565C0,stroke-width:2px;
    classDef planning fill:#FFF3E0,stroke:#EF6C00,stroke-width:2px;
    classDef messaging fill:#F3E5F5,stroke:#6A1B9A,stroke-width:2px;
    classDef demo fill:#FCE4EC,stroke:#AD1457,stroke-width:2px;
```
