Evolving robots designed to be built.
Quality-diversity evolution of robot bodies and locomotion controllers, built from real parts so the result can be printed and assembled.
Every robot is a tree of real modules (Karl Sims and Revolve2 style) driven by Feetech STS3215 servos. Bodies are evolved with a MAP-Elites archive laid out by behaviour and cost, while a central pattern generator with load feedback (Tegotae) is tuned with CMA-ES for each candidate body. Any robot in the archive can be exported as printable parts, a bill of materials and a control file for an ESP32. The firmware core exists, but the ESP32 layer is not written yet.
Status: the robots are evolved and validated in simulation only. No robot has been printed or assembled yet, the parts have never been fitted together, and the servo measures they are built around are placeholders until a real STS3215 is measured. Treat an export as a design to check, not a kit known to work. Building the first one is the next milestone (roadmap).
Trained on four environments: flat floor, bumps, low steps and rubble (all environments).
Full results → (numbers, the archive map and training progress)
python -m venv venv && source venv/bin/activate && pip install -e ".[cad]" # install (cad: STL parts)
python experiments/train.py # evolve (flat ground)
python experiments/replay.py --list # see the robot types, then:
python experiments/replay.py --type 8servos-mid-trot # watch one
python experiments/export.py --type 8servos-mid-trot # parts, BOM, control fileThe showcase robots trained on the steer preset (--preset steer: four
environments, steering commands), as islands over several days
(how to train a showcase).
To train for your own limits (no wheels, at most N servos, a number of legs,
a smaller printer) without writing the command by hand, fill in the
command builder; the
options are described in
Your robot. For other
servos, another battery or a different printer, copy the default
hardware profile
and pass it with --profile. To start from a robot you drew yourself, write
it as YAML and seed an archive with experiments/seed.py
(Starting from your own design).
To watch the showcase robots without training, download their snapshot from the showcase release:
curl -LO https://github.com/mpena2099/darwinbot/releases/download/showcase-2/showcase.snap.pkl
python experiments/replay.py --snapshot showcase.snap.pkl --list
python experiments/replay.py --snapshot showcase.snap.pkl --type flat-3servos-low-roll --speed 0.5The release also carries the archives (showcase-*.pkl and long8-*.pkl, body model 23);
experiments/migrate_archive.py brings it up to the current code.
Full documentation: https://mpena2099.github.io/darwinbot/. To preview it locally:
pip install -e ".[docs]"
mkdocs serve- Gallery: interactive map of the archive and a 3D replay of each robot
- Beginner guide to evolutionary algorithms: English · Português
- Control file format and hardware data (Portuguese)
- Related work: where DarwinBot sits among other evolvable-robot projects
- Contributing
Quem está começando com algoritmos evolutivos pode ler antes o guia em português.
O DarwinBot inventa robôs e ensina cada um a andar, numa simulação física
(MuJoCo). A evolução decide o corpo, uma árvore de módulos: quantas pernas, de que
tamanho (medidas contínuas, em milímetros), em que direção cada junta gira, onde
cada peça se prende no tronco, e se a perna termina numa roda. Há também módulos
passivos sem servo: cauda com contrapeso, patim, espeto e roda
livre. Só entram corpos que a impressora e o servo aguentam: peças de até
220 mm, links que não dobram sob o torque do servo e tronco cortado em placas
emendadas. Para cada
corpo, um otimizador (CMA-ES) procura o ritmo de movimento das juntas, com dois
harmônicos e um retorno da carga dos servos, que leva o robô mais longe. Em vez de
um único vencedor, o programa guarda o melhor robô de cada comportamento (MAP-Elites
por tempo de contato com o chão, altura do tronco, número de servos, número de
pernas e custo de transporte), formando um
catálogo de soluções diferentes. Os robôs são montados com peças reais (servos
STS3215, peças impressas em 3D, ESP32 e bateria LiPo), treinados com física
propositalmente variada para resistir às diferenças entre simulação e mundo real,
e qualquer um deles pode ser exportado como peças STL, lista de materiais, guia de
montagem e arquivo de controle. O núcleo do firmware já existe, mas a camada do ESP32 ainda não foi escrita. Quem quiser limitar o corpo (sem rodas, poucos
servos, impressora menor) monta o comando de treino no
montador de comandos. Código e documentação técnica em inglês; os dados
de hardware em docs/ estão em português.
MIT, see LICENSE. To cite this project, use the "Cite this
repository" button on GitHub (CITATION.cff).


