MuTech Robotics
Join
Kids OK with adultESP32 + ROS 2Level 3/3

Build a ROS 2 Robot: SLAM + Nav2

How a differential-drive ROS 2 robot comes together, from a bare plate to driving itself around a mapped room.

Sign in to save
Build a ROS 2 Robot: SLAM + Nav2
Kids OK, with an adult

DIY project. Children must build this only with an adult (16+ years) beside them at all times. Not suitable for children under 8 years.

Adult supervision recommended. Li-ion batteries need a proper protection board and charger; never short or puncture them.

Strictly follow the description given with this video.

Video

How it works

  1. Two DC gear motors with encoders and wheels, two casters, a 3S Li-ion pack with switch and 5 V step-down, and a dual motor driver form the base.
  2. An ESP32 running micro-ROS drives the motors, counts the encoders and reads the IMU.
  3. A single-board computer runs ROS 2, with a 360° 2D LiDAR on top.
  4. The LiDAR publishes /scan, the ESP32 publishes odometry and IMU, SLAM builds the map, and Nav2 sends /cmd_vel back to the wheels. Turning comes from changing the left and right wheel speeds.

Parts you need

  • ESP32 development board (30-pin)ESP32 development board (30-pin)₹518× 1Buy
  • DC gear motor with encoderDC gear motor with encoder₹747× 2Buy
  • Wheels× 2
  • Caster wheelCaster wheel₹80× 2Buy
  • Dual motor driverDual motor driver₹161× 1Buy
  • 6-axis IMU6-axis IMU₹172× 1Buy
  • Single-board computer (4 GB)Single-board computer (4 GB)₹6,670× 1Buy
  • 360° 2D LiDAR× 1
  • 3S Li-ion pack3S Li-ion pack× 1Buy
  • Buck converter (to 5 V)Buck converter (to 5 V)₹69× 1Buy

Wiring

Motor driver and 5 V buckBatterySingle-board computerand ESP32Buck 5VMotor driver inputsESP32PWM pinsinterrupt pinsI2CUSBEncodersA/BIMUSDA / SCLLiDAR USBCommon GNDAll grounds
PowerGroundSignal
#FromConnect to
1 PowerBattery (via switch)Motor driver and 5 V buck
2 PowerBuck 5 VSingle-board computer and ESP32
3 SignalESP32 PWM pinsMotor driver inputs
4 SignalEncoders A/BESP32 interrupt pins
5 SignalIMU SDA / SCLESP32 I2C
6 SignalESP32 USBSingle-board computer (micro-ROS)
7 SignalLiDAR USBSingle-board computer
8 GroundAll groundsCommon GND

3D print files

This project has no 3D-printed parts.

Code

The tested Arduino / ESP32 code for this project will be posted here, ready to copy.