A beginner-friendly, browser-based robotics simulator for interactive learning and research. Control a virtual robot in a 3D arena, queue commands for automated sequences, and work through guided lessons โ all directly in your browser.
RoboWebSim is an educational robotics simulation platform that runs entirely in the browser. It is designed for beginners learning robot movement, navigation, and simple autonomous behavior. No software installation is required beyond a web browser.
This project is an open-source desktop robot simulator. Webots is used only as a conceptual reference for:
- The separation of robot state, controller, and world (arena) configuration
- The structure of beginner-friendly simulation workflows
- How sensors, actuators, and controllers are modularly organized
RoboWebSim is entirely original: no Webots code, branding, UI, assets, or documentation has been copied. This is a web-first product built from scratch with Next.js and Three.js.
- Browser-first architecture (no desktop app, no install)
- Original 3D robot and arena design built with React Three Fiber
- Custom simulation engine (motion, collision, command queue)
- Original lesson content and progression system
- localStorage-based progress persistence
- Custom Zustand-based state management for all simulation state
| Feature | Description |
|---|---|
| ๐ค 3D Arena | Interactive Three.js arena with grid floor, walls, obstacles, target |
| ๐ฎ Direct Control | Arrow keys or on-screen D-pad for real-time robot movement |
| ๐ Command Queue | Build sequences of forward/backward/left/right/wait commands and run automatically |
| ๐ Guided Lessons | 3 beginner lessons on navigation, turning, and obstacle avoidance |
| โ Progress Tracking | Lesson completion state saved to localStorage |
| ๐จ Collision Feedback | Robot changes color when hitting an obstacle or reaching a target |
| ๐ Pause/Resume/Stop | Full queue execution control |
| ๐พ Session Persistence | Restores last free-play scenario or lesson on reload (safe fallback to default arena) |
| ๐ก Runtime Validation | Scenario/lesson IDs and arena shapes validated before loading |
| ๐ฑ Responsive Layout | Works on desktop, tablet, and mobile via adaptive bottom-tab panel |
| ๐ก Onboarding Strip | Dismissible quick-start guide shown at the top of the simulator |
To quickly show off RoboWebSim to a new visitor or reviewer:
- Open
/lessonsand walk through the lesson list - Click Practice in Simulator on any lesson
- In the simulator, the lesson loads and the context bar shows Lesson mode
- Add a few commands (e.g. Forward โ Left โ Forward) via the Command Builder
- Click โถ Run Queue and watch the robot navigate
- Observe telemetry and event log update in real time
- Open
/simulatordirectly - The Quick Start strip at the top explains the 4 steps
- In the left panel (desktop) or Scenarios tab (mobile), expand a scenario card and click โถ Load Scenario
- Add commands and run the queue
- Try ๐ Reset or โฉ Replay from Quick Actions to demonstrate deterministic replay
- Open the simulator on a desktop and note the three-column layout
- Resize to tablet/mobile width; the canvas fills the screen and controls move to the bottom tab bar
- Tap the Controls, Queue, and Info tabs to explore panels
- Node.js 18 or newer
- npm (comes with Node.js)
git clone https://github.com/Joenasriani/robo-web-sim.git
cd robo-web-sim
npm installnpm run devOpen http://localhost:3000 in your browser.
npm run build
npm startnpm testThe test suite covers store behaviors (scenario loading, lesson persistence, hydration fallback) and route smoke tests. Tests use Jest + ts-jest with a jsdom environment.
- Push the repository to GitHub (already done)
- Go to vercel.com and import the repository
- Framework will be auto-detected as Next.js
- No environment variables are required for the MVP
- Click Deploy
The app is fully static-compatible and will be served via Vercel's CDN.
| Route | Description |
|---|---|
/ |
Landing page with product intro and navigation |
/simulator |
3D simulator with robot controls, command queue, and lessons sidebar |
/lessons |
Full lessons page with progress tracking |
| Key | Action |
|---|---|
โ |
Move forward |
โ |
Move backward |
โ |
Turn left |
โ |
Turn right |
robo-web-sim/
โโโ src/
โ โโโ app/ # Next.js App Router pages
โ โ โโโ page.tsx # Landing page (/)
โ โ โโโ simulator/ # Simulator page (/simulator)
โ โ โโโ lessons/ # Lessons page (/lessons)
โ โโโ components/ # React UI components
โ โ โโโ Arena3D.tsx # Three.js 3D scene
โ โ โโโ RobotControls.tsx
โ โ โโโ CommandQueue.tsx
โ โ โโโ LessonsSidebar.tsx
โ โโโ sim/ # Simulation core modules
โ โ โโโ robotState.ts
โ โ โโโ arenaConfig.ts
โ โ โโโ motionSystem.ts
โ โ โโโ collisionHelpers.ts
โ โ โโโ commandExecution.ts
โ โ โโโ robotController.ts # Zustand store
โ โ โโโ validation.ts # Runtime validation helpers
โ โโโ lessons/ # Lesson content data
โ โโโ configs/ # Simulator configuration
โ โโโ __tests__/ # Jest smoke tests
โโโ docs/ # Documentation
โโโ examples/ # Example arena configs
โโโ scripts/ # Utility scripts
โโโ public/ # Static assets
- Arena configuration is static (not editable at runtime via UI)
- No undo for individual command queue items (only remove-last or clear-all)
- Robot movement is grid-step-based (not continuous physics)
- No save/load for command sequences
- OrbitControls pinch-zoom uses Three.js defaults; multi-touch may feel slightly different from native apps
- Keyboard arrow key shortcuts work on mobile only with an external keyboard connected
RoboWebSim adapts across screen sizes using a breakpoint-based layout strategy:
| Breakpoint | Layout |
|---|---|
Large desktop (lg / 1024px+) |
Full three-column layout: left sidebar (Scenarios + Lessons) ยท 3D canvas ยท right sidebar (Controls + Queue + Telemetry + Event Log) |
Tablet / small laptop (mdโlg) |
Canvas fills full width. All panels accessible via a bottom tab bar: Controls, Scenarios, Queue, Info |
Mobile (< md) |
Same bottom-tab approach, canvas fills available height above the tab bar |
- Scenario selector, Lessons, Quick Actions, Command Queue, Telemetry, Event Log โ all reachable via the bottom tab panel on smaller screens
- Canvas resizes automatically to fill the available space
- No horizontal scrolling on any supported width
- Touch-friendly tap targets (
touch-manipulation,min-h-[52px]tab buttons,active:states on all buttons) - Current Context panel always visible above the canvas at all sizes
- Controls tab opens by default on mobile so users see robot controls immediately on landing
- Mobile-specific onboarding strip โ shows tab-based instructions (e.g. "Tap Controls to move") instead of sidebar steps on small screens
- Mobile Edit Overlay โ when in arena edit mode and an object is selected, a floating D-pad + rotate + delete panel appears at the bottom of the canvas so users never have to hunt for the Controls tab
- Canvas orbit hint visible on all sizes โ "Drag to orbit โข Pinch to zoom" on mobile, full instructions on desktop
- OrbitControls touch-pan/pinch-zoom uses Three.js defaults; multi-touch may feel slightly different from native apps
- Keyboard arrow key shortcuts still work on mobile but are only useful when an external keyboard is connected
- Object selection in 3D uses R3F's standard pointer-event raycasting; a very fast swipe may occasionally not register as a tap
Priority order for future upgrades:
Responsive / mobile controls โ Touch-friendly D-pad, better layout on small screensโ Done in PR #9UX polish and demo readiness โ Onboarding strip, empty states, disabled states, microcopyโ Done in PR #10Mobile touch usability โ Touch object selection, mobile edit overlay, better discoverabilityโ Done in PR #21- Editable arena โ Drag-and-drop obstacles and target placement
- Save/load command sequences โ Export and import command programs as JSON
- More lessons โ Sensor simulation, grid navigation, pathfinding
- Physics engine โ Rapier.js integration for realistic collisions and dynamics
- Blockly integration โ Visual programming for command sequences
- Multiple robot types โ Different shapes, sizes, and movement capabilities
- Lesson authoring โ User-created lessons with custom objectives
- Multiplayer / collaborative mode โ Two robots, cooperative challenges