One command starts your station and your listener together; another one records everything they say, so you can play it back later, even with the station turned off.
In this video you'll learn:
✔ Write a small Python launch file that starts both nodes (one Ctrl+C stops both)
✔ Record a run with ros2 bag record, and read it with ros2 bag info
✔ Play it back with ros2 bag play while the station is off, and the listener still hears it
One sentence to remember: Launch it. Record it. Play it back.
Tested on Windows 11 with ROS 2 Lyrical (official binary install). Terminal views are drawn from real output.
CHAPTERS
0:00 This video is for you
0:40 Quick recall
1:04 Stage manager + flight recorder
1:55 The plan + step 1: launch
3:34 Step 2: record a bag
4:26 Step 3: play it back
5:15 Why it matters
5:31 Two mistakes
6:09 One honest limit
6:31 Recap + one sentence to remember
THE LAUNCH FILE (C:devros2_wssrcpip_radiolaunchradio_launch.py)
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(package='pip_radio', executable='station'),
Node(package='pip_radio', executable='listener'),
])
THE COMMANDS (Windows Command Prompt; every terminal: cd C:devlyrical, pixi shell, call C:devlyricallocal_setup.bat, then cd C:devros2_ws, call installsetup.bat)
Terminal 1 (launch):
md C:devros2_wssrcpip_radiolaunch
(save radio_launch.py in that folder)
cd C:devros2_wssrcpip_radiolaunch
ros2 launch radio_launch.py
On Windows the nodes' own lines may not show in this terminal. Check in a second terminal: ros2 topic echo /radio
Terminal 2 (record, launch still running):
cd C:dev
ros2 bag record -o pip_run --topics /radio (about 10 s, then Ctrl+C)
ros2 bag info pip_run
Play it back (Terminal 1: Ctrl+C the launch, then ros2 run pip_radio listener):
cd C:dev
ros2 bag play pip_run
Linux / macOS: the same commands; source with source install/setup.bash (not run on our test PC).
IF YOU SEE THIS
• [ERROR] [launch]: Caught exception in launch (see debug for traceback): "package 'pip_radio' not found, ..." → the workspace is not sourced in THIS terminal. Fix: cd C:devros2_ws then call installsetup.bat (after sourcing ROS 2).
• [ERROR] [ros2bag]: Output folder 'pip_run' already exists. → a bag folder with that name already exists. Fix: pick a new name after -o (for example pip_run2), or move the old folder.
• ValueError: 'radio_launch.py' is not a valid package name (end of a long traceback) → you are not in the launch folder. Fix: cd into the launch folder; check the name with dir.
• Launch starts both nodes but their "On air" / "I heard" lines don't show (Windows) → their output is held back under launch on our test PC. Fix: check with ros2 topic echo /radio.
• The listener prints nothing during ros2 bag play → it started after playback ended, or another topic was recorded. Fix: start the listener first; check ros2 bag info shows /radio.
(The quoted texts are real output from our test PC.)
PRACTICE CARD (try it before Video 12)
1. What does a launch file do that ros2 run can't?
2. Which option gives a bag recording its own name?
3. The station is off and you play a bag of /radio. Why does the listener still print messages?
Try it: install your launch file. In setup.py, add the launch folder to data_files (see the official tutorial "Integrating launch files into ROS 2 packages"), build, source, then run ros2 launch pip_radio radio_launch.py from any folder. Then record a 30-second bag and check the message count with ros2 bag info. No install yet? Write a stage manager's list for a robot vacuum: which three nodes go on stage?
Answers are in the pinned comment.
Next step if you want more (free): the official ROS 2 tutorials "Creating a launch file" and "Recording and playing back data" on docs.ros.org.
NEXT: Video 12, the last video of ROS 2 101: frames, TF2 and RViz, plus a look back at the whole course
About this video: terminal windows and file cards are drawings of a real run on our test PC (timestamps shortened to [...]; log-folder lines left out). Stage, flight recorder and Pip are illustrations.
SOURCES (official ROS 2 documentation for Lyrical, docs.ros.org/en/lyrical/)
• Creating a launch file
• Integrating launch files into ROS 2 packages
• Recording and playing back data
https://docs.ros.org/en/lyrical/
SUBTITLES / CAPTIONS
English. More languages coming; if you'd like your language, tell us in the comments.
DISCLAIMER
This video is for educational purposes only. It is a simplified beginner introduction, not professional engineering or safety advice. ROS 2 changes over time; facts reflect official sources available in November 2026. The analogies are simplified.
📚 Playlist: ROS 2 for Beginners 101 (watch in order)
🔔 Subscribe to Curiosity Beyond for clear, beginner-friendly tech explained step by step.
#ROS2 #Robotics #Python