musculoskeletal
Experimental
Support for the FlyMimic musculoskeletal body model is
experimental. The API may change in future releases, and only
the left-front leg is muscle-driven in the current model. Not all
features available for the default NeuroMechFly model are
currently supported (e.g. per-leg ground-contact sensors).
World wrapping a self-contained MusculoskeletalFly.
FlyMimic's musculoskeletal MJCF already provides a floor, lighting, and an
anchored thorax, so — unlike the composable FlyGym worlds (FlatGroundWorld
et al.) — this world does not attach the fly into a separately-built scene. It
adopts the fly's MJCF root directly and presents the BaseWorld surface that
plain flygym.Simulation (CPU) consumes. GPUSimulation (flygym.warp) is
also supported but requires the [warp] extra and is not the default path.
MusculoskeletalWorld
¶
Bases: BaseWorld
BaseWorld wrapping a self-contained MusculoskeletalFly.
Unlike the composable FlyGym worlds (FlatGroundWorld et al.), this
world does not build a fresh scene and attach the fly into it.
FlyMimic's musculoskeletal MJCF already provides a floor, lighting, and
an anchored thorax, so MusculoskeletalWorld adopts the fly's MJCF root
directly. Subclassing BaseWorld (rather than just duck-typing) keeps
the type contract honest for the GPU path.
Pair with build_musculoskeletal_simulation for the common case, or
construct directly:
from flygym import Simulation
from flygym.compose import MusculoskeletalFly, MusculoskeletalWorld
fly = MusculoskeletalFly()
world = MusculoskeletalWorld(fly)
sim = Simulation(world)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fly
|
MusculoskeletalFly
|
A |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
ground_geoms |
The floor geom from FlyMimic's MJCF, if present (used by contact-force queries to filter ground hits). |
|
legpos_to_groundcontactsensors_by_fly |
Always |
|
world_dof_neutral_states |
set[str]
|
Empty set (no extra world DoFs; the thorax is anchored, so there is no free joint to manage). |