Skip to content
mpena2099Public

About

DarwinBot: evolving robots you can actually build. Bodies from real parts (STS3215 servos, printed links, ESP32) evolved with MAP-Elites, gaits with CMA-ES, simulated in MuJoCo; exports STLs, BOM and control file.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

DarwinBot

Evolving robots designed to be built.

tests Docs License: MIT Python 3.10+ MuJoCo Discussions

Quality-diversity evolution of robot bodies and locomotion controllers, built from real parts so the result can be printed and assembled.

Four evolved robots moving: two trotters, a roller and a belly crawler

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.

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).

What evolution came up with

Body plans found in one run Printable parts of the best robot
Evolved body plans Printable parts of the best robot
Wheels, legs and hybrids, each the best of its region of the map. Every part fits a 220 mm print bed, and links pass a simple bending check at the servo's stall torque.

Trained on four environments: flat floor, bumps, low steps and rubble (all environments).

Full results → (numbers, the archive map and training progress)

Quick start

python -m venv venv && source venv/bin/activate && pip install -e .   # install
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 file

The showcase robots trained on the steer preset (--preset steer: four environments, steering commands), as islands over several days (how to train a showcase).

To watch the showcase robots without training, download their archive from the showcase release:

curl -LO https://github.com/mpena2099/darwinbot/releases/download/showcase-1/showcase.pkl
python experiments/replay.py --archive showcase.pkl --type 13servos-mid-trot --speed 0.5

Documentation

Full documentation: https://mpena2099.github.io/darwinbot/. To preview it locally:

pip install -e ".[docs]"
mkdocs serve

Resumo em português

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: mola de TPU, 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 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. Código e documentação técnica em inglês; os dados de hardware em docs/ estão em português.

License

MIT, see LICENSE. To cite this project, use the "Cite this repository" button on GitHub (CITATION.cff).

About

DarwinBot: evolving robots you can actually build. Bodies from real parts (STS3215 servos, printed links, ESP32) evolved with MAP-Elites, gaits with CMA-ES, simulated in MuJoCo; exports STLs, BOM and control file.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages