I am a programmer and motorcycle enthusiast who has built several motorcycle-related hardware projects as a hobby. This time, I wanted to build something that actually drives.
My goal was a simple, self-contained autonomy system: something realistic to implement with my favorite M5Stack / ESP32 hardware, yet accurate enough to make repeatable runs. Rather than relying on SLAM or ArduPilot, I chose to build the localization, sensor fusion, and navigation system myself from scratch.
For positioning, I chose 2D LiDAR. To keep the processing on ESP32 controllers, I developed a method that tracks six flat reflectors placed around the driving area.
The rover follows a custom checkpoint route and drops Othello disks along the way. It makes two laps around the same course, dropping disks at the same locations on the second lap. If the disks stack, the result provides a physical check of the localization and driving accuracy.
There is no external computer in the control loop. Localization, sensor fusion, route following, motor control, and disk dispensing all run on the M5Stack controllers onboard the rover.
The rover divides its work across three M5Stack controllers.
- AtomS3 receives and decodes the RPLiDAR A2M12 point cloud, clusters reflector candidates, matches them against a fixed landmark map, and estimates the rover's global pose.
- CoreS3 controls the four motors, reads encoder and IMU odometry, fuses it with the LiDAR pose, follows the route, and controls the Othello disk dispenser.
- Atom Lite relays commands from a PS4 controller through Bluepad32 for manual driving.
- iPad is a companion interface for telemetry, logs, checkpoint editing, and commands such as starting a run. It does not perform localization or autonomous driving.
This division allowed the autonomous-driving system to remain entirely on the M5Stack / ESP32 hardware.
Earlier Attempt: From UWB to LiDARBefore using LiDAR, I explored positioning from distances to UWB chips (REYAX RYUW122_Lite) placed around the area.
I first tested the concept by mounting the positioning hardware on a helmet and walking through the test area. The M5Stack display showed the walking trajectory in real time.
The experiment revealed that relative chip orientation affected ranging. The results were useful for a walking proof of concept, but were not stable enough for rover control, so I abandoned the UWB approach.
However, the core idea remained: use fixed references around the driving area. That idea evolved into the current method—tracking fixed reflectors with LiDAR.
Global Pose from Fixed LiDAR ReflectorsThe AtomS3 receives the 2D LiDAR scan and processes the point cloud on the ESP32.
Reflectors are detected as landmark candidates and compared with a fixed reflector map. The rover-local point cloud moves and rotates as the rover drives, while the global map stays fixed.
By finding the rotation and translation that align the local point cloud with the reference map, the rover estimates its global X/Y/Yaw pose. Landmark matches are also checked to reject outliers.
The reflectors can be placed around the area without a coordinate survey. Once the initial reflector arrangement is registered, it becomes the rover's fixed reference map.
Even if people or objects block part of the scan, localization can continue while at least three reflectors remain visible.
LiDAR and Odometry FusionLiDAR and odometry have complementary strengths.
LiDAR can correct the rover's global position, but it can temporarily lose reliable landmark observations because of blind spots or occlusion. Encoder and IMU odometry provide smooth motion estimates, but small errors accumulate over time because of wheel slip and drift.
The CoreS3 fuses both estimates:
- When LiDAR is reliable, it corrects the odometry pose.
- When LiDAR is unreliable, odometry maintains a smooth estimate until LiDAR recovers.
This fusion makes the rover more stable than either method alone.
Custom Checkpoint NavigationInstead of conventional waypoint navigation, I built a custom checkpoint navigation system from scratch.
The driving path is generated with Catmull–Rom splines. Unlike a route that only passes near a waypoint, the spline passes through its control points. These control points become meaningful locations on the route—for example, the locations where the rover drops Othello disks.
Checkpoints can be edited or added from the iPad interface. The iPad sends the route data, but the onboard CoreS3 executes the autonomous driving.
Designed and Built from ScratchThe rover uses a one-piece 3D-printed chassis designed to route and conceal wiring inside the body.
It includes four encoder DC motors with Mecanum wheels, an RPLiDAR A2M12, M5Stack controllers, a LiFe battery, and a rack-and-pinion Othello disk dispenser driven by an MG90S servo.
The disk dispenser is not only a visual feature. It turns path-following accuracy into a physical result that can be checked after each lap.
Open-Source AtomS3 LiDAR ExampleI am publishing the LiDAR reception and LCD point-cloud display portion as a standalone AtomS3 example.
The repository includes the basic wiring, RPLiDAR A2M12 reception, point-cloud decoding, and real-time display on the AtomS3 LCD.
Source code:
AtomS3 RPLiDAR point-cloud display exampleThis is a focused, independently runnable subset of the rover software, intended as a starting point for makers who want to use an RPLiDAR with AtomS3.
A Personal M5Stack ConnectionThe Gold Edition CoreS3 used in this rover was my third-place prize in the M5Stack Japan Creativity Contest 2024.
I am happy to use it in my first Global Innovation Contest entry.
M5Stack Japan Creativity Contest 2024 project
This project began with an unsuccessful UWB positioning experiment and developed into a LiDAR reflector-based rover.
The main lessons were:
- Fixed references can provide a practical global coordinate system without SLAM.
- LiDAR and odometry complement each other: LiDAR corrects drift, while odometry bridges temporary LiDAR blind spots.
- Splitting work between AtomS3, CoreS3, and Atom Lite makes it possible to build a complete autonomous rover on M5Stack ESP32 hardware.
The result is not just a rover that follows a route, but a fully onboard M5Stack experiment in localization, sensor fusion, custom navigation, and physical verification.


_h859YXzMfs.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)

_ev7w8evpYW.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)




Comments