Autonomous Navigation in ROS2

Project 2026

Technical University of Munich

In this work I built a differential drive robot with online asynchronous SLAM and autonomous navigation with ROS2 and Gazebo.

Approach

We simulate a differential-drive robot in Gazebo and run SLAM and goal-based navigation in three steps. First, the robot builds an occupancy grid map of its environment using SLAM. Next, we select a goal point on that map. Finally, the robot plans a path and autonomously drives to the goal. Throughout, we show what the robot perceives in ROS 2 using RViz: its laser scans, the camera input and the map as it forms.

The approach is built on the following packages:

  • Robot description (xacro/URDF): the robot model is assembled from separate xacro files for the chassis, wheels, lidar, and camera.
  • ros2_control: a differential-drive controller turns velocity commands into wheel speeds and computes wheel odometry from the wheel encoders.
  • slam_toolbox: matches laser scans against each other to build the environment map and continuously correct the robot's position within it.
  • Nav2: plans a global path to the goal, follows it with a local controller and avoids obstacles using costmaps.
  • tf2 (transform tree): links the map → odom → base_link → sensor frames so that every component shares a consistent picture of where the robot and its sensors are.

Simulation