Skip to content

Latest commit

Β 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Robodimm

Interactive Robot Trajectory Programming, Rigid-Body Dynamics, and Deterministic Actuator Sizing β€” in your browser.

πŸš€ Live demo: https://customrobotics.es No installation required β€” runs entirely in the browser.


Robodimm is a web-based environment for designing and validating the mechanical sizing of industrial robots. It provides a real-time 3D visualiser (Three.js), a client-side kinematic and approximate-dynamic solver, and an optional Python backend that runs Pinocchio 4 for high-fidelity inverse dynamics. The actuator-sizer is passive, deterministic, and reproducible β€” given a TorqueLog and a catalog, it returns the same best candidate every time.

The environment supports two robot families only:

  1. CR6 β€” 6-DoF serial articulated arm, IRB 4600-class, with decoupling spherical wrist. Standard DH + RNEA solver.
  2. CR4 β€” 4-DoF parallel palletizer, IRB 460-class, with a parallelogram linkage. Closed-chain KKT solver on a Pinocchio cut tree.

Presentation Video

A short walkthrough of the full workflow β€” parametric editor, jog, program, signal recording, and deterministic actuator sizing.

Robodimm workflow demo

The full-length MP4 is available for download at docs/video_robodimm.mp4.


Key Features

Frontend (browser, React 18 + Three.js + Zustand)

  • Real-time 3D viewer. Z-up world frame, slate-dark background, CAD-aligned axes, COM markers, trajectory path, optional world grid. CAD-authored GLB/GLTF and STL meshes are loaded on demand; primitive geometry is the safe fallback.
  • Two robot families. Switch between CR6 and CR4 with full geometry, inertia, and limit editors. The CR4 editor enforces the parallelogram closure $P = B + C - O$ and $E = D + C - O$ in real time.
  • Jogging panel. Joint-space sliders and Cartesian XYZ+yaw jog relative to either the World or TCP frame. Continuous mouse-hold jogging.
  • Duty-cycle sequencer. MoveJ, MoveL, and Pause instructions with named targets. MoveL is the legacy label for a joint-space quintic path with a TCP endpoint-distance timing floor, not a Cartesian straight line. JSON / YAML program import-export.
  • Deterministic actuator sizing. Six hard pass/fail constraints (continuous output torque, configurable generic peak assumption, max speed, gearbox continuous, gearbox intermittent, gearbox input speed) and four ranking objectives (min_mass, min_power, min_gearbox, max_margin). The output is preliminary design support, not procurement validation. Full audit manifest: robodimm.actuator_sizing_report.v2.
  • Station objects. Drop GLB environment meshes (tables, fences, fixtures) into the world frame without affecting the kinematic tree; the loader is a cancellable reconciler that prevents WebGL leaks.

Backend (Python, FastAPI + Pinocchio 4)

  • CR4 closed-chain KKT. A cut tree is built with pin.JointModelRY/RZ bodies for all ten links and three pin.RigidConstraintModel 3D contact constraints close the loops. Lagrange multipliers are recovered by lstsq of the passive-joint columns of $J_c^\top$.
  • CR6 Newton–Euler. A direct call to pin.rnea on the six-DoF serial chain, with CAD-frame β†’ link-frame inertial conversion when the user spec is provided in CAD coordinates.
  • Pinocchio model cache. SHA-256 keyed on the canonical json.dumps(robot, sort_keys=True). Cold start ~30 s; subsequent calls are sub-millisecond on cached models.
  • Viscous friction model. A scalar $b_i,\dot q_i$ term per joint, configured by frictionCoeffNmSPerRad on the joint limit. Omitted values default to zero. The E2E-VM05-v1 benchmark uses 0.5 N m/(rad/s) on every tested joint; the separate REG-ZD-v1 mathematical regression uses exactly zero damping.
  • Cross-software verification against Simscape. For the archived E2E-VM05-v1 application regression (0.5 damping), PRO-vs-Simscape total RMSE is 0.244639 Nm for CR4 and approximately 1.15 Γ— 10⁻¹² Nm for CR6. The complete archived workflow also reports CR6 DEMO-vs-Simscape RMSE of 0.001427 Nm under E2E-VM05-v1. Fresh REG-ZD-v1 evidence generated from application commit d4736c9 (zero damping) reports PRO-vs-Simscape totals of 0.0482381 Nm for CR4 and 1.15198 Γ— 10⁻¹² Nm for CR6. See the validation document for engine-pair, archive, and geometry qualifications.

