# ajzu2001/immersive-calibration-framework architecture

> Architecture diagram of the GitHub repository ajzu2001/immersive-calibration-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ajzu2001/immersive-calibration-framework
- Repository: https://github.com/ajzu2001/immersive-calibration-framework

## Overview

1. **Repository shape**
   - The active system is the ROS 2 Jazzy workspace in `software/arctos_jazzy_ws`.
   - `software/arctos_ros1_ws` is a ROS 1 legacy/reference workspace, mainly useful for comparing older MoveIt/URDF integration.
   - The repo is centered on a calibration-oriented digital twin for the ARCTOS 6-axis arm, with simulation, perception, hardware sync, and evaluation around that core.

2. **Main architectural boundary: shared ROS interfaces**
   - `arctos_interfaces` is the message contract layer that decouples subsystems.
   - Key messages are `CalibrationModel`, `CalibrationResult`, `HardwareJointState`, `PerceptionQuality`, and `TwinState`.
   - This package is the cleanest diagram boundary: all higher-level nodes exchange state and results through these typed messages rather than directly depending on each other’s internals.

3. **System orchestration / entry points**
   - `arctos_bringup` is the deployment layer for the ROS 2 stack.
   - Its launch file is the place where the major runtime pieces are composed into a working system.
   - The repo also includes demo scripts under `scripts/` for starting and checking the stack, which suggests repeatable scenario-based runs rather than one monolithic app.

4. **Digital twin and hardware synchronization**
   - `arctos_twin` is the runtime subsystem for keeping the virtual robot and physical robot aligned.
   - `esp32_bridge_node.py` is the hardware boundary: it bridges ROS-side commands/state to an ESP32-based controller over serial.
   - `mock_serial_packet_node.py` and `mock_hardware_sensor_node.py` indicate a simulation/testing path that can stand in for the real controller and sensors.
   - `sensor_fusion_node.py`, `sync_error_node.py`, and `twin_monitor_node.py` form the synchronization/health layer: they compare commanded vs observed state, compute mismatch, and expose twin status.

5. **Perception / vision subsystem**
   - `arctos_perception` handles AprilTag-based pose estimation.
   - `tag_pose_node.py` is the main perception node; `sim_apriltag_detection_node.py` and `mock_tag_pose_node.py` show that the same interface can be driven by simulation or by synthetic/mock data.
   - `config/apriltag_params.yaml` holds detector parameters, so perception is parameterized rather than hardcoded.
   - This subsystem feeds pose/quality information into calibration and twin synchronization.

6. **Calibration pipeline**
   - `arctos_calibration` is the core algorithmic subsystem.
   - The node split suggests a multi-stage pipeline: `calibration_observer_node.py` collects observations, `calibration_estimator_node.py` and `calibration_solver_node.py` derive a model/correction, `calibration_correction_node.py` and `correction_compensator_node.py` apply or compensate it, and `calibration_application_node.py` pushes the calibrated result into the rest of the system.
   - `calibration_manager_node.py` appears to coordinate the overall calibration flow, while launch files split manager and observer startup.
   - This is the main closed loop in the framework: observe robot/perception data, estimate calibration, apply corrections, then verify improvement.

7. **Simulation and robot description**
   - `arctos_description` provides the robot model and simulation assets.
   - It contains URDF/Xacro files, Gazebo-specific extensions, controller YAML, RViz configs, STL meshes, and SDF worlds.
   - Launch files such as `display.launch.py`, `gazebo.launch.py`, and `simulation.launch.py` make this the physical/digital twin substrate for both visualization and simulation-driven testing.
   - In the architecture diagram, this package is the non-code model boundary consumed by Gazebo, RViz, and controller managers.

8. **Evaluation and experiment analysis**
   - `arctos_evaluation` is the measurement layer for running experiments and extracting results.
   - `experiment_runner_node.py` suggests automated test runs; `metrics_node.py` computes performance measures; `analyze_results.py` and `plot_results.py` post-process and visualize outcomes.
   - This package closes the research loop: it measures whether calibration, perception, and synchronization actually improved the twin.

9. **VR / external visualization bridge**
   - `arctos_vr` contains `unity_bridge_node.py` and a dedicated launch file, indicating an integration boundary to a Unity-based VR client.
   - The repo treats VR as optional: it is not the core control path, but a visualization/interaction layer that can consume twin state and possibly provide operator input.

