Skip to main content

Test ROS 2 Communication

8. Test ROS 2 Communication

Open the first terminal:

source /opt/ros/humble/setup.bash
ros2 run demo_nodes_cpp talker

Open the second terminal:

source /opt/ros/humble/setup.bash
ros2 run demo_nodes_cpp listener

If the listener continuously prints messages like the following, ROS 2 communication is working correctly:

[listener]: I heard: [Hello World: ...]

Press Ctrl+C to stop the talker and listener.