Technology Stack

Layer Technologies
Frontend React 18, TypeScript ~5.6, Vite 8.2, Three.js 0.184, Zustand 5, Tailwind CSS 3 (via PostCSS), Lucide-React, Recharts
Frontend tests Vitest 4.1
Backend Python 3.9–3.10, FastAPI β‰₯ 0.100, Uvicorn, Pydantic β‰₯ 2.0
Dynamics Pinocchio 4.0.0 (Conda), NumPy β‰₯ 1.22, SciPy β‰₯ 1.8
Packaging Docker / Docker Compose, nginx 1.27
Cross-software reference MATLAB R2026a, Simulink, Simscape Multibodyβ„’

Quick Links

Document What it covers
🏁 docs/getting_started.md Prerequisites, install, DEMO and PRO modes, Docker, env vars, five-minute walkthrough, how to run the test suite
πŸ“ docs/math_foundations.md DH convention, CR4 hardpoint invariants, the cut-tree mapping, the KKT matrix system, the closed-loop J4 sign convention, viscous friction model, trajectory blending
πŸ”Œ docs/api_reference.md Every FastAPI endpoint, full JSON request/response payloads, the SHA-256 model cache, the trajectory hash, the CORS allowlist
🎨 docs/frontend_guide.md Zustand store slices, Three.js scene factory, the CAD-aligned frame helper, the GLB station-object reconciler, the cancellable loader
βš™οΈ docs/sizing_methodology.md The six pass/fail constraints (with formulas), per-candidate margin metrics, the four ranking objectives, a worked example
πŸ§ͺ docs/validation_benchmarks.md Simscape comparison methodology, protocol-specific E2E-VM05-v1 and REG-ZD-v1 RMSE tables, and reproduction commands

Quick Start (60 seconds)

DEMO mode (browser only, no Python)

npm install
npm run dev          # β†’ http://localhost:5173

The full feature set works in DEMO mode: parametric editor, jog, program editor, signal recording, and actuator sizing. The approximate CR4 dynamics in the browser are not as accurate as the PRO backend's KKT solver, but they are sufficient for design exploration.

PRO mode (with Pinocchio)

# Backend (one-time setup + launch)
./releases/setup_backend.sh

# Frontend (in another terminal)
npm run dev

The header engine switcher lights the PRO (Python API) pill in green when the backend advertises both CR4.closed_chain_kkt = true and CR6.serial_rnea = true. The first PRO batch is slow (~30 s cold start); subsequent calls are sub-millisecond thanks to the SHA-256-keyed Pinocchio model cache.

Docker

ACTUATOR_CATALOG_SHA256=$(sha256sum public/actuators_library.json | cut -d' ' -f1) \
ROBODIMM_SOURCE_COMMIT=$(git rev-parse HEAD) docker compose up --build
docker build --build-arg ROBODIMM_SOURCE_COMMIT=$(git rev-parse HEAD) \
  --build-arg ACTUATOR_CATALOG_SHA256=$(sha256sum public/actuators_library.json | cut -d' ' -f1) \
  -t robodimm/frontend .
docker build -f Dockerfile.backend -t robodimm/backend-pro .
docker run -e ROBODIMM_SOURCE_COMMIT=$(git rev-parse HEAD) \
  -p 127.0.0.1:8001:8001 robodimm/backend-pro

Running Tests

# Frontend (Vitest)
npx vitest run
npx vitest run -t "CR4"                    # name filter
npx vitest run src/math/actuators.test.ts  # single file

# Backend (regression vs Simscape)
mamba run -n robodimm-pro-backend python -m unittest \
  backend.test_cr4_kkt_diagnostics backend.test_trajectory_semantics -v
mamba run -n robodimm-pro-backend python backend/test_cr4_fd_sensitivity.py
mamba run -n robodimm-pro-backend python backend/test_regression.py \
  --protocol E2E-VM05-v1
mamba run -n robodimm-pro-backend python backend/test_regression.py \
  --protocol REG-ZD-v1

