The fog isn't an animation. It's the robot's own belief.
Recon drops a robot into a map it has never seen and lets you watch it explore with real frontier-based exploration. The fog peels back because the algorithm is deciding where to look next, not because a timer says so.
Press start and a fog-covered grid begins to open, not in a neat expanding circle but in a lopsided, groping front that doubles back on itself, pushes down a corridor, and leaves a pocket unexplored for twenty ticks before circling around to it. Nothing about that reveal is scripted. The fog you're watching is a direct drawing of what the robot doesn't know yet, redrawn every frame, and the shape it peels back in is the algorithm second-guessing itself in real time.
The half that every A* visualizer skips
You have seen the pathfinding-visualizer genre: a grid, a start, a goal, and Dijkstra or A* flooding out to find the shortest route. It's a solved problem and the genre is crowded. It's also, quietly, a cheat. The "unknown" map is fully known to the algorithm the entire time; the search just isn't allowed to use cells outside a radius yet. The maze never changes shape based on what's been seen, because the maze was never hidden.
Recon does the harder half, the part that comes first for an actual mobile robot: you don't know the map exists beyond what your sensor has swept, and you have to decide where to look next using only that partial knowledge. That decision, where do I point my sensor when I can't see the thing I'm deciding about, is the real problem in robotic exploration, and almost nobody visualizes it.
Frontiers: the border between known and unknown
The robot keeps its own occupancy grid, every cell tagged unknown, free, or wall, built
entirely from what its simulated sensor has seen. Each tick it casts Bresenham lines of sight out
to its range, and each ray reveals cells until it hits the first wall and stops. That's the only
information the robot ever gets.
The decision comes from frontiers, a term of art from Brian Yamauchi's 1997 work that still drives real SLAM planners. A frontier cell is a free cell that touches at least one unknown cell: it's a spot the robot has confirmed it can stand on, right on the border of the dark. Go stand on a frontier and sweep, and by definition you learn something new. So the whole exploration loop reduces to: find every frontier, pick one, path to it through known-free space with grid A*, sweep, repeat. When no reachable frontier is left, the map is fully mapped and the run freezes with its coverage, step count, and elapsed time.
The catch is that individual frontier cells are noisy: a single ragged edge can be fifty adjacent frontier cells, and a robot that targets them one at a time jitters like it's indecisive. So Recon clusters adjacent frontier cells into regions first, then scores each region on size minus distance, big nearby gains beating a long trek for a marginal one. Cluster before you choose, and the robot starts to look like it has intent.
No cheating, enforced by two data structures
The design decision I care about most is the one you can't see. There are two separate grids: the ground-truth map, and the robot's belief. The renderer is only ever allowed to read the belief grid. The one place ground truth is touched is computing what a sensor ray should reveal, and that's it. They're kept as two structures with no shared reference precisely so a lazy line of draw code can't accidentally peek at the answer. That's what makes the fog honest: it isn't a mask laid over a known image, it's the belief state itself. When the reveal looks organic, that's not art direction, it's the algorithm's uncertainty rendered literally.
An honest limit: the sensor is a clean, noise-free ray cast, so this is the textbook version of
the problem, not the messy real one where a sensor lies to you and the map has to be corrected.
The core stays deterministic instead, seeded so a run you like replays exactly and the sim's
frontier and pathing logic can be unit tested against known outcomes (the sim/ module sits at
100% line coverage).
Try it
Open Recon and press start; it loads a seeded map with no setup. Watch the robot commit to a frontier, path there, and re-plan when the sweep changes its mind. Drag the speed up to see the whole run in a few seconds, or slow it down and watch a single decision. Hit new map for a fresh seed, since no two explore the same way.
This post is part of the build log: every app my automated factory ships gets written up here, honestly. Browse everything at apps.charliekrug.com. Comments are open below.
Loading comments…