10. **Legacy ROS 1 reference workspace**
   - `software/arctos_ros1_ws` preserves an older architecture built around MoveIt, URDF descriptions, controller configs, and Arduino-related scripts.
   - It includes MoveIt configs, Gazebo/demo launch files, and an `arctos_moveit` package with both C++ and Python utilities.
   - For an architecture diagram, this should be drawn as a separate legacy branch rather than part of the active ROS 2 runtime.

11. **Hardware and protocol boundary**
   - `docs/ESP32_SERIAL_PROTOCOL.md` and the ESP32 bridge node indicate the physical controller interface is serial-based.
   - That makes the ESP32 a distinct runtime boundary between ROS 2 control/state messages and embedded actuator/sensor handling.
   - The mock serial and mock sensor nodes exist specifically to let the system run without the hardware attached.

12. **Overall data flow**
   - Typical flow is: description/simulation or hardware state feeds perception and twin sync; perception and twin state feed calibration; calibration produces corrections/model updates; evaluation measures outcomes; VR can subscribe to the same twin state for immersion/monitoring.
   - Launch files in each package assemble these pieces into scenario-specific stacks, while the shared message package keeps the subsystems loosely coupled.

Main entry points: [`software/arctos_jazzy_ws/src/arctos_bringup`](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_bringup) (Bringup), [`software/arctos_jazzy_ws/src/arctos_twin`](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_twin) (Twin), [`software/arctos_jazzy_ws/src/arctos_interfaces`](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_interfaces) (Interfaces), [`software/arctos_jazzy_ws/src/arctos_perception`](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_perception) (Perception)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_active_ros2["ROS 2 stack"]
  node_interfaces["Interfaces<br/>msg contracts"]
  node_bringup["Bringup<br/>deployment"]
  node_twin["Twin<br/>sync runtime"]
  node_perception["Perception<br/>apriltag pose"]
  node_calibration["Calibration<br/>estimation pipeline"]
  node_evaluation["Evaluation<br/>metrics pipeline"]
  node_description[("Description<br/>robot model")]
  node_vr["VR Bridge<br/>unity integration"]
  node_demo_scripts["Demo Scripts<br/>scenario scripts"]
  node_cal_mgr_launch["Cal Launch<br/>launch file"]
  node_cal_obs_launch["Obs Launch<br/>launch file"]
  node_april_launch["Perception Launch<br/>launch file"]
  node_twin_launch["Twin Launch<br/>launch file"]
  node_eval_launch["Eval Launch<br/>launch file"]
  node_unity_launch["VR Launch<br/>launch file"]
end

subgraph group_legacy_ros1["ROS 1 legacy"]
  node_ros1_config["ROS1 Config<br/>legacy config"]
  node_ros1_moveit["MoveIt<br/>legacy motion stack"]
  node_ros1_desc[("ROS1 Description<br/>legacy model")]
end

subgraph group_external["External boundary"]
  node_serial_doc["Serial Protocol<br/>hardware protocol"]
  node_esp32["ESP32 Bridge<br/>embedded boundary"]
  node_mock_hw["Mock Hardware<br/>sim boundary"]
  node_mock_perception["Mock Tags<br/>sim boundary"]
end

node_bringup -->|"uses messages"| node_interfaces
node_bringup -->|"starts sim/model"| node_description
node_bringup -->|"starts sync"| node_twin
node_bringup -->|"starts vision"| node_perception
node_bringup -->|"starts calibration"| node_calibration
node_bringup -->|"starts eval"| node_evaluation
node_cal_mgr_launch -->|"launches"| node_calibration
node_cal_obs_launch -->|"launches"| node_calibration
node_april_launch -->|"launches"| node_perception
node_twin_launch -->|"launches"| node_twin
node_eval_launch -->|"launches"| node_evaluation
node_unity_launch -->|"launches"| node_vr
node_perception -->|"publishes pose"| node_interfaces
node_twin -->|"publishes state"| node_interfaces
node_calibration -->|"reads/writes"| node_interfaces
node_evaluation -->|"measures state"| node_interfaces
node_vr -->|"subscribes state"| node_interfaces
node_esp32 -->|"implements"| node_serial_doc
node_twin -->|"serial link"| node_esp32
node_mock_hw -->|"simulates hardware"| node_twin
node_mock_perception -->|"simulates tags"| node_perception
node_description -->|"supports targets"| node_perception
node_description -->|"defines robot"| node_twin
node_description -->|"drives experiments"| node_evaluation
node_ros1_config -->|"configures"| node_ros1_moveit
node_ros1_desc -->|"supports"| node_ros1_config