The Python regression script is not collected by pytest β€” it is invoked directly because it loads the Simscape CSVs and reproducibility manifests from the sibling paper repository. E2E-VM05-v1 reads the archived experiments/archive/submitted-validation-f33a676/E2E-VM05-v1/ tree and retains 0.5 damping; REG-ZD-v1 reads the fresh experiments/regression/REG-ZD-v1/ tree and applies zero damping. Missing inputs fail rather than being reported as a successful skip.


Repository Layout

robodimm/
β”œβ”€β”€ README.md                    ← this file (the portal)
β”œβ”€β”€ AGENTS.md                    ← agent quick-start (commands, gotchas)
β”œβ”€β”€ docs/                        ← SoftwareX-grade technical documentation
β”‚   β”œβ”€β”€ getting_started.md
β”‚   β”œβ”€β”€ math_foundations.md
β”‚   β”œβ”€β”€ api_reference.md
β”‚   β”œβ”€β”€ frontend_guide.md
β”‚   β”œβ”€β”€ sizing_methodology.md
β”‚   └── validation_benchmarks.md
β”œβ”€β”€ src/                         ← React + Three.js frontend
β”‚   β”œβ”€β”€ main.tsx, App.tsx
β”‚   β”œβ”€β”€ api/backend.ts           ← PRO fetch wrappers (800 ms / 120 s timeouts)
β”‚   β”œβ”€β”€ math/                    ← pure-TS FK/IK/dynamics/sizing
β”‚   β”œβ”€β”€ model/                   ← Zustand store + schemas
β”‚   β”œβ”€β”€ ui/                      ← Editor, Jog, Program, Sizing tabs
β”‚   └── viewer/                  ← Three.js scene, meshLoaders, reconciler
β”œβ”€β”€ backend/                     ← FastAPI + Pinocchio PRO backend
β”‚   β”œβ”€β”€ main.py                  ← CORS, PNA preflight, /api/packages/static
β”‚   β”œβ”€β”€ api/                     ← health, dynamics, packages routers
β”‚   β”œβ”€β”€ dynamics/                ← cr4_kkt, cr6_serial, schemas, validation
β”‚   └── test_regression.py       ← stand-alone Simscape regression
β”œβ”€β”€ public/
β”‚   └── actuators_library.json   ← static catalog served by nginx
β”œβ”€β”€ packages/                    ← local robot packages (robot.json + meshes)
β”œβ”€β”€ releases/                    ← setup_backend.sh / .bat
β”œβ”€β”€ Dockerfile, Dockerfile.backend, docker-compose.yml
β”œβ”€β”€ environment.yml              ← conda env 'robodimm-pro-backend'
β”œβ”€β”€ nginx.conf                   ← 1 h cache for /actuators_library.json
β”œβ”€β”€ package.json, vite.config.ts, tsconfig*.json, eslint.config.js
└── tailwind.config.js, postcss.config.js

License

Robodimm is released under the MIT License.

MIT License

Copyright (c) 2024–2026 J. L. Torres, M. MuΓ±oz, J. D. Álvarez, J. L. Blanco, and A. Gimenez

See LICENSE for the full text.


Citation

If you use Robodimm in academic work, cite the exact software release using CITATION.cff and the associated SoftwareX article. Until the journal assigns its final bibliographic identifiers, the software citation is:

@software{robodimm_v1_1_0,
  author  = {Torres, J. L. and Muñoz, M. and Álvarez, J. D. and
             Blanco, J. L. and Gimenez, A.},
  title   = {{Robodimm}: A web-based framework for trajectory-level dynamics
             and deterministic actuator sizing of industrial manipulators},
  version = {1.1.0},
  year    = {2026},
  doi     = {10.5281/zenodo.21871830},
  url     = {https://github.com/ual-arm/robodimm/tree/v1.1.0}
}

Software and accompanying Simscape reference data are versioned together; please pin the reviewed release tag (v1.1.0) when citing, and include fields from the actuator_sizing_report.v2 envelope: dynamics_source identifies the engine (demo_frontend, pro_cr4_kkt, or pro_cr6_serial), while source_commit and the provenance hashes identify the implementation and inputs.

About

Robodimm: A Physics-Grounded Framework for Automated Actuator Sizing in Scalable Modular Robots

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages