Skip to content

InfinityAILab/ros2-hello-world-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ROS 2 Hello World Python

A simple ROS 2 publisher/subscriber example implemented in Python.

Prerequisites

  • ROS 2 (Humble or newer)
  • Python 3.8+
  • colcon build tools

Building and Running

1. Build the Package

In your first terminal:

colcon build --packages-select my_py_pubsub

2. Launch the Publisher

In a second terminal:

source install/setup.bash
ros2 run my_py_pubsub talker

3. Launch the Subscriber

In a third terminal:

source install/setup.bash
ros2 run my_py_pubsub listener

Expected Output

Publisher Terminal

[INFO] [minimal_publisher]: Publishing: "Hello World!"
[INFO] [minimal_publisher]: Publishing: "Hello World!"

Subscriber Terminal

[INFO] [minimal_subscriber]: I heard: "Hello World!"
[INFO] [minimal_subscriber]: I heard: "Hello World!"

Project Structure

ros2-hello-world-python/
├── src/
│   └── my_py_pubsub/
│       ├── my_py_pubsub/
│       │   ├── __init__.py
│       │   ├── publisher.py
│       │   └── subscriber.py
│       ├── package.xml
│       └── setup.py
└── README.md

License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages