# jenniferbuehler/graspit-pkgs architecture

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

- Interactive diagram: https://gitdiagram.com/jenniferbuehler/graspit-pkgs
- Repository: https://github.com/jenniferbuehler/graspit-pkgs

## Overview

##### Main Components
- Core Grasp Planning Engine: Represented by the “grasp_planning_graspit” package. This package includes the core C++ classes and algorithms (for example, the EigenGraspPlanner and various utilities in both “include” and “src”) that implement the grasp planning functionality.
- Message Definitions: The “grasp_planning_graspit_msgs” package provides ROS service definitions (.srv files) and messages that enable inter-process communication.
- ROS Interface and Nodes: The “grasp_planning_graspit_ros” package serves as the bridge between the GraspIt core and the ROS ecosystem. It contains ROS nodes, launch files, and additional wrappers (e.g., EigenGraspPlannerClient, GraspItServices) that wrap the core functionality for ROS usage.
- Supporting Tools and Utilities:
- “graspit_tools” package likely includes additional utilities or helper functions that support the main GraspIt functionalities.
- “urdf2graspit” is a conversion tool intended to translate URDF (Universal Robot Description Format) models into a format suitable for GraspIt, including conversion utilities and corresponding ROS nodes.
- Sample/Reference Implementations: The “jaco_graspit_sample” package includes sample configurations, models, and example code (alongside example grasp files and worlds) that demonstrate how to integrate or test the core functionalities with a specific robot (the Jaco robot).

##### Relationships and Interactions
- The Core Grasp Planning Engine (grasp_planning_graspit) lies at the foundation. It is directly used by the ROS interface (grasp_planning_graspit_ros) which wraps it into nodes and services.
- The message definitions (grasp_planning_graspit_msgs) provide the data contracts for the ROS-based interactions; these are consumed by the ROS layer to communicate results, commands, and state information.
- The “urdf2graspit” package acts as a conversion module that interfaces with the core engine and possibly with external robot design data.
- The sample package (jaco_graspit_sample) uses both the core functionality and the ROS interfaces to demonstrate end-to-end integration, including model loading and planning execution.
- “graspit_tools” might supply additional functionalities, extensions, or debugging aids across modules.

##### Architectural Patterns and Design Principles
- Modularization: Each package is separated by responsibility (core algorithms, ROS communications, model conversion, sample implementations), which helps in maintaining a clear separation of concerns.
- Layered Architecture: The system differentiates between low-level core functionality, a communication layer (via ROS interface and message packages), and high-level usage/demonstration layers (sample implementations).
- Use of CMake and ROS: The presence of CMakeLists.txt files, package.xml files, and ROS launch files shows that the build and execution are separated by package boundaries, promoting component reusability and decoupling.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Layer
    subgraph "Core Layer"
        CORE["Core Grasp Planning Engine (grasp_planning_graspit)"]:::core
    end

    %% ROS Communication Layer
    subgraph "ROS Communication Layer"
        MSG["ROS Message Definitions (grasp_planning_graspit_msgs)"]:::ros
        ROSIF["ROS Interface / Nodes (grasp_planning_graspit_ros)"]:::ros
    end

    %% Utility Layer
    subgraph "Utility Layer"
        CONV["Conversion Tools (urdf2graspit)"]:::utility
        SUPPORT["Supporting Tools and Utilities (graspit_tools)"]:::utility
    end

    %% Sample/Reference Layer
    subgraph "Sample/Reference Layer"
        SAMPLE["Sample Applications (jaco_graspit_sample)"]:::sample
    end

    %% Connections
    ROSIF -->|"calls"| CORE
    ROSIF -->|"uses"| MSG
    SAMPLE -->|"demonstrates"| ROSIF
    SAMPLE -->|"integrates_with"| CORE
    CONV -->|"converts_to"| CORE
    SUPPORT -->|"enhances"| CORE
    SUPPORT -->|"enhances"| ROSIF

    %% Click Events
    click CORE "https://github.com/jenniferbuehler/graspit-pkgs/tree/master/grasp_planning_graspit/"
    click MSG "https://github.com/jenniferbuehler/graspit-pkgs/tree/master/grasp_planning_graspit_msgs/"
    click ROSIF "https://github.com/jenniferbuehler/graspit-pkgs/tree/master/grasp_planning_graspit_ros/"
    click CONV "https://github.com/jenniferbuehler/graspit-pkgs/tree/master/urdf2graspit/"
    click SUPPORT "https://github.com/jenniferbuehler/graspit-pkgs/tree/master/graspit_tools/"
    click SAMPLE "https://github.com/jenniferbuehler/graspit-pkgs/tree/master/jaco_graspit_sample/"

    %% Styles
    classDef core fill:#bae1ba,stroke:#2d6a2d,stroke-width:2px,color:#000;
    classDef ros fill:#b3cde0,stroke:#084298,stroke-width:2px,color:#000;
    classDef utility fill:#ffd699,stroke:#b26d00,stroke-width:2px,color:#000;
    classDef sample fill:#f4cccc,stroke:#a61c00,stroke-width:2px,color:#000;
```
