
ContentsSystem Architecture
Moving beyond simple reactive robots requires building systems that can map their environment and plan paths. This guide outlines the architecture for an autonomous rover using ROS 2 (Robot Operating System) and a 2D LiDAR scanner.
System Architecture
The system is split into two levels: high-level planning and low-level control.
- High-Level: A Raspberry Pi running Ubuntu and ROS 2. It interfaces with the RPLiDAR A1, runs the SLAM algorithms to generate a map, and uses the Nav2 stack to calculate a path to a goal coordinate.
- Low-Level: An ESP32 or Arduino that receives velocity commands (cmd_vel) from the Pi over serial, and uses PID control with wheel encoders to ensure the motors actually spin at the requested speeds.
The ROS 2 Navigation Stack (Nav2)
Nav2 is the core of modern autonomous movement. It takes the map generated by your SLAM node and sensor data from the LiDAR to create a "costmap"—a grid where cells near obstacles have a high "cost". The planner algorithm (like A*) finds the lowest-cost path to the destination.
As the robot moves, the local trajectory planner adjusts the path in real-time to avoid dynamic obstacles (like a person walking in front of the robot). This is a significant leap in complexity compared to the reactive systems discussed in our Robotics 101 guide, but it is how real-world autonomous systems operate.

