Consolidate all demos under demo/ + add rosocket demo#1503
Merged
minggangw merged 2 commits intoRobotWebTools:developfrom May 6, 2026
Merged
Consolidate all demos under demo/ + add rosocket demo#1503minggangw merged 2 commits intoRobotWebTools:developfrom
minggangw merged 2 commits intoRobotWebTools:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request consolidates runnable demos under a single demo/ tree and adds a new end-to-end rosocket WebSocket bridge demo (Node bridge + browser client), with accompanying documentation/link updates.
Changes:
- Move/standardize demo locations under
demo/(Electron + TypeScript) and update top-level/docs references accordingly. - Add a new
demo/rosocket/demo showing topic pub/sub and service calls over plain WebSocket+JSON. - Add TypeScript demo projects (topics/services/actions) with build/run instructions and configs.
Reviewed changes
Copilot reviewed 14 out of 51 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/npmjs-readme.md | Update GitHub links to the new demo/ locations and add the rosocket demo link. |
| README.md | Update Electron/TypeScript demo links to demo/ paths. |
| eslint.config.mjs | Update ignore pattern from electron_demo/ to demo/electron/. |
| demo/typescript/topics/tsconfig.json | Add TS compiler configuration for the topics demo. |
| demo/typescript/topics/src/subscriber.ts | Add TypeScript subscriber demo implementation. |
| demo/typescript/topics/src/publisher.ts | Add TypeScript publisher demo implementation. |
| demo/typescript/topics/README.md | Add/adjust topics demo instructions using the new directory layout. |
| demo/typescript/topics/package.json | Add topics demo package config (currently has a broken local rclnodejs dependency path). |
| demo/typescript/services/tsconfig.json | Add TS compiler configuration for the services demo. |
| demo/typescript/services/src/server.ts | Add TypeScript service server demo implementation. |
| demo/typescript/services/src/client.ts | Add TypeScript service client demo implementation. |
| demo/typescript/services/README.md | Add/adjust services demo instructions using the new directory layout. |
| demo/typescript/services/package.json | Add services demo package config (currently has a broken local rclnodejs dependency path). |
| demo/typescript/README.md | Update TypeScript demo index README links for the new directory structure. |
| demo/typescript/actions/tsconfig.json | Add TS compiler configuration for the actions demo. |
| demo/typescript/actions/src/server.ts | Add TypeScript Fibonacci action server demo implementation. |
| demo/typescript/actions/src/client.ts | Add TypeScript Fibonacci action client demo implementation. |
| demo/typescript/actions/README.md | Add/adjust actions demo instructions using the new directory layout. |
| demo/typescript/actions/package.json | Add actions demo package config (currently uses peerDependency only for rclnodejs). |
| demo/rosocket/server.js | Add Node bridge server wiring ROS topic/service to WebSocket endpoints (logging currently hardcodes port in endpoints). |
| demo/rosocket/README.md | Add rosocket demo documentation and usage instructions (currently pins to a specific commit hash). |
| demo/rosocket/index.html | Add single-file browser client demo for rosocket (logging currently inserts <div> elements into <pre>). |
| demo/electron/turtle_tf2/renderer.js | Add Turtle TF2 renderer logic (coordinate frame parenting/positioning is inconsistent). |
| demo/electron/turtle_tf2/README.md | Update turtle_tf2 README paths for new demo layout. |
| demo/electron/turtle_tf2/package.json | Add turtle_tf2 Electron demo package config under demo/electron/. |
| demo/electron/turtle_tf2/orbit-controls.js | Add vendored OrbitControls implementation (missing upstream license/attribution). |
| demo/electron/turtle_tf2/main.js | Add turtle_tf2 Electron main process + ROS node setup. |
| demo/electron/turtle_tf2/index.html | Add turtle_tf2 Electron UI/renderer page. |
| demo/electron/topics/renderer.js | Add/update minimal Electron topics renderer script under new path. |
| demo/electron/topics/README.md | Update Electron topics README paths for new demo layout. |
| demo/electron/topics/package.json | Add Electron topics demo package config under demo/electron/. |
| demo/electron/topics/main.js | Add Electron topics demo main process under new path. |
| demo/electron/topics/index.html | Add Electron topics demo UI page under new path. |
| demo/electron/README.md | Add Electron demos index README (tutorials link path is currently incorrect). |
| demo/electron/manipulator/renderer.js | Add manipulator renderer implementation under new path. |
| demo/electron/manipulator/README.md | Update manipulator README paths for new demo layout. |
| demo/electron/manipulator/package.json | Add manipulator Electron demo package config under demo/electron/. |
| demo/electron/manipulator/main.js | Add manipulator Electron main process under new path. |
| demo/electron/manipulator/index.html | Add manipulator Electron UI page under new path. |
| demo/electron/car/renderer.js | Add car demo renderer implementation under new path. |
| demo/electron/car/README.md | Add car demo README (run instructions currently use the wrong cd path). |
| demo/electron/car/package.json | Add car Electron demo package config under demo/electron/. |
| demo/electron/car/main.js | Add car Electron main process under new path. |
| demo/electron/car/index.html | Add car Electron UI page under new path. |
| .npmignore | Add demo/ to npm ignore list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+7
| A minimal end-to-end example of the | ||
| [`rosocket`](../../rosocket/README.md) WebSocket bridge added in | ||
| commit `3176aca`. The Node server runs anywhere ROS 2 is sourced; | ||
| the HTML page runs in any modern browser and talks to it over plain | ||
| `WebSocket` — no client library required. |
Comment on lines
+54
to
+58
| `[rosocket-demo] listening on ws://localhost:${bridge.port} (bind=${HOST})` | ||
| ); | ||
| console.log('[rosocket-demo] endpoints:'); | ||
| console.log(' ws://localhost:9000/topic/chatter'); | ||
| console.log(' ws://localhost:9000/service/add_two_ints'); |
Comment on lines
+148
to
+152
| const line = document.createElement('div'); | ||
| if (cls) line.className = cls; | ||
| const ts = new Date().toLocaleTimeString(); | ||
| line.textContent = `[${ts}] ${msg}`; | ||
| el.prepend(line); |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
electron_demo/→demo/electron/andts_demo/→demo/typescript/, so all runnable demos live under a singledemo/tree (Electron, TypeScript, and the new rosocket demo). Path-only renames; per-demo READMEs and the top-levelREADME.md,scripts/npmjs-readme.md,eslint.config.mjs, and.npmignoreare updated to reference the new locations.demo/rosocket/— a minimal end-to-end example of therosocketWebSocket bridge: a Nodeserver.jsthat wires/chatter(std_msgs/msg/String) and/add_two_ints(example_interfaces/srv/AddTwoInts) to plain WebSocket URLs, and a single-fileindex.htmlbrowser client (no client library, just built-inWebSocket+JSON) demonstrating subscribe / publish / service-call. README documents how to source ROS 2, run the bridge alongside the existing AddTwoInts service example, open the page from any modern browser, and verify the round-trip from the ROS 2 side.Fix: #1502