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
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
- 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.
- An ESP32 running micro-ROS drives the motors, counts the encoders and reads the IMU.
- A single-board computer runs ROS 2, with a 360° 2D LiDAR on top.
- 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
Wiring
PowerGroundSignal
| # | From | Connect to |
|---|---|---|
| 1 Power | Battery (via switch) | Motor driver and 5 V buck |
| 2 Power | Buck 5 V | Single-board computer and ESP32 |
| 3 Signal | ESP32 PWM pins | Motor driver inputs |
| 4 Signal | Encoders A/B | ESP32 interrupt pins |
| 5 Signal | IMU SDA / SCL | ESP32 I2C |
| 6 Signal | ESP32 USB | Single-board computer (micro-ROS) |
| 7 Signal | LiDAR USB | Single-board computer |
| 8 Ground | All grounds | Common 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.