# paul901003/webots_program architecture

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

- Interactive diagram: https://gitdiagram.com/paul901003/webots_program
- Repository: https://github.com/paul901003/webots_program

## Overview

This repository appears to support robotic multi-view capture and visual-hull-based reconstruction of YCB scenes, followed by instance grouping and scene-relation analysis. The principal workflow is to plan viewpoints, capture RGB/depth and pose data, derive masks and labels, carve a hull, and associate voxels into instances. The tree also shows scene-generation, visualization, and evaluation capabilities. There is no README, and sampled source is partial, so links between unsampled supervisors and processing stages are intentionally omitted.

Main entry points: [`controllers`](https://github.com/paul901003/webots_program/tree/master/controllers) (Capture Supervisors), [`controllers/realsense_auto_capture_controller/realsense_auto_capture_controller.py`](https://github.com/paul901003/webots_program/blob/master/controllers/realsense_auto_capture_controller/realsense_auto_capture_controller.py) (Camera Capture), [`srp/io/masks.py`](https://github.com/paul901003/webots_program/blob/master/srp/io/masks.py) (Mask And Pose I/O), [`tools/generate_labels.py`](https://github.com/paul901003/webots_program/blob/master/tools/generate_labels.py) (Rendered COCO Labels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture And Planning"]
  node_view_planning["Viewpoint Planning"]
  node_capture_supervisors["Capture Supervisors"]
  node_robot_controller["UR5e Control"]
  node_realsense_capture["Camera Capture"]
end

subgraph group_perception["Masks And Labels"]
  node_rendered_labels["Rendered COCO Labels<br/>[generate_labels.py]"]
  node_segmentation["Image Segmentation<br/>[mobilesamv2_seg.py]"]
  node_mask_io["Mask And Pose I/O<br/>[masks.py]"]
end

subgraph group_reconstruction["3D Reconstruction"]
  node_hull_carving["Visual Hull Carving<br/>[carve.py]"]
  node_hull_data["Hull Voxel Data"]
  node_instance_association["Instance Association<br/>[associate_voxel.py]"]
  node_instance_merge["Instance Refinement"]
  node_instance_data["Instance Labels"]
end

subgraph group_analysis["Relations And Evaluation"]
  node_scene_relations["Scene Relations<br/>[scene_graph_gt.py]"]
  node_evaluation["Evaluation And Reports<br/>[eval.py]"]
  node_visualization["3D Visualization<br/>[gen_viz_objs.py]"]
end

node_operator(("Operator"))
node_webots(("Webots Simulation"))
node_ros_moveit(("ROS 2 MoveIt"))
node_capture_data["Captured RGB Depth Pose"]

node_operator -->|"requests views"| node_view_planning
node_view_planning -.->|"plans paths"| node_ros_moveit
node_operator -->|"starts capture"| node_capture_supervisors
node_capture_supervisors -->|"commands arm"| node_robot_controller
node_robot_controller -->|"moves robot"| node_webots
node_capture_supervisors -->|"sends capture commands"| node_realsense_capture
node_realsense_capture -->|"reads sensors"| node_webots
node_realsense_capture -->|"saves RGB depth pose"| node_capture_data
node_operator -->|"requests labels"| node_rendered_labels
node_rendered_labels -->|"renders COCO masks"| node_rendered_labels
node_operator -->|"requests masks"| node_segmentation
node_segmentation -->|"provides masks"| node_mask_io
node_capture_data -->|"supplies views and pose"| node_hull_carving
node_mask_io -->|"supplies masks and pose"| node_hull_carving
node_hull_carving -->|"writes hull"| node_hull_data
node_hull_data -->|"provides occupancy"| node_instance_association
node_mask_io -->|"supplies view masks and pose"| node_instance_association
node_instance_association -->|"writes instances"| node_instance_data
node_instance_data -->|"reads labels"| node_instance_merge
node_hull_data -->|"reads hull surface"| node_instance_merge
node_instance_merge -->|"writes refined labels"| node_instance_data
node_instance_data -->|"informs relation analysis"| node_scene_relations
node_instance_data -->|"evaluates instances"| node_evaluation
node_hull_data -->|"visualizes hull"| node_visualization
node_instance_data -->|"visualizes instances"| node_visualization

click node_view_planning "https://github.com/paul901003/webots_program/blob/master/controllers/ycb_supervisor_capture/generate_candidate_viewpoints.py"
click node_capture_supervisors "https://github.com/paul901003/webots_program/tree/master/controllers"
click node_robot_controller "https://github.com/paul901003/webots_program/blob/master/controllers/ur5e_auto_capture_controller/ur5e_auto_capture_controller.py"
click node_realsense_capture "https://github.com/paul901003/webots_program/blob/master/controllers/realsense_auto_capture_controller/realsense_auto_capture_controller.py"
click node_rendered_labels "https://github.com/paul901003/webots_program/blob/master/tools/generate_labels.py"
click node_segmentation "https://github.com/paul901003/webots_program/blob/master/mobilesamv2/mobilesamv2_seg.py"
click node_mask_io "https://github.com/paul901003/webots_program/blob/master/srp/io/masks.py"
click node_hull_carving "https://github.com/paul901003/webots_program/blob/master/srp/stage1_hull/carve.py"
click node_instance_association "https://github.com/paul901003/webots_program/blob/master/instance_hull/associate_voxel.py"
click node_instance_merge "https://github.com/paul901003/webots_program/blob/master/srp/stage2_instances/merge_bridge_frag.py"
click node_scene_relations "https://github.com/paul901003/webots_program/blob/master/srp/stage3_graph/scene_graph_gt.py"
click node_evaluation "https://github.com/paul901003/webots_program/blob/master/srp/stage2_instances/eval.py"
click node_visualization "https://github.com/paul901003/webots_program/blob/master/srp/stage2_instances/gen_viz_objs.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_view_planning,node_capture_supervisors,node_robot_controller,node_realsense_capture toneBlue
class node_rendered_labels,node_segmentation,node_mask_io toneAmber
class node_hull_carving,node_hull_data,node_instance_association,node_instance_merge,node_instance_data toneMint
class node_scene_relations,node_evaluation,node_visualization toneRose
class node_operator,node_webots,node_ros_moveit,node_capture_data toneIndigo
```

## Components

### Capture And Planning

- [Viewpoint Planning](https://github.com/paul901003/webots_program/blob/master/controllers/ycb_supervisor_capture/generate_candidate_viewpoints.py): `controllers/ycb_supervisor_capture/generate_candidate_viewpoints.py`
- [Capture Supervisors](https://github.com/paul901003/webots_program/tree/master/controllers): `controllers`
- [UR5e Control](https://github.com/paul901003/webots_program/blob/master/controllers/ur5e_auto_capture_controller/ur5e_auto_capture_controller.py): `controllers/ur5e_auto_capture_controller/ur5e_auto_capture_controller.py`
- [Camera Capture](https://github.com/paul901003/webots_program/blob/master/controllers/realsense_auto_capture_controller/realsense_auto_capture_controller.py): `controllers/realsense_auto_capture_controller/realsense_auto_capture_controller.py`

### Masks And Labels

- [Rendered COCO Labels](https://github.com/paul901003/webots_program/blob/master/tools/generate_labels.py): `tools/generate_labels.py`
- [Image Segmentation](https://github.com/paul901003/webots_program/blob/master/mobilesamv2/mobilesamv2_seg.py): `mobilesamv2/mobilesamv2_seg.py`
- [Mask And Pose I/O](https://github.com/paul901003/webots_program/blob/master/srp/io/masks.py): `srp/io/masks.py`

### 3D Reconstruction

- [Visual Hull Carving](https://github.com/paul901003/webots_program/blob/master/srp/stage1_hull/carve.py): `srp/stage1_hull/carve.py`
- **Hull Voxel Data**
- [Instance Association](https://github.com/paul901003/webots_program/blob/master/instance_hull/associate_voxel.py): `instance_hull/associate_voxel.py`
- [Instance Refinement](https://github.com/paul901003/webots_program/blob/master/srp/stage2_instances/merge_bridge_frag.py): `srp/stage2_instances/merge_bridge_frag.py`
- **Instance Labels**

### Relations And Evaluation

- [Scene Relations](https://github.com/paul901003/webots_program/blob/master/srp/stage3_graph/scene_graph_gt.py): `srp/stage3_graph/scene_graph_gt.py`
- [Evaluation And Reports](https://github.com/paul901003/webots_program/blob/master/srp/stage2_instances/eval.py): `srp/stage2_instances/eval.py`
- [3D Visualization](https://github.com/paul901003/webots_program/blob/master/srp/stage2_instances/gen_viz_objs.py): `srp/stage2_instances/gen_viz_objs.py`

### Other components

- **Operator**
- **Webots Simulation**
- **ROS 2 MoveIt**
- **Captured RGB Depth Pose**

## Connections

- Operator → Viewpoint Planning: requests views
- Viewpoint Planning → ROS 2 MoveIt: plans paths
- Operator → Capture Supervisors: starts capture
- Capture Supervisors → UR5e Control: commands arm
- UR5e Control → Webots Simulation: moves robot
- Capture Supervisors → Camera Capture: sends capture commands
- Camera Capture → Webots Simulation: reads sensors
- Camera Capture → Captured RGB Depth Pose: saves RGB depth pose
- Operator → Rendered COCO Labels: requests labels
- Rendered COCO Labels → Rendered COCO Labels: renders COCO masks
- Operator → Image Segmentation: requests masks
- Image Segmentation → Mask And Pose I/O: provides masks
- Captured RGB Depth Pose → Visual Hull Carving: supplies views and pose
- Mask And Pose I/O → Visual Hull Carving: supplies masks and pose
- Visual Hull Carving → Hull Voxel Data: writes hull
- Hull Voxel Data → Instance Association: provides occupancy
- Mask And Pose I/O → Instance Association: supplies view masks and pose
- Instance Association → Instance Labels: writes instances
- Instance Labels → Instance Refinement: reads labels
- Hull Voxel Data → Instance Refinement: reads hull surface
- Instance Refinement → Instance Labels: writes refined labels
- Instance Labels → Scene Relations: informs relation analysis
- Instance Labels → Evaluation And Reports: evaluates instances
- Hull Voxel Data → 3D Visualization: visualizes hull
- Instance Labels → 3D Visualization: visualizes instances
