# pthread-t/multi-vendor-can-robot-arm architecture

> Architecture diagram of the GitHub repository pthread-t/multi-vendor-can-robot-arm, 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/pthread-t/multi-vendor-can-robot-arm
- Repository: https://github.com/pthread-t/multi-vendor-can-robot-arm

## Overview

This is a PySide6 desktop control platform for multi-vendor CAN robot arms. The operator configures a runtime, views robot state, then issues joint or Cartesian targets and planned trajectories; the controller coordinates kinematics, execution and safety while a unified driver translates joint semantics into vendor protocols and CAN transport. Separate UI branches provide 3D visualization, history and diagnostics. The README documents mock, loopback and PCAN modes, four protocol families, and configuration hot-apply. Some wiring is inferred from documented architecture because source excerpts are partial.

Main entry points: [`app/controllers/robot_controller.py`](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/controllers/robot_controller.py) (Robot controller), [`app/ui/main_window.py`](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/main_window.py) (Main window), [`app/main.py`](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/main.py) (App startup), [`app/drivers/can_joint_driver.py`](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/drivers/can_joint_driver.py) (Joint driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Operator interface"]
  node_window["Main window<br/>[main_window.py]"]
  node_joint_ui["Joint controls"]
  node_cart_ui["Cartesian controls"]
  node_plan_ui["Trajectory controls"]
  node_diag_ui["Diagnostics"]
  node_history["State history"]
  node_viewer["3D viewer<br/>[viewer_3d.py]"]
end

subgraph group_control["Robot control"]
  node_controller["Robot controller"]
  node_robot["Robot state<br/>[robot_arm.py]"]
  node_sim["Simulator<br/>[simulator.py]"]
end

subgraph group_motion["Motion computation"]
  node_fk["Forward kinematics<br/>[fk.py]"]
  node_ik["Inverse kinematics<br/>[ik.py]"]
  node_planner["Trajectory planner<br/>[planner.py]"]
end

subgraph group_hardware["CAN execution"]
  node_driver["Joint driver"]
  node_protocols["Protocol adapters"]
  node_transport["CAN transports"]
end

subgraph group_runtime["Runtime setup"]
  node_entry["App startup<br/>[main.py]"]
  node_config["Runtime config<br/>[runtime_factory.py]"]
end

node_operator(("Operator"))
node_can_device(("CAN hardware"))

node_operator -->|"uses"| node_window
node_entry -->|"loads"| node_config
node_entry -->|"creates"| node_controller
node_entry -->|"opens"| node_window
node_window -->|"hosts"| node_joint_ui
node_window -->|"hosts"| node_cart_ui
node_window -->|"hosts"| node_plan_ui
node_window -->|"hosts"| node_diag_ui
node_window -->|"updates"| node_history
node_window -->|"updates"| node_viewer
node_joint_ui -->|"sends targets"| node_controller
node_cart_ui -->|"sends poses"| node_controller
node_plan_ui -->|"requests paths"| node_controller
node_controller -->|"solves poses"| node_ik
node_controller -->|"plans motion"| node_planner
node_controller -->|"computes pose"| node_fk
node_controller -->|"updates state"| node_robot
node_controller -.->|"runs simulation"| node_sim
node_controller -->|"dispatches targets"| node_driver
node_driver -->|"encodes commands"| node_protocols
node_driver -->|"sends frames"| node_transport
node_transport -.->|"exchanges frames"| node_can_device
node_controller -->|"provides logs"| node_diag_ui
node_controller -->|"provides samples"| node_history
node_controller -->|"provides pose"| node_viewer

click node_entry "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/main.py"
click node_config "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/runtime/runtime_factory.py"
click node_window "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/main_window.py"
click node_joint_ui "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/joint_control_page.py"
click node_cart_ui "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/cartesian_control_page.py"
click node_plan_ui "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/trajectory_planning_page.py"
click node_diag_ui "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/diagnostics_page.py"
click node_history "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/widgets/joint_history_plot.py"
click node_viewer "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/visualization/viewer_3d.py"
click node_controller "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/controllers/robot_controller.py"
click node_robot "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/robot/robot_arm.py"
click node_sim "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/simulation/simulator.py"
click node_fk "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/kinematics/fk.py"
click node_ik "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/kinematics/ik.py"
click node_planner "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/planning/planner.py"
click node_driver "https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/drivers/can_joint_driver.py"
click node_protocols "https://github.com/pthread-t/multi-vendor-can-robot-arm/tree/main/app/drivers/protocols"
click node_transport "https://github.com/pthread-t/multi-vendor-can-robot-arm/tree/main/app/transport"

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_window,node_joint_ui,node_cart_ui,node_plan_ui,node_diag_ui,node_history,node_viewer toneBlue
class node_controller,node_robot,node_sim toneAmber
class node_fk,node_ik,node_planner toneMint
class node_driver,node_protocols,node_transport toneRose
class node_entry,node_config,node_operator,node_can_device toneIndigo
```

## Components

### Operator interface

- [Main window](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [Joint controls](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/joint_control_page.py): `app/ui/pages/joint_control_page.py`
- [Cartesian controls](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/cartesian_control_page.py): `app/ui/pages/cartesian_control_page.py`
- [Trajectory controls](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/trajectory_planning_page.py): `app/ui/pages/trajectory_planning_page.py`
- [Diagnostics](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/pages/diagnostics_page.py): `app/ui/pages/diagnostics_page.py`
- [State history](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/ui/widgets/joint_history_plot.py): `app/ui/widgets/joint_history_plot.py`
- [3D viewer](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/visualization/viewer_3d.py): `app/visualization/viewer_3d.py`

### Robot control

- [Robot controller](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/controllers/robot_controller.py): `app/controllers/robot_controller.py`
- [Robot state](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/robot/robot_arm.py): `app/robot/robot_arm.py`
- [Simulator](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/simulation/simulator.py): `app/simulation/simulator.py`

### Motion computation

- [Forward kinematics](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/kinematics/fk.py): `app/kinematics/fk.py`
- [Inverse kinematics](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/kinematics/ik.py): `app/kinematics/ik.py`
- [Trajectory planner](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/planning/planner.py): `app/planning/planner.py`

### CAN execution

- [Joint driver](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/drivers/can_joint_driver.py): `app/drivers/can_joint_driver.py`
- [Protocol adapters](https://github.com/pthread-t/multi-vendor-can-robot-arm/tree/main/app/drivers/protocols): `app/drivers/protocols`
- [CAN transports](https://github.com/pthread-t/multi-vendor-can-robot-arm/tree/main/app/transport): `app/transport`

### Runtime setup

- [App startup](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/main.py): `app/main.py`
- [Runtime config](https://github.com/pthread-t/multi-vendor-can-robot-arm/blob/main/app/runtime/runtime_factory.py): `app/runtime/runtime_factory.py`

### Other components

- **Operator**
- **CAN hardware**

## Connections

- Operator → Main window: uses
- App startup → Runtime config: loads
- App startup → Robot controller: creates
- App startup → Main window: opens
- Main window → Joint controls: hosts
- Main window → Cartesian controls: hosts
- Main window → Trajectory controls: hosts
- Main window → Diagnostics: hosts
- Main window → State history: updates
- Main window → 3D viewer: updates
- Joint controls → Robot controller: sends targets
- Cartesian controls → Robot controller: sends poses
- Trajectory controls → Robot controller: requests paths
- Robot controller → Inverse kinematics: solves poses
- Robot controller → Trajectory planner: plans motion
- Robot controller → Forward kinematics: computes pose
- Robot controller → Robot state: updates state
- Robot controller → Simulator: runs simulation
- Robot controller → Joint driver: dispatches targets
- Joint driver → Protocol adapters: encodes commands
- Joint driver → CAN transports: sends frames
- CAN transports → CAN hardware: exchanges frames
- Robot controller → Diagnostics: provides logs
- Robot controller → State history: provides samples
- Robot controller → 3D viewer: provides pose
