# sudhirpratapyadav/pick-place-robot architecture

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

- Interactive diagram: https://gitdiagram.com/sudhirpratapyadav/pick-place-robot
- Repository: https://github.com/sudhirpratapyadav/pick-place-robot

## Overview

##### Main Components
- PyBullet Simulation & Controller: Represented by key Python scripts such as custom_robot.py, exp1.py, ur5.py, and ur5_debug.py that set up and interact with the simulation environment.
- Robot Models:
- UR5 Arm: Its URDF files (under the urdf directory), along with its meshes (meshes/ur5 folder), define the robot’s structure and appearance.
- Robotiq 2F-85 Gripper: Similarly defined with its URDF files (e.g., urdf/robotiq_2f_85.urdf, urdf/robotiq_2f_85_actual_mesh.urdf) and associated mesh directories (meshes/robotiq_2f_85 and meshes/robotiq_2f_85_original).
- Environment/Objects: The meshes/objects directory contains various object models (block, cup, lego, plate, etc.) that will be manipulated by the robot.
- URDF and Mesh Resources: These directories are key to the visual and collision aspects of both the robot and objects. They highlight the modular reuse of models from other projects.

- The central component is the PyBullet simulation engine which loads the URDF descriptions—these in turn refer to the mesh files that visually represent each robot link and object.
- Interactions between the simulation controller (custom_robot.py and the other Python scripts) and the physical robot components (the UR5 and gripper models).
- Connections showing that the simulated robot (arm + gripper) interacts with objects taken from the objects' mesh models.

##### Architectural Patterns and Design Principles
- Separation of concerns: simulation control, robot kinematics/dynamics, and the modeling of environmental objects.

##### Specific Technologies and Libraries
- PyBullet: Acts as the physics simulation engine.
- URDF: Used to describe both the UR5 robot and the Robotiq gripper.
- Mesh formats (OBJ, STL, MTL, DAE): Provide the visual and collision properties for all components.

- As this is not a full-stack web application but a specialized simulation project, focus on the mapping between code (Python scripts), robot configuration (URDF and meshes) and simulation execution.
- That every element from the file tree that plays a role in the simulation is represented, especially the subdirectories under meshes and urdf which highlight the detailed configuration of both the arm and the gripper.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Controller Scripts"
        CS1["custom_robot.py"]:::controller
        CS2["exp1.py"]:::controller
        CS3["ur5.py"]:::controller
        CS4["ur5_debug.py"]:::controller
    end

    SIM["PyBullet Simulation Engine"]:::engine

    CS1 -->|"sends commands"| SIM
    CS2 -->|"sends commands"| SIM
    CS3 -->|"sends commands"| SIM
    CS4 -->|"sends commands"| SIM

    subgraph "Robot Models"
        UR5["UR5 Robot Arm"]:::robot
        GRIP["Robotiq 2F-85 Gripper"]:::robot

        UR5_URDF["URDF: \"urdf/ur5.urdf\""]:::robot
        UR5_MESH["Meshes: \"meshes/ur5\""]:::robot

        GRIP_URDF1["URDF: \"urdf/robotiq_2f_85.urdf\""]:::robot
        GRIP_URDF2["URDF: \"urdf/robotiq_2f_85_actual_mesh.urdf\""]:::robot
        GRIP_MESH1["Meshes: \"meshes/robotiq_2f_85\""]:::robot
        GRIP_MESH2["Meshes: \"meshes/robotiq_2f_85_original\""]:::robot
    end

    SIM -->|"loads_URDF"| UR5
    SIM -->|"loads_URDF"| GRIP

    UR5 --> UR5_URDF
    UR5 --> UR5_MESH

    GRIP --> GRIP_URDF1
    GRIP --> GRIP_URDF2
    GRIP --> GRIP_MESH1
    GRIP --> GRIP_MESH2

    subgraph "Environment Objects"
        ENV["Environment Objects"]:::object
        ENV_MESH["Meshes: \"meshes/objects\""]:::object
    end

    SIM -->|"loads_meshes"| ENV
    ENV --> ENV_MESH

    %% Optional Note
    NOTE["Note: MaterialTag color rendering issues present"]:::note
    SIM --- NOTE

    %% Click Events for Controller Scripts
    click CS1 "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/custom_robot.py"
    click CS2 "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/exp1.py"
    click CS3 "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/ur5.py"
    click CS4 "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/ur5_debug.py"

    %% Click Events for UR5 Robot Arm
    click UR5_URDF "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/urdf/ur5.urdf"
    click UR5_MESH "https://github.com/sudhirpratapyadav/pick-place-robot/tree/main/meshes/ur5"

    %% Click Events for Robotiq 2F-85 Gripper
    click GRIP_URDF1 "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/urdf/robotiq_2f_85.urdf"
    click GRIP_URDF2 "https://github.com/sudhirpratapyadav/pick-place-robot/blob/main/urdf/robotiq_2f_85_actual_mesh.urdf"
    click GRIP_MESH1 "https://github.com/sudhirpratapyadav/pick-place-robot/tree/main/meshes/robotiq_2f_85"
    click GRIP_MESH2 "https://github.com/sudhirpratapyadav/pick-place-robot/tree/main/meshes/robotiq_2f_85_original"

    %% Click Event for Environment Objects
    click ENV_MESH "https://github.com/sudhirpratapyadav/pick-place-robot/tree/main/meshes/objects"

    %% Styles
    classDef controller fill:#f9c,stroke:#333,stroke-width:2px;
    classDef engine fill:#bbf,stroke:#333,stroke-width:2px;
    classDef robot fill:#cfc,stroke:#333,stroke-width:2px;
    classDef object fill:#ffd,stroke:#333,stroke-width:2px;
    classDef note fill:#eee,stroke:#333,stroke-dasharray: 4 2,stroke-width:2px;
```
