Skip to content

Mostafasaad1/robot-analyzer-js

Repository files navigation

Robot Analyzer (WebAssembly Edition)

A high-performance, offline-first React + TypeScript web application for robotic kinematics and dynamics analysis. This tool visualizes URDF models in 3D and computes complex robotics math entirely in the browser using a WebAssembly port of the Pinocchio rigid body dynamics library pinocchio-js.

Robot-analyzer.io

AI-Assisted Development: Over 70% of this frontend implementation was built using AI agents (specifically Gemini 3 Pro and Kimi 2.5). I only drove the architectural decisions, provided guidance, and assisted throughout the process.

🚀 Features

  • Zero-Backend Architecture: No server required. All computations and parsing happen locally on the client.
  • WASM Pinocchio Integration: Lightning-fast C++ dynamics algorithms compiled to WebAssembly using pinocchio-js.
  • Interactive 3D Viewer: Built with Three.js and @react-three/fiber for smooth, 60FPS dragging and rendering.
  • Live Kinematics & Dynamics:
    • Inverse/Forward Kinematics: End-effector targeting via Damped Least Squares (DLS).
    • RNEA (Recursive Newton-Euler Algorithm): Compute joint torques for given positions/velocities/accelerations.
    • ABA (Articulated-Body Algorithm): Compute forward dynamics accelerations.
    • CRBA (Composite-Rigid-Body Algorithm): Compute the joint space inertia (mass) matrix.
    • Jacobian & Center of Mass: Live calculation matrices.
  • Monte Carlo Sampling: Estimates maximum required gravity torques by sampling the entire joint workspace.
  • Local URDF Parsing: Drag-and-drop or upload URDF files and their associated meshes (.dae, .stl, .obj) directly into the browser.

🛠️ Technology Stack

  • Frontend: React 18, TypeScript, Vite
  • 3D Engine: Three.js, React Three Fiber (@react-three/fiber), Drei (@react-three/drei)
  • Robotics Core: pinocchio-js (Pinocchio WASM bindings), urdf-loader
  • State Management: Zustand (with transient subscriptions to bypass React re-renders)
  • Testing: Jest + JSDOM

💻 Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository and install dependencies:
npm install
  1. Run the development server:
npm run dev

The app will be available at http://localhost:5173. Upload a URDF file and matching STL/DAE meshes to begin analyzing.

🧪 Testing

The mathematical integrity of the kinematics solvers and state stores are validated via Jest.

# Run unit tests
npm run test

📦 Building for Production

This application uses highly-optimized Vite chunking to separate large vendor binaries (like Three.js and Pinocchio WASM) from the main application logic, drastically reducing initial load times.

npm run build

The output in the dist/ directory can be deployed statically to any web host (GitHub Pages, Netlify, Vercel) without needing a Node.js runtime or backend server.

📄 License

This project is licensed under the MIT License.

About

A high-performance, offline-first React + WebAssembly web application for robotic kinematics and dynamics analysis using Pinocchio.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages