Day 8
ROS 2 Jazzy: install, nodes, topics, services
This is a valid v1.0 placeholder page for the later curriculum arc. Full interactive lab treatment ships after Week 1 dogfooding.
LECTURE & READING
Glossary primer (12 min)
- ROS 2 — Open-source middleware framework for robotics. Successor to ROS 1, built on DDS (Data Distribution Service). Jazzy Jalisco is the current LTS release (May 2024 → May 2029).
- DDS — Real-time pub/sub protocol; ROS 2's default transport layer. Cyclone DDS is the most-used implementation in 2026.
- Node — A ROS process. Each node owns part of the system: a camera driver, a planner, a Control & PlanningControllerThe algorithm or system that turns desired behavior into motor commands..
- Topic — A named, typed message stream. Many-to-many: any node can publish, any node can subscribe.
- Message — A typed data packet. Standard messages live in
std_msgs,geometry_msgs,sensor_msgs. - Service — Synchronous request/response between two nodes (e.g. "set parameter").
- Core ConceptsActionA command the robot sends to its motors, controller, or low-level system. — Long-running Core ConceptsGoalThe desired outcome or target state for a robot task. with Control & PlanningFeedbackInformation returned from sensors during action to help correct behavior. (e.g. "navigate to pose"; reports progress, can be cancelled).
- Manipulation & TasksWorkspaceThe region of space the robot can reach. — A directory tree (
src/,build/,install/,log/) where you build ROS 2 packages withcolcon. - Lifecycle node — A node with explicit states (Unconfigured → Inactive → Active). Standard for production.
- rclpy / rclcpp — Python and C++ client libraries.
Real-world analogy
A ROS 2 system is a small office. Topics are bulletin boards anyone can pin notes to. Services are walking up to a colleague's desk and asking a yes/no question. Actions are submitting a multi-day project request and getting periodic status updates. Nodes are individual employees, each with one job. DDS is the building's intercom.
Hour 1 — Install ROS 2 Jazzy and verify
Pick one of the two paths.
Path A: native Ubuntu 24.04 (recommended for laptops). Follow the official guide ~30 min: https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html
# Add ROS 2 apt repository
sudo apt update && sudo apt install -y curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt install -y ros-jazzy-desktop ros-dev-tools python3-colcon-common-extensions
# Source — add to ~/.bashrc for persistence
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
source ~/.bashrcPath B: Docker (recommended on macOS or if you don't want to install system-wide).
docker pull osrf/ros:jazzy-desktop-full
docker run -it --rm --name ros2 \
--network=host \
-v ~/robo47:/workspace \
osrf/ros:jazzy-desktop-full /bin/bashVerify install (either path):
ros2 --version
ros2 doctorExpected output:
ros2 cli version: 0.32.x
1/N check failed
...
All N checks passedSome warnings (e.g. "QoS overrides") are normal. Doctor failing more than 2 checks means something went wrong; usually re-source.
Hour 2 — Concept primer
- Watch ~50 min of these in order:
- Quick ROS 2 conceptual overview, "Introduction to ROS Part 1: What is the Core ConceptsRobotA physical system with sensors and actuators that can observe the world and take actions. Operating System?"
Video
Quick ROS 2 conceptual overview, "Introduction to ROS Part 1: What is the Core ConceptsRobotA physical system with sensors and actuators that can observe the world and take actions. Operating System?
Open source - Articulated Robotics "Getting Ready to Build Robots with ROS" Lessons 1–4:
- Lesson 1, "Five Things You Need Before Starting With ROS"
- Lesson 2, "Setting Up Your Network for ROS"
- Lesson 3, "How to install ROS"
- Lesson 4, "10 things you need to know about ROS"
- Read ROS 2 Concepts page: https://docs.ros.org/en/jazzy/Concepts.html
LAB
Hour 3 — Lab: build a publisher/subscriber pair (75 min)
What you're building. A two-node ROS 2 system: a Python talker node publishing std_msgs/String messages at 2 Hz on the /chatter topic, and a Python listener node subscribing to /chatter and printing each message it receives. You'll build them with colcon, run both in tmux panes, and inspect the system with ros2 topic echo, ros2 topic hz, and rqt_graph.
What success looks like at the end. You have:
1. A Manipulation & TasksWorkspaceThe region of space the robot can reach. ~/robo47/w2-systems/ros2_ws/ with one package chatter containing two scripts.
2. The talker terminal prints Publishing: 'Hello robotics 0' (1, 2, …) at 2 Hz.
3. The listener terminal prints I heard: 'Hello robotics 0' (1, 2, …) at the same rate.
4. ros2 topic hz /chatter reports average rate: 2.0.
5. rqt_graph shows two nodes connected by /chatter.
6. A screenshot of rqt_graph saved as figures/day8_rqt_graph.png.
Step 1 — Create the workspace and package (10 min)
mkdir -p ~/robo47/w2-systems/ros2_ws/src
cd ~/robo47/w2-systems/ros2_ws/src
ros2 pkg create chatter --build-type ament_python --dependencies rclpy std_msgs --node-name talkerFull source continues in the committed curriculum files. The v1.0 page exposes the day flow and lab surface without inventing content.