8000 GitHub - AQIB-NAWAB/ros2-node-ts
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

AQIB-NAWAB/ros2-node-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo video

link : https://youtu.be/CXkXS-cydL0

🤖 ROS 2 Node.js TypeScript Example

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.


🚀 Getting Started

📦 Requirements

  • Node.js (v18.x recommended)
  • ROS 2 (Humble or supported distro)
  • rclnodejs

📁 Project Structure

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

⚙️ Setup

1. Clone and install dependencies

git clone <repo-url>
cd ros2-node-ts
npm install

2. Source ROS 2

Make sure ROS 2 is properly installed and sourced:

source /opt/ros/jazzy/setup.bash

3. Build TypeScript (optional, for compiled output)

npm run build

🧪 Run Examples

Start Publisher

npm run start:pub

Start Subscriber

Open a second terminal:

npm run start:sub

You should see messages being published and received in the terminal.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0