From Simulation to Walking Robot: MH-FLOCKE on Real Hardware
MH-FLOCKE now runs on a real robot. A Freenove Robot Dog Kit (~100€) with a Raspberry Pi 4 executes the same spiking neural network that learns to walk in the MuJoCo simulator — same code, same weights, same cerebellar architecture.
One Codebase, Two Platforms
The key design decision: the Pi imports src/brain/ directly. There is no separate hardware implementation, no NumPy approximation, no simplified model. The SNNController and CerebellarLearning classes run identically on both platforms. A brain file (brain.pt) trained in simulation loads on the Pi without conversion.
This was made possible by topology.py, a new module that computes cerebellar population sizes without any MuJoCo dependency. Both the simulator’s MuJoCoCreatureBuilder and the Pi’s freenove_bridge.py call the same function.
What Runs on the Pi
The Freenove profile uses 232 neurons — scaled down from the Go2’s 4,624 but with the same cerebellar architecture:
- 48 mossy fiber inputs (12 servo + 2 CPG + 4 IMU + padding)
- 106 granule cells (expansion layer)
- 18 Golgi cells (inhibitory feedback)
- 24 Purkinje cells (2 per actuator)
- 24 DCN neurons (motor correction output)
- 12 output neurons (one per servo)
At 34ms per step (29Hz), the control loop runs fast enough for stable walking. The cerebellar climbing fiber responds to real IMU orientation errors from the MPU6050, and PF→PkC weights grow from 0.078 to 0.114 over a typical session — the cerebellum is learning on real hardware.
The Live Dashboard
A web dashboard on port 8080 shows what the SNN is doing in real time: all six cerebellar populations with live spike activity, servo angles, the competence gate balance, and neuromodulation levels. Every data point comes directly from the running PyTorch SNN.
Try It Yourself
The complete deployment guide, source code, and servo configuration are on GitHub. The Freenove FNK0050 kit costs about 100€ and requires a Raspberry Pi 4 with 2GB+ RAM. PyTorch runs CPU-only on the Pi — no GPU needed.