# lemon-cmyk/teleop-with-distribute architecture

> Architecture diagram of the GitHub repository lemon-cmyk/teleop-with-distribute, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lemon-cmyk/teleop-with-distribute
- Repository: https://github.com/lemon-cmyk/teleop-with-distribute

## Overview

XRoboToolkit-Teleop-Sample-Python is a Python teleoperation framework for driving simulated and physical robots from XR devices. The principal workflow reads XR poses and controls, transforms them into end-effector targets, solves robot kinematics, and sends commands to a simulator or hardware interface. Hardware sessions can also capture robot state, XR input, and camera frames for logged datasets. The README documents several robot and hand demonstrations; source excerpts are partial, so links between components are included only where the README or source index supports them.

Main entry points: [`xrobotoolkit_teleop/common/base_teleop_controller.py`](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/base_teleop_controller.py) (Kinematics controller), [`xrobotoolkit_teleop/common/base_hardware_teleop_controller.py`](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/base_hardware_teleop_controller.py) (Hardware controller base), [`xrobotoolkit_teleop/hardware/interface`](https://github.com/lemon-cmyk/teleop-with-distribute/tree/dev2/xrobotoolkit_teleop/hardware/interface) (Robot interfaces), [`xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py`](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py) (Tiangong dual-arm)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_xr_control["XR control"]
  node_xr_client["XR input client<br/>[xr_client.py]"]
end

subgraph group_shared_runtime["Shared runtime"]
  node_teleop_base["Kinematics controller"]
  node_hardware_base["Hardware controller base"]
  node_geometry["Pose geometry<br/>[geometry.py]"]
  node_dex_hand["Dexterous hand support<br/>[dex_hand_utils.py]"]
end

subgraph group_simulation["Simulation"]
  node_mujoco["MuJoCo controller"]
  node_placo["Placo controller"]
  node_sim_scripts["Robot demos"]
end

subgraph group_hardware["Robot hardware"]
  node_ur_controller["Dual UR control"]
  node_arx_controller["ARX R5 control"]
  node_galaxea_controller["Galaxea control"]
  node_tiangong_controller["Tiangong dual-arm"]
  node_robot_interfaces["Robot interfaces"]
  node_tiangong_transport["Tiangong transport"]
  node_robot_config["Tiangong configuration<br/>[tiangong_config.py]"]
  node_head_controller["Dynamixel head"]
end

subgraph group_capture["Session capture"]
  node_logger["Session logger<br/>[data_logger.py]"]
  node_camera["Camera interfaces<br/>[base_camera.py]"]
  node_episode_client["Episode client"]
  node_data_files[("Teleoperation logs")]
end

node_operator(("XR operator"))
node_xr_service["XR PC service"]
node_simulator["MuJoCo / Placo"]

node_operator -->|"moves and gestures"| node_xr_service
node_xr_service -->|"provides XR input"| node_xr_client
node_xr_client -->|"supplies poses"| node_teleop_base
node_teleop_base -->|"transforms poses"| node_geometry
node_teleop_base -->|"records session"| node_logger
node_hardware_base -->|"extends"| node_teleop_base
node_hardware_base -->|"reads frames"| node_camera
node_mujoco -->|"reuses control"| node_teleop_base
node_placo -->|"reuses control"| node_teleop_base
node_sim_scripts -->|"starts demo"| node_mujoco
node_sim_scripts -->|"starts demo"| node_placo
node_mujoco -->|"controls model"| node_simulator
node_placo -->|"visualizes robot"| node_simulator
node_ur_controller -->|"reads controls"| node_xr_client
node_ur_controller -->|"commands arms"| node_robot_interfaces
node_arx_controller -->|"extends"| node_hardware_base
node_arx_controller -->|"uses ARX interface"| node_robot_interfaces
node_galaxea_controller -->|"extends"| node_hardware_base
node_galaxea_controller -->|"uses ROS interface"| node_robot_interfaces
node_tiangong_controller -->|"extends"| node_hardware_base
node_tiangong_controller -->|"sends commands"| node_tiangong_transport
node_tiangong_controller -->|"loads settings"| node_robot_config
node_tiangong_controller -->|"uses episodes"| node_episode_client
node_tiangong_transport -.->|"communicates with robot"| node_robot_interfaces
node_camera -->|"provides imagery"| node_logger
node_logger -->|"writes sessions"| node_data_files
node_episode_client -.->|"stores episodes"| node_data_files
node_head_controller -->|"reads controls"| node_xr_client
node_head_controller -->|"controls head"| node_robot_interfaces
node_dex_hand -.->|"supports hand demos"| node_simulator

click node_xr_client "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/xr_client.py"
click node_teleop_base "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/base_teleop_controller.py"
click node_hardware_base "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/base_hardware_teleop_controller.py"
click node_geometry "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/utils/geometry.py"
click node_logger "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/data_logger.py"
click node_mujoco "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/simulation/mujoco_teleop_controller.py"
click node_placo "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/simulation/placo_teleop_controller.py"
click node_sim_scripts "https://github.com/lemon-cmyk/teleop-with-distribute/tree/dev2/scripts/simulation"
click node_ur_controller "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/dual_arm_ur_controller.py"
click node_arx_controller "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/arx_r5_teleop_controller.py"
click node_galaxea_controller "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/galaxea_r1_lite_teleop_controller.py"
click node_tiangong_controller "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py"
click node_robot_interfaces "https://github.com/lemon-cmyk/teleop-with-distribute/tree/dev2/xrobotoolkit_teleop/hardware/interface"
click node_tiangong_transport "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/interface/tiangong_optimized_compat.py"
click node_robot_config "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/config/tiangong_config.py"
click node_camera "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/interface/base_camera.py"
click node_episode_client "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/tiangong_episode_client.py"
click node_head_controller "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/dynamixel_head_controller.py"
click node_dex_hand "https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/utils/dex_hand_utils.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_xr_client toneBlue
class node_teleop_base,node_hardware_base,node_geometry,node_dex_hand toneAmber
class node_mujoco,node_placo,node_sim_scripts toneMint
class node_ur_controller,node_arx_controller,node_galaxea_controller,node_tiangong_controller,node_robot_interfaces,node_tiangong_transport,node_robot_config,node_head_controller toneRose
class node_logger,node_camera,node_episode_client,node_data_files,node_operator,node_xr_service,node_simulator toneIndigo
```

## Components

### XR control

- [XR input client](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/xr_client.py): `xrobotoolkit_teleop/common/xr_client.py`

### Shared runtime

- [Kinematics controller](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/base_teleop_controller.py): `xrobotoolkit_teleop/common/base_teleop_controller.py`
- [Hardware controller base](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/base_hardware_teleop_controller.py): `xrobotoolkit_teleop/common/base_hardware_teleop_controller.py`
- [Pose geometry](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/utils/geometry.py): `xrobotoolkit_teleop/utils/geometry.py`
- [Dexterous hand support](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/utils/dex_hand_utils.py): `xrobotoolkit_teleop/utils/dex_hand_utils.py`

### Simulation

- [MuJoCo controller](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/simulation/mujoco_teleop_controller.py): `xrobotoolkit_teleop/simulation/mujoco_teleop_controller.py`
- [Placo controller](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/simulation/placo_teleop_controller.py): `xrobotoolkit_teleop/simulation/placo_teleop_controller.py`
- [Robot demos](https://github.com/lemon-cmyk/teleop-with-distribute/tree/dev2/scripts/simulation): `scripts/simulation`

### Robot hardware

- [Dual UR control](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/dual_arm_ur_controller.py): `xrobotoolkit_teleop/hardware/dual_arm_ur_controller.py`
- [ARX R5 control](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/arx_r5_teleop_controller.py): `xrobotoolkit_teleop/hardware/arx_r5_teleop_controller.py`
- [Galaxea control](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/galaxea_r1_lite_teleop_controller.py): `xrobotoolkit_teleop/hardware/galaxea_r1_lite_teleop_controller.py`
- [Tiangong dual-arm](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py): `xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py`
- [Robot interfaces](https://github.com/lemon-cmyk/teleop-with-distribute/tree/dev2/xrobotoolkit_teleop/hardware/interface): `xrobotoolkit_teleop/hardware/interface`
- [Tiangong transport](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/interface/tiangong_optimized_compat.py): `xrobotoolkit_teleop/hardware/interface/tiangong_optimized_compat.py`
- [Tiangong configuration](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/config/tiangong_config.py): `xrobotoolkit_teleop/hardware/config/tiangong_config.py`
- [Dynamixel head](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/dynamixel_head_controller.py): `xrobotoolkit_teleop/hardware/dynamixel_head_controller.py`

### Session capture

- [Session logger](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/common/data_logger.py): `xrobotoolkit_teleop/common/data_logger.py`
- [Camera interfaces](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/interface/base_camera.py): `xrobotoolkit_teleop/hardware/interface/base_camera.py`
- [Episode client](https://github.com/lemon-cmyk/teleop-with-distribute/blob/dev2/xrobotoolkit_teleop/hardware/tiangong_episode_client.py): `xrobotoolkit_teleop/hardware/tiangong_episode_client.py`
- **Teleoperation logs**

### Other components

- **XR operator**
- **XR PC service**
- **MuJoCo / Placo**

## Connections

- XR operator → XR PC service: moves and gestures
- XR PC service → XR input client: provides XR input
- XR input client → Kinematics controller: supplies poses (evidence: `xrobotoolkit_teleop/common/base_teleop_controller.py`)
- Kinematics controller → Pose geometry: transforms poses (evidence: `xrobotoolkit_teleop/common/base_teleop_controller.py`)
- Kinematics controller → Session logger: records session (evidence: `xrobotoolkit_teleop/common/base_teleop_controller.py`)
- Hardware controller base → Kinematics controller: extends (evidence: `xrobotoolkit_teleop/common/base_hardware_teleop_controller.py`)
- Hardware controller base → Camera interfaces: reads frames (evidence: `xrobotoolkit_teleop/common/base_hardware_teleop_controller.py`)
- MuJoCo controller → Kinematics controller: reuses control (evidence: `xrobotoolkit_teleop/simulation/mujoco_teleop_controller.py`)
- Placo controller → Kinematics controller: reuses control (evidence: `xrobotoolkit_teleop/simulation/placo_teleop_controller.py`)
- Robot demos → MuJoCo controller: starts demo
- Robot demos → Placo controller: starts demo
- MuJoCo controller → MuJoCo / Placo: controls model
- Placo controller → MuJoCo / Placo: visualizes robot
- Dual UR control → XR input client: reads controls (evidence: `xrobotoolkit_teleop/hardware/dual_arm_ur_controller.py`)
- Dual UR control → Robot interfaces: commands arms (evidence: `xrobotoolkit_teleop/hardware/dual_arm_ur_controller.py`)
- ARX R5 control → Hardware controller base: extends (evidence: `xrobotoolkit_teleop/hardware/arx_r5_teleop_controller.py`)
- ARX R5 control → Robot interfaces: uses ARX interface (evidence: `xrobotoolkit_teleop/hardware/arx_r5_teleop_controller.py`)
- Galaxea control → Hardware controller base: extends (evidence: `xrobotoolkit_teleop/hardware/galaxea_r1_lite_teleop_controller.py`)
- Galaxea control → Robot interfaces: uses ROS interface (evidence: `xrobotoolkit_teleop/hardware/galaxea_r1_lite_teleop_controller.py`)
- Tiangong dual-arm → Hardware controller base: extends (evidence: `xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py`)
- Tiangong dual-arm → Tiangong transport: sends commands (evidence: `xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py`)
- Tiangong dual-arm → Tiangong configuration: loads settings (evidence: `xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py`)
- Tiangong dual-arm → Episode client: uses episodes (evidence: `xrobotoolkit_teleop/hardware/tiangong_dual_arm_teleop_controller_camera_stale_fixed.py`)
- Tiangong transport → Robot interfaces: communicates with robot
- Camera interfaces → Session logger: provides imagery
- Session logger → Teleoperation logs: writes sessions
- Episode client → Teleoperation logs: stores episodes
- Dynamixel head → XR input client: reads controls (evidence: `xrobotoolkit_teleop/hardware/dynamixel_head_controller.py`)
- Dynamixel head → Robot interfaces: controls head (evidence: `xrobotoolkit_teleop/hardware/dynamixel_head_controller.py`)
- Dexterous hand support → MuJoCo / Placo: supports hand demos
