Repository navigation
Web Actions
Web actions now support WebSocket and HTTP/SSE, with ROS-derived TypeScript types and OpenAPI schemas (#1586, #1593, #1598).
With a running /fibonacci action server exposed on HTTP port 9001:
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();
}- HTTP actions stream via POST/fetch; explicit
{ http, ws }uses WS. - Check
goal.statuseven whengoal.resultresolves. Request/stream errors reject; reconnect never resubmits goals.
Try the JavaScript and TypeScript demos (#1614).
Web capabilities at a glance
All operations are allow-listed; topic and service support predates 2.3.0:
| 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 |
- SDK subscriptions use WS. Direct HTTP topic SSE requires
--http-sse(orhttp.sse: true); HTTP actions do not. - Service/action handlers run on the ROS side. Disconnecting does not cancel the ROS goal.
Other Improvements
Timer.clockexposes the configured timer clock (#1599).- Two-parameter raw callbacks now receive
MessageInfo; Buffer-only callbacks are unchanged (#1618).
Thank You
Thanks to KR Ravindra (@KR-Ravindra), Anupam Mediratta (@anupamme), and Matthew Kotara (@Matt95) for their contributions.
Full Changelog: 2.2.0...2.3.0