ROS2LabRobotics & ROS 2 Lab

ROS 2: Zero to MoveIt 2 › Syllabus

Syllabus: ROS 2 Jazzy: Zero to MoveIt 2 with Gazebo & ros2_control

About the course

You build two robots in software and make them move: my_bot, a two-wheeled mobile robot with a lidar, and the ROS2Lab arm, a small robot arm with a gripper. You start with ROS 2 itself and a turtle on the screen. You end with an arm that picks up a cube and puts it on another table. Everything is ROS 2 Jazzy on Ubuntu 24.04 with Gazebo Harmonic, ros2_control and MoveIt 2.

The course has 61 core lessons in Levels 1 to 4, and 20 optional lessons (the Go deeper lessons and Level 5). A lesson takes 20 to 40 minutes. You do every lesson yourself in a lab beside the text; the page checks your work.

Who it is for, and what you need to know first

What you can do at the end

A learner who finishes the core lessons of Levels 1 to 4 can:

  1. Explain how a running ROS 2 system is organised: which nodes exist, and what each one sends, receives and offers.
  2. Write Python nodes that work together through topics, services, your own message types and parameters, and start them with one launch file.
  3. Build a model of a mobile robot and of an arm in URDF and Xacro, and run it in Gazebo Harmonic with a sensor whose data reaches ROS 2.
  4. Set up ros2_control (hardware interface, controllers, controller manager) for a diff-drive robot and for an arm, so that the same controllers run on mock hardware and in Gazebo.
  5. Set up MoveIt 2 for an arm and write a program that moves an object from one table to another without a collision.
  6. Find and fix a fault that you did not put into a ROS 2 system, and show with one command that it is fixed.
  7. Measure what a robot really did, compare it with what it was told to do, and give a reason for the difference.

The optional parts add:

Modules, time and outcomes

"Guided" is the time of the lessons' own steps. A Challenge is work on your own and takes about 15 minutes more per lesson.

Module 0: Set up your ROS 2 PC

Time: 30-60 min, once; optional when you use the Browser Lab. Entry outcomes: they prepare for the course and feed no course outcome.

After it you can:

  • Say, for each lab, what is real ROS 2 and what is a model of it.
  • Show that your lab is ready: ROS 2 answers, your workspace is found and your ROS_DOMAIN_ID is set.
  • Explain what each line of the ros2lab block in ~/.bashrc does, and what stops working without it.

Level 1: ROS 2 Foundations

Time: 11.0 h guided + about 5.5 h of Challenges; optional lessons 4.1 h.

After it you can:

  • Describe a running system that you did not write: its nodes, and the topics, services and parameters of each.
  • Create a Python package and write in it a node that listens on one topic and publishes on another, starting from an empty folder.
  • Write a service server and a client that does not block, with a service type that you defined.
  • Change how nodes start (names, topics, parameters) with a YAML file and a launch file, without editing their code.
  • Build an application of three or more nodes from a one-page specification.
  • Find and fix a fault in an application of several nodes.

Level 2: Model and Simulate Robots

Time: 9.7 h guided + about 4.8 h of Challenges; optional lessons 1.2 h.

After it you can:

  • Find where one frame is, seen from another, and explain the answer with the TF tree.
  • Write the URDF of a robot from a drawing with sizes: links, joints, origins, axes and limits.
  • Rewrite a URDF with Xacro so that one changed number updates every part that depends on it.
  • Set up a Gazebo simulation of your robot in a world that you wrote, with a lidar whose scans reach ROS 2 and every node on the simulation clock.
  • Measure how far a drive ended from its plan (Gazebo's pose against odometry) and give one cause of the difference.
  • Find and fix a fault in a robot model that looks or behaves wrong.

Level 3: Control Robots with ros2_control

Time: 4.6 h guided + about 2.3 h of Challenges; optional lessons 0.7 h.

After it you can:

  • Explain which layer of ros2_control changes between mock hardware, Gazebo and real motors, and which layers stay the same.
  • Write the ros2_control tag and the controller YAML for a robot, and start its controllers so that all are active.
  • Find and fix the reason why a controller does not move the robot.
  • Write a node that sends a joint trajectory, and check from /joint_states that the arm arrived.

Level 4: Plan Motion with MoveIt 2

Time: 5.8 h guided + about 2.8 h of Challenges; optional lessons 1.7 h. Before Level 4, do Go deeper G1.1 (actions): MoveIt talks to your controllers through an action.

After it you can:

  • Predict whether a target has no, one or several joint answers, and say why.
  • Add a planning group, a named pose and a collision shape to an arm's MoveIt set-up, and repair a generated MoveIt package so that it matches the running controllers.
  • Compare two plans for one goal with numbers (time, how close the joints ended, scaling factor) and say which one you would run.
  • Write a program that sends the arm to a named pose, to joint angles and to a point, and reports whether each motion was planned and executed.
  • Write the step list of a pick-and-place for a new table and a new object, with a check after every step.
  • Find from MoveIt's failure line why a motion does not plan or run, and fix it.

Level 5: Connect Real Hardware (optional)

Time: 3.5 h guided + about 1.3 h of Challenges.

After it you can:

  • Work out the centre and direction settings for a servo that is mounted wrong.
  • Complete the read() and write() functions of a given ros2_control hardware component in C++, build it on My ROS 2 PC and load it as a plug-in. (My ROS 2 PC only (the Browser Lab does not compile C++))
  • Switch one bringup between mock hardware, Gazebo and the Uno with one argument, with the same controllers.
  • Measure how late the twin follows the real arm in two motions, and say what the number cannot show for an arm without feedback.

Professional practice (optional lessons in Levels 1, 2 and 4)

Time: see the lessons.

After it you can:

  • Keep a workspace in git: leave build products out, commit, branch, compare, and bring back a file that broke.
  • Write a test for a function of a package and a first launch test, and run and read them with colcon.
  • Find why a subscriber hears nothing on a topic that exists, and fix the QoS mismatch.
  • Write an action server with feedback, cancel and a result that says whether the arm really arrived.

How a lesson works, and how your work is checked

The lists "I can ..." on the course home are for you alone. They are not counted.

Certificates

What you need

Working honestly

Accessibility

Where to go next

This course does not cover everything. After it, good next steps are: a TF listener in your own code, navigation with Nav2, MoveIt Task Constructor for longer manipulation jobs, and writing your own controller for ros2_control. The optional lessons of this course add git for a ROS 2 workspace (1.G4), testing a package (1.G5), QoS and ros2 doctor (2.G1), an action server for the arm (4.G2).

Start Level 1 - free See the lessons