Rclnodejs 2.3.0: ROS 2 Actions over WebSocket and HTTP/SSE

Send a goal, follow the feedback, get the result. rclnodejs 2.3.0, the ROS 2 client library for Node.js, brings ROS 2 actions to web apps over WebSocket and HTTP/SSE.

ROS 2 Actions from the Browser

The browser SDK derives TypeScript goal, feedback and result types from generated ROS declarations. OpenAPI export also includes action schemas.

With an HTTP runtime on port 9001 exposing a running Fibonacci action server as /fibonacci:

import { connect } from 'rclnodejs/web';

const ros = await connect({ http: 'http://localhost:9001' });
try {
  const goal = await ros.action(
    '/fibonacci',
    { order: 5 },
    { onFeedback: (feedback) => console.log(feedback.sequence) }
  );
  console.log(await goal.result, goal.status);
} finally {
  await ros.close();
}

Web capabilities at a glance

Together with the topic and service support from earlier releases, actions round out the following client-facing operations, controlled by the same capability allow-list:

ROS 2 operation WebSocket HTTP / SSE
Publish topic messages Yes HTTP POST
Subscribe to topics Yes HTTP GET + SSE (opt-in)
Call services Yes HTTP POST
Send action goals, receive feedback/results (new) Yes HTTP POST + SSE
Request cancellation of an action goal (new) Yes; server may reject Not supported

Try the JavaScript and TypeScript demos for runnable examples.

For background on the typed Web SDK and capability runtime first introduced in 2.0.0, see our original announcement.

3 Likes

A quick follow-up: we’ve added Manipulator Studio, a pure browser-based visualization demo inspired by our Electron manipulator demo. The viewer runs entirely in a standard web browser — no Electron, plugins, or ROS installation required on the browser side.

Control a simulated two-joint arm from your terminal: a native rclnodejs node publishes /joint_states, and the browser subscribes through rclnodejs/web to visualize the motion with Three.js.

See video:
rclnodejs_web_manipulator

Source and setup instructions

1 Like