click node_interfaces "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_interfaces"
click node_bringup "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_bringup"
click node_twin "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_twin"
click node_perception "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_perception"
click node_calibration "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_calibration"
click node_evaluation "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_evaluation"
click node_description "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_description"
click node_vr "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_vr"
click node_demo_scripts "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/scripts"
click node_cal_mgr_launch "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_calibration/launch/calibration_manager.launch.py"
click node_cal_obs_launch "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_calibration/launch/calibration_observer.launch.py"
click node_april_launch "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_perception/launch/perception.launch.py"
click node_twin_launch "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_twin/launch/twin_sync.launch.py"
click node_eval_launch "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_evaluation/launch/evaluation.launch.py"
click node_unity_launch "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_vr/launch/unity_bridge.launch.py"
click node_serial_doc "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/docs/ESP32_SERIAL_PROTOCOL.md"
click node_esp32 "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_twin/arctos_twin/esp32_bridge_node.py"
click node_mock_hw "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_twin/arctos_twin/mock_hardware_sensor_node.py"
click node_mock_perception "https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_perception/arctos_perception/mock_tag_pose_node.py"
click node_ros1_config "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_ros1_ws/src/arctos_ros/arctos_config"
click node_ros1_moveit "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_ros1_ws/src/arctos_ros/arctos_moveit"
click node_ros1_desc "https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_ros1_ws/src/arctos_ros/arctos_urdf_description"

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_interfaces,node_bringup,node_twin,node_perception,node_calibration,node_evaluation,node_description,node_vr,node_demo_scripts,node_cal_mgr_launch,node_cal_obs_launch,node_april_launch,node_twin_launch,node_eval_launch,node_unity_launch toneBlue
class node_ros1_config,node_ros1_moveit,node_ros1_desc toneAmber
class node_serial_doc,node_esp32,node_mock_hw,node_mock_perception toneMint
```

## Components

### ROS 2 stack

Active Jazzy workspace with calibration, twin, perception, and evaluation subsystems.

- [Interfaces](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_interfaces): msg contracts · Shared ROS message definitions that decouple the runtime subsystems. · `software/arctos_jazzy_ws/src/arctos_interfaces`
- [Bringup](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_bringup): deployment · ROS 2 composition and launch entry point for the active stack. · `software/arctos_jazzy_ws/src/arctos_bringup`
- [Twin](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_twin): sync runtime · Digital-twin synchronization, hardware bridging, and twin health monitoring. · `software/arctos_jazzy_ws/src/arctos_twin`
- [Perception](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_perception): apriltag pose · AprilTag pose estimation with simulation and mock inputs. · `software/arctos_jazzy_ws/src/arctos_perception`
- [Calibration](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_calibration): estimation pipeline · Observer, solver, correction, and application stages for calibration. · `software/arctos_jazzy_ws/src/arctos_calibration`
- [Evaluation](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_evaluation): metrics pipeline · Experiment execution, metrics computation, and result analysis. · `software/arctos_jazzy_ws/src/arctos_evaluation`
- [Description](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_description): robot model · URDF, meshes, controller config, RViz, and simulation worlds. · `software/arctos_jazzy_ws/src/arctos_description`
- [VR Bridge](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/src/arctos_vr): unity integration · Optional bridge to a Unity-based VR client. · `software/arctos_jazzy_ws/src/arctos_vr`
- [Demo Scripts](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_jazzy_ws/scripts): scenario scripts · Repeatable shell entry points for demo runs and checks. · `software/arctos_jazzy_ws/scripts`
- [Cal Launch](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_calibration/launch/calibration_manager.launch.py): launch file · Calibration manager launch composition. · `software/arctos_jazzy_ws/src/arctos_calibration/launch/calibration_manager.launch.py`
- [Obs Launch](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_calibration/launch/calibration_observer.launch.py): launch file · Calibration observer launch composition. · `software/arctos_jazzy_ws/src/arctos_calibration/launch/calibration_observer.launch.py`
- [Perception Launch](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_perception/launch/perception.launch.py): launch file · AprilTag perception and simulation launch entry points. · `software/arctos_jazzy_ws/src/arctos_perception/launch/perception.launch.py`
- [Twin Launch](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_twin/launch/twin_sync.launch.py): launch file · Twin sync, monitor, and demo launch entry points. · `software/arctos_jazzy_ws/src/arctos_twin/launch/twin_sync.launch.py`
- [Eval Launch](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_evaluation/launch/evaluation.launch.py): launch file · Evaluation stack launch entry point. · `software/arctos_jazzy_ws/src/arctos_evaluation/launch/evaluation.launch.py`
- [VR Launch](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_vr/launch/unity_bridge.launch.py): launch file · Unity bridge launch entry point. · `software/arctos_jazzy_ws/src/arctos_vr/launch/unity_bridge.launch.py`

### ROS 1 legacy

Reference workspace kept for older MoveIt and URDF integration.

- [ROS1 Config](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_ros1_ws/src/arctos_ros/arctos_config): legacy config · Legacy MoveIt configuration and launch set. · `software/arctos_ros1_ws/src/arctos_ros/arctos_config`
- [MoveIt](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_ros1_ws/src/arctos_ros/arctos_moveit): legacy motion stack · Older motion-planning and helper code for the arm. · `software/arctos_ros1_ws/src/arctos_ros/arctos_moveit`
- [ROS1 Description](https://github.com/ajzu2001/immersive-calibration-framework/tree/main/software/arctos_ros1_ws/src/arctos_ros/arctos_urdf_description): legacy model · Legacy URDF and Gazebo robot description assets. · `software/arctos_ros1_ws/src/arctos_ros/arctos_urdf_description`

### External boundary

Hardware, protocol, and operator-facing integration surfaces.

- [Serial Protocol](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/docs/ESP32_SERIAL_PROTOCOL.md): hardware protocol · ESP32 serial protocol boundary documentation. · `docs/ESP32_SERIAL_PROTOCOL.md`
- [ESP32 Bridge](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_twin/arctos_twin/esp32_bridge_node.py): embedded boundary · ROS-side serial bridge to the embedded controller. · `software/arctos_jazzy_ws/src/arctos_twin/arctos_twin/esp32_bridge_node.py`
- [Mock Hardware](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_twin/arctos_twin/mock_hardware_sensor_node.py): sim boundary · Mock sensor and packet nodes for hardware-free runs. · `software/arctos_jazzy_ws/src/arctos_twin/arctos_twin/mock_hardware_sensor_node.py`
- [Mock Tags](https://github.com/ajzu2001/immersive-calibration-framework/blob/main/software/arctos_jazzy_ws/src/arctos_perception/arctos_perception/mock_tag_pose_node.py): sim boundary · Synthetic and mock AprilTag pose sources. · `software/arctos_jazzy_ws/src/arctos_perception/arctos_perception/mock_tag_pose_node.py`

## Connections

- Bringup → Interfaces: uses messages · Launch composition depends on the shared message contract layer.
- Bringup → Description: starts sim/model · Deploys the robot model and simulation substrate.
- Bringup → Twin: starts sync · Composes the twin runtime into the active stack.
- Bringup → Perception: starts vision · Composes perception nodes for pose estimation.
- Bringup → Calibration: starts calibration · Launches the calibration workflow components.
- Bringup → Evaluation: starts eval · Includes experiment and metrics components when needed.
- Cal Launch → Calibration: launches · Manager launch wires up the calibration pipeline.
- Obs Launch → Calibration: launches · Observer launch starts the observation stage.
- Perception Launch → Perception: launches · Perception launch starts AprilTag pose sources.
- Twin Launch → Twin: launches · Twin launch starts synchronization and monitoring nodes.
- Eval Launch → Evaluation: launches · Evaluation launch starts experiment and metrics nodes.
- VR Launch → VR Bridge: launches · VR launch starts the Unity bridge.
- Perception → Interfaces: publishes pose · Perception emits pose and quality state through shared messages.
- Twin → Interfaces: publishes state · Twin runtime publishes joint and twin state messages.
- Calibration → Interfaces: reads/writes · Calibration consumes observations and emits model/result messages.
- Evaluation → Interfaces: measures state · Evaluation consumes runtime outputs for scoring and analysis.
- VR Bridge → Interfaces: subscribes state · VR bridge consumes twin state for visualization and interaction.
- ESP32 Bridge → Serial Protocol: implements · Bridge node realizes the documented serial protocol boundary.
- Twin → ESP32 Bridge: serial link · Twin runtime exchanges commands and observations with the embedded controller.
- Mock Hardware → Twin: simulates hardware · Mock hardware provides a stand-in for the physical controller path.
- Mock Tags → Perception: simulates tags · Mock tag sources emulate perception inputs.
- Description → Perception: supports targets · Robot/world assets provide the visual and geometric basis for tag detection.
- Description → Twin: defines robot · Robot description underpins simulated and physical synchronization.
- Description → Evaluation: drives experiments · Simulation assets support repeatable experiment runs.
- ROS1 Config → MoveIt: configures · Legacy MoveIt stack is parameterized by ROS 1 config and launch assets.
- ROS1 Description → ROS1 Config: supports · Legacy robot description feeds the older planning stack.
