Skip to content

Consolidate all demos under demo/ + add rosocket demo#1503

Merged
minggangw merged 2 commits intoRobotWebTools:developfrom
minggangw:fix-1502
May 6, 2026
Merged

Consolidate all demos under demo/ + add rosocket demo#1503
minggangw merged 2 commits intoRobotWebTools:developfrom
minggangw:fix-1502

Conversation

@minggangw
Copy link
Copy Markdown
Member

  • Move electron_demo/demo/electron/ and ts_demo/demo/typescript/, so all runnable demos live under a single demo/ tree (Electron, TypeScript, and the new rosocket demo). Path-only renames; per-demo READMEs and the top-level README.md, scripts/npmjs-readme.md, eslint.config.mjs, and .npmignore are updated to reference the new locations.
  • Add demo/rosocket/ — a minimal end-to-end example of the rosocket WebSocket bridge: a Node server.js that wires /chatter (std_msgs/msg/String) and /add_two_ints (example_interfaces/srv/AddTwoInts) to plain WebSocket URLs, and a single-file index.html browser client (no client library, just built-in WebSocket + 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

Copilot AI review requested due to automatic review settings May 6, 2026 09:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread demo/rosocket/README.md Outdated
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 thread demo/rosocket/server.js Outdated
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 thread demo/rosocket/index.html
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);
@coveralls
Copy link
Copy Markdown

coveralls commented May 6, 2026

Coverage Status

coverage: 85.864%. remained the same — minggangw:fix-1502 into RobotWebTools:develop

@minggangw minggangw merged commit 8fea81e into RobotWebTools:develop May 6, 2026
18 of 19 checks passed
@minggangw minggangw mentioned this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rosocket demo

3 participants