How rzr/twins works
TWINS is a proof-of-concept digital twin for a robot: clients set joint properties through a WebThing server, which selects simulated or board-backed behavior; an A-Frame page visualizes the twin. The graph includes both runtime branches and the documented visualization and gateway usage. Links to the A-Frame page and gateway are documented at a high level; unsampled page wiring is not inferred beyond that.
Main entry points: index.js Runtime selector · lib/index.js Robot WebThing · index.html Visualization page · simulator/index.js Simulator server
Components 12
Runtime and API
- Runtime selector
index.js - Simulator server
lib/simulator/index.js - Robot WebThing
lib/index.js - WebThing service
Actuation
- PWM property
lib/pwm-property.js - PWM device
Visualization
- A-Frame robot
aframe/index.js - Visualization page
aframe/index.html
Board deployment
- NuttX launcher
extra/nuttx/index.js - Board configuration
extra/nuttx/configs/nucleo-144/f767-twins/defconfig
Other components
- API client
- WebThing Gateway
Connections 13
- API client → Runtime selector: starts
README.md - Runtime selector → Simulator server: selects simulation
index.js - Runtime selector → Robot WebThing: selects board
index.js - Simulator server → WebThing service: starts server
lib/simulator/index.js - Robot WebThing → WebThing service: starts server
lib/index.js - Robot WebThing → PWM property: creates properties
lib/index.js - PWM property → PWM device: sets duty cycle
lib/pwm-property.js - API client → WebThing service: sets properties
README.md - Visualization page → A-Frame robot: renders robot
README.md - WebThing service → Visualization page: visualizes twin
README.md - WebThing Gateway → Visualization page: provides gateway view
README.md - NuttX launcher → Runtime selector: starts app
extra/nuttx/index.js - Board configuration → Robot WebThing: configures board