This repository contains course materials and personal notes for the Robot Programming course (Academic Year 2025/2026) within the Artificial Intelligence and Robotics Master's program at Sapienza University of Rome.
It includes comprehensive notes, practical exercises, source code examples, and exam preparation materials developed and collected throughout the course.
You will notice links labeled LLM Context File in the modules below. The code/ directory contains special markdown files where all the source code and solutions for a specific topic have been concatenated. These files are specifically designed to be easily copied and pasted into Large Language Models (like ChatGPT, Claude, or Gemini) to ask for code explanations, debugging help, or architectural overviews without having to upload dozens of separate .cpp and .h files.
Course overview, logistics, and an introduction to the Sense-Plan-Act paradigm in robotics.
- Slides:
rp_00_intro.pdf|rp_course_map.pdf
The C++ compilation lifecycle (source code, object files, executables) and build automation using Makefiles and CMake, including external dependency management with pkg-config.
- Slides:
rp_01_compilers_and_build_systems.pdf - Notes: English | Italian
- Source: Source Code | LLM Context File
- Practice: Exercise | Solution | LLM Context File
Distributed version control architecture based on snapshots (instead of file deltas), secure commit identification via SHA-1 checksums, and branch management.
- Slides:
rp_01b_git.pdf - Notes: English | Italian
Core concepts: basic types, pointers, references, and advanced memory management using Stack and Heap for dynamic allocation.
- Slides:
rp_02_cpp_intro.pdf - Notes: English | Italian
- Source: Source Code | LLM Context File
- Practice: Exercise | Solution | LLM Context File
Object-Oriented Programming: multiple inheritance, polymorphism with late binding (
virtualandoverride),dynamic_cast, and their application in developing a robotic simulator with lidars and grid maps.
- Slides:
rp_02b_cpp_inheritance.pdf - Notes: English | Italian
- Source: Source Code | LLM Context File
Introduction to the ROS middleware architecture (Nodes, Topics, Services, and Messages) for inter-process communication, alongside C++ metaprogramming concepts using templates and function objects for compile-time optimizations.
- Slides: ROS Intro | Metaprogramming
- Notes: ROS Eng | Meta Eng | ROS Ita | Meta Ita
- Source: Metaprogramming Source | LLM Context File
- Practice (ROS): Exercise | Solution | LLM Context File
Intensive use of the Standard Template Library (containers, iterators, smart pointers) and the header-only Eigen library for high-performance linear algebra, focusing on memory alignment and geometric transformations.
- Slides:
rp_06_eigen_light.pdf - Notes: STL Eng | Eigen Eng | STL Ita | Eigen Ita
Core implementation of the Distance Map to optimize the Neighbor Search problem and obstacle avoidance, using a modified Dijkstra's algorithm to precompute a lookup grid.
- Slides:
rp_07_dmap.pdf - Notes: English | Italian
- Source: Source Code | LLM Context File
- Practice (DMAP intro): Exercise | Solution | LLM Context File
ROS navigation architecture (Mapping with GMapping, Localization with AMCL, path planning) and advanced formulation of Distance Map localization as an iterative minimization problem solved with the Gauss-Newton algorithm.
- Slides: Navigation | DMAP Localization
- Notes: English | Italian
- Source: Source Code | LLM Context File
Development of path planning algorithms leveraging costs derived from the Distance Map, modeling trajectories on 8-connected graphs based on clearance constraints, and applying heuristic search (like A*).
- Slides:
rp_09_dmap_planning.pdf - Notes: English | Italian
- Source: Source Code | LLM Context File
Practical experiments on GPU parallel computing using NVIDIA CUDA technology.
- Source: Source Code
Practical management of sensors and kinematic transformations on a real robot, configuration of the transform tree (TF and
robot_state_publisher), and dataset recording withros2 bag.
- Slides:
rp_11b_ROS2_robot_setup.pdf
Implementation of a dynamic path planner that reacts to environmental changes by fusing local laser scans with a global distance map.
This project fulfills the final examination requirements by implementing a dynamic path planner fully integrated with ROS.
Core Specifications:
- Local Distance Map: The planner subscribes to the laser scan topic and computes a local distance map in the neighborhood of the robot every time a new scan is received.
- Global Integration: The local map is integrated into the global distance map of the planner, updating the costs (composed by taking the minimum distance values).
- Heuristic Search: The planning algorithm utilizes A*, employing the cost of Dijkstra calculated on the empty map as its heuristic.
- ROS Integration: The output is seamlessly integrated into ROS and designed to work with the standard navigation stack.
Workspace Structure: The project is built as a standard ROS workspace, containing the following core components:
-
src/: The standard ROS source space containing all the project's packages. -
rp_commons/: A core library package providing common data structures, utilities, and the foundational algorithms for Distance Map computation and grid management. -
rp_simulator/: A lightweight simulator package used to emulate the robot's kinematics (unicycle model), laser scanner readings, and interactions within the test world. -
Project Link: Explore the Dynamic Planner Project
The questionnaires/ folder contains a vast collection of Mock Exams to prepare for the final evaluation.
- Mock Exams: Variants B through O
- Past Exam: Simulation in class
- Exam Notes: Exam Considerations (English) | Exam Considerations (Italian)
- Datasets: Required ROS bags or datasets for the exercises can be found in the
data/folder (e.g.,diag_2020-05-06-16-26-03.tgz). - Scripts: The
main.pyfile serves as [Briefly describe what this script does, e.g., generating the LLM context files or automating builds].