LogoArc Docs

Tutorial 1 - Docker & ROS 2 Setup

Learn how to use Docker and ROS 2 to build your first containerized robotics environment.

Welcome to your first F1TENTH tutorial! This version includes embedded good coding habits, checklists, documentation links, upcoming visual demos, and now also outlines clear learning objectives, troubleshooting tips, and ROS 2 graph visualization guidance to support you as a beginner. This guide is built for first-year university students and assumes minimal experience with software development. It introduces two powerful tools used in robotics development: Docker and ROS 2. You'll learn core concepts, how to apply them, and gain hands-on experience along the way.

βœ… Good Habit Reminder: Always look up official docs before using a command you're unfamiliar with. Bookmark Docker and ROS 2 now!


Step 1: Go to Docker Guide

Step 2: Go to ROS 2 Guide

Step 3: Continue This Page


1. Building and Running Inside Docker

Sample Dockerfile

Dockerfile FROM ros:humble RUN apt update && apt install -y python3-colcon-common-extensions WORKDIR /ros2_ws COPY . /ros2_ws RUN . /opt/ros/humble/setup.sh && colcon build CMD ["bash"]

Containerizing ROS 2 Projects

πŸ“˜ Learn more: Dockerizing ROS 2 Projects


βœ… Good Habits Checklist

  • Add a .dockerignore file to keep images small
  • Re-tag and version your Docker builds
  • Push only working builds to Docker Hub

πŸŽ₯ Coming Soon: Visual: Docker build + colcon run demo


2. Final Assignment

Objective

  • Build a containerized ROS 2 workspace
  • Create a simple publisher node
  • Launch it using Python
  • Push your container to Docker Hub
  • Submit via GitHub Classroom

βœ… Track your changes: Keep a CHANGELOG.md file from the start


3. Common Mistakes and Pro Tips

MistakeFix
Not sourcing the setup scriptRun source install/setup.bash
Permissions issue on volumeAdd --user $(id -u):$(id -g) to docker run
Dependencies missing in packageAdd to package.xml and setup.py

βœ… Use tmux to keep sessions alive
βœ… Use volumes to persist work
βœ… Don’t put ROS source commands in .bashrc β€” see why here


4. Resources and What’s Next

πŸ”„ Troubleshooting Common ROS 2 Issues

πŸ› οΈ Colcon build fails with missing dependencies
Check your package.xml and setup.py to ensure all dependencies are listed.
Use:

rosdep install --from-paths src --ignore-src -r -y

to auto-install missing ones.

πŸ› οΈ Can't find installed packages
Make sure to source install/setup.bash after building. Never skip this step.

πŸ› οΈ Docker can't access local folder
Ensure you're using absolute paths with -v or --mount, and check permissions.


🧠 Visualize ROS 2 Graph

Run this command to generate a visual diagram of how your nodes and topics are connected:

rqt_graph

Or use:

ros2 run tf2_tools view_frames

This produces an image like the one below that shows your full ROS 2 computation graph.

πŸ“· (Insert SVG or screenshot of ROS graph visualization here)


Learn More


Coming Up

  • Writing custom messages and services
  • Simulating environments with Gazebo
  • Connecting ROS 2 nodes over a network

πŸŽ‰ Congratulations

You now know how to:

  • Use Docker to run isolated robotics environments
  • Build ROS 2 packages from scratch
  • Launch and test simple nodes
  • Submit your containerized project professionally