Skip to content

Browser ↔ ROS 2 capability runtime (Web Runtime) #1510

Description

@minggangw

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions