← Back to blog

IRIN: A* planning and evolved neural controllers for the e-puck (UPM)

· IRIN (Introducción a la Robótica Inteligente) · UPM, 3rd year

In the third year of the bachelor, the IRIN course (Introducción a la Robótica Inteligente) introduced me to the two big ideas of robot intelligence: search — planning a path when you know the world — and learning — letting the robot’s own experience (or evolution) shape its behaviour. The two mandatory assignments, both solved with the e-puck robot in the Webots simulator (Grupo 22), produced the two repos below — each now with an interactive web edition where you can run the algorithms yourself.

🤖 O1 — Subsumption architecture and A* path planning

The first assignment (April 2019) gave the e-puck a layered brain: a subsumption architecture with behaviours for wandering, obstacle avoidance, goal-seeking and recharging, and a navigation layer that plans routes with A* search on a 20×20 occupancy grid built from the robot’s ground-memory sensor. The planner expands states in order of the evaluation function \[ f(n) = g(n) + h(n) \] where \(g(n)\) is the cost from the start and \(h(n)\) an admissible heuristic — here the Chebyshev distance \[ h(x,y) = \max\bigl(|x - x_{\text{goal}}|,\; |y - y_{\text{goal}}|\bigr) \] with a straight-line bias (straight moves cost 0 extra, diagonals 2, priority \(f = g + 10h\)). Because \(h\) never overestimates, the first route found is guaranteed optimal. The web edition animates the search: amber = open set, blue = closed set, green = the final route, on the same 20×20 grid the robot planned on:

IRIN O1 web edition: animated A* search with amber open set, blue closed set and green route on the 20x20 grid

🤖️ O2 — An evolved neural controller

The second assignment (May 2019) dropped the hand-programmed logic: a genetic algorithm evolved the e-puck’s neural controller (ANN and CTRNN variants) directly. Each genome is the weight vector of a small network — 8 proximity rays → 4 hidden units → 2 wheels — evaluated in the simulator with the classic Nolfi–Floreano fitness, computed every step: \[ f = V\,(1 - \sqrt{\Delta v})\,(1 - i) \] where \(V\) is the translational speed (drive fast), \(\Delta v\) the wheel-speed difference (drive straight) and \(i \in [0,1]\) the strongest proximity reading (avoid walls). The GA uses tournament selection, uniform crossover, Gaussian mutation \(\mathcal{N}(0, \sigma^2)\) with \(\sigma\) annealing by 0.996 per generation, and elitism. The web edition runs this evolution live in the browser — watch the best robot improve generation by generation as the fitness curve climbs:

IRIN O2 web edition: live neuroevolution with the best robot driving, proximity rays visible, and the fitness curve climbing

🎓 What the course gave me

  • Search vs learning: A* when you can model the world, evolution when you cannot — the two halves of robot intelligence.
  • Subsumption thinking: complex behaviour from simple, layered behaviours with priority.
  • Evolutionary robotics: fitness design (the Nolfi–Floreano formula is a masterclass in encoding “go fast, go straight, don’t crash” into one number) and the GA operator toolbox.
  • Webots: my first serious robot simulator — years before drones and LLMs.

GitHub · irin_o1 GitHub · irin_o2 Play O1 · A* Play O2 · Evolution Webots e-puck · UPM · 2019