- in the root of the project [ros_ws] check for missing dependencies before building
rosdep install -i --from-path src --rosdistro humble -y
- in the root [ros_ws] build the package
colcon build --packages-select py_pubsub
- Open a new terminal navigate to [ros_ws] and source the setup files
source install/setup.bash
- Now run the talker node:
ros2 run py_pubsub talker
- Now Open a new terminal navigate to [ros_ws] and source the setup files
source install/setup.bash
- And then start the listener node
ros2 run py_pubsub listener