Simulating embodied sensorimotor control with NeuroMechFly v2
215
stars
477
commits
Python
primary language
Aug 24, 2026
updated
[!IMPORTANT] We introduced a new FlyGym 2.x.x API in March 2026, with a complete code rewrite and redesigned interface. This version delivers significantly improved performance:
- ~10x speed-up for CPU-based simulations (~2x real-time throughput)
- ~300x speed-up for GPU-based simulation via Warp/MJWarp (~60x real-time throughput)
Additional improvements include:
- Improved scene composition workflow
- Interactive viewer
- Simplified dependency stack
This version is not backward compatible, and not all features from FlyGym 1.x.x are available. Feature requests can be submitted via Issues on the Github repository. See more information about the changes here.
Prefer the old version? FlyGym 1.x.x has been migrated to
flygym-gymnasium. Its documentation has been migrated to gymnasium.neuromechfly.org.

Documentation | Paper | Discussion Board

This repository contains the source code for FlyGym, the Python library for NeuroMechFly v2, a digital twin of the adult fruit fly Drosophila melanogaster that can see, smell, walk over challenging terrain, and interact with the environment (see our NeuroMechFly v2 paper).
NeuroMechFly consists of the following components:
This package is developed at the Neuroengineering Laboratory, EPFL.
For installation, see the documentation page.
To get started, follow tutorials here.
Python
91.6%
JavaScript
6.5%
HTML
1.5%
Simulating embodied sensorimotor control with NeuroMechFly v2
215
stars
477
commits
Python
primary language
Aug 24, 2026
updated
[!IMPORTANT] We introduced a new FlyGym 2.x.x API in March 2026, with a complete code rewrite and redesigned interface. This version delivers significantly improved performance:
- ~10x speed-up for CPU-based simulations (~2x real-time throughput)
- ~300x speed-up for GPU-based simulation via Warp/MJWarp (~60x real-time throughput)
Additional improvements include:
- Improved scene composition workflow
- Interactive viewer
- Simplified dependency stack
This version is not backward compatible, and not all features from FlyGym 1.x.x are available. Feature requests can be submitted via Issues on the Github repository. See more information about the changes here.
Prefer the old version? FlyGym 1.x.x has been migrated to
flygym-gymnasium. Its documentation has been migrated to gymnasium.neuromechfly.org.

Documentation | Paper | Discussion Board

This repository contains the source code for FlyGym, the Python library for NeuroMechFly v2, a digital twin of the adult fruit fly Drosophila melanogaster that can see, smell, walk over challenging terrain, and interact with the environment (see our NeuroMechFly v2 paper).
NeuroMechFly consists of the following components:
This package is developed at the Neuroengineering Laboratory, EPFL.
For installation, see the documentation page.
To get started, follow tutorials here.
Python
91.6%
JavaScript
6.5%
HTML
1.5%