link : https://youtu.be/CXkXS-cydL0
This project demonstrates a simple ROS 2 publisher and subscriber setup using Node.js and TypeScript via rclnodejs
. Great for learning how to bridge JavaScript-based applications with the powerful ROS 2 ecosystem.
- Node.js (v18.x recommended)
- ROS 2 (Humble or supported distro)
- rclnodejs
ros2-node-ts/
├── src/
│ ├── publisher.ts # Publishes String messages to /chatter
│ └── subscriber.ts # Listens to messages on /chatter
├── tsconfig.json # TypeScript config
├── package.json # Project dependencies and scripts
git clone <repo-url>
cd ros2-node-ts
npm install
Make sure ROS 2 is properly installed and sourced:
source /opt/ros/jazzy/setup.bash
npm run build
npm run start:pub
Open a second terminal:
npm run start:sub