Goal
Let browser code talk to ROS 2 through an explicit, allow-listed set of capabilities exposed by a host Node.js process. JSON over WebSocket today, transport-agnostic so HTTP/etc. can plug in later. Reachable only through a new rclnodejs/web/server subpath export — no existing behavior changes.
const { createRuntime, WebSocketTransport } = require('rclnodejs/web/server');
const runtime = createRuntime({
node, transports: [new WebSocketTransport({ port: 9000 })],
});
runtime.expose({ call: ['/add_two_ints'], publish: ['/chatter'], subscribe: ['/chatter'] });
await runtime.start();
Why
rclnodejs is the only ROS 2 client with a mature web stack. Today browser apps either hand-roll WebSocket+JSON or pull in rosbridge+roslibjs. The Web Runtime closes that gap with a declarative, transport-agnostic capability layer that reuses the existing TypeScript message types — something rclpy/rclcpp can't do.
Goal
Let browser code talk to ROS 2 through an explicit, allow-listed set of capabilities exposed by a host Node.js process. JSON over WebSocket today, transport-agnostic so HTTP/etc. can plug in later. Reachable only through a new
rclnodejs/web/serversubpath export — no existing behavior changes.Why
rclnodejs is the only ROS 2 client with a mature web stack. Today browser apps either hand-roll WebSocket+JSON or pull in
rosbridge+roslibjs. The Web Runtime closes that gap with a declarative, transport-agnostic capability layer that reuses the existing TypeScript message types — somethingrclpy/rclcppcan't do.