About this project
rclnodejs is a Node.js client library for ROS 2 that exposes JavaScript and TypeScript APIs for building ROS 2 applications. According to the README, it covers topics, services, actions, parameters, lifecycle nodes, TypeScript support, RxJS Observable subscriptions, Electron integration, and browser access to ROS 2.
Installation requires Node.js 20.20.2 or newer and a ROS 2 SDK, with the ROS 2 environment sourced before installing, building or running. The package is installed with `npm i rclnodejs`. Prebuilt binaries are documented for Ubuntu 22.04 (Humble), 24.04 (Jazzy, Kilted) and 26.04 (Lyrical) on x64 and arm64; other environments build from source, and `RCLNODEJS_FORCE_BUILD=1` forces a source build. A Dockerfile is provided for containerized development.
For the browser, the project documents two options. `rclnodejs/web` is a typed layer over the ROS 2 graph where capabilities are allow-listed in `web.json` or via CLI flags, with typed `call`, `publish` and `subscribe`, WebSocket transport plus an optional HTTP listener for `call`/`publish` and Server-Sent Events for `subscribe`, and an OpenAPI 3.1 spec emitted by `rclnodejs-web openapi`. `rosocket` is a thin WebSocket gateway with no browser dependencies beyond built-in WebSocket and JSON, started via `npx rosocket`.
Message generation is automatic: JavaScript bindings and TypeScript declarations are generated for every `.msg`, `.srv` and `.action` interface in the sourced environment during `npm install`, and `npx generate-ros-messages` re-runs generation after installing additional ROS packages. Generated files land in `node_modules/rclnodejs/generated/`.
Additional documented material includes RxJS Observable subscriptions with operators such as `throttleTime()`, `debounceTime()`, `map()` and `combineLatest()`; Electron demos built with Electron Forge and Three.js, including a two-joint manipulator demo; TypeScript configuration guidance; a companion `rclnodejs-cli` for scaffolding and launch-file orchestration; and benchmark documentation. The project is licensed under Apache License 2.0.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.