rcl-web
v0.0.6
Published
Browser TypeScript package for rclweb (R2WP client around the rclweb wasm core)
Readme
rcl-web
TypeScript client for ROS 2 in the browser. Connect to an
rclwebd gateway, then use Node
like rclcpp.
import { init, Node, std_msgs } from "rcl-web";
await init("ws://127.0.0.1:8794/ws");
const node = new Node("listener");
node.createSubscription(std_msgs.msg.String, "chatter", 10, (msg) => {
console.log(msg.data);
});npm install rcl-webYour own ROS interfaces (a package with msg/ / srv/ / action/):
npx rcl-web gen --package ./my_interfaces --out src/generated/my_interfaces.tsimport { my_interfaces } from "./generated/my_interfaces.ts";
const msg = new my_interfaces.msg.Status();How to. Topic codecs still cover only the types this package ships.
Do not import rcl-web/internal from application code.
