You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a graduate student at MIT, I use MuJoCo for my research on celegans neuromechanics.
My setup
Mujoco/mjx 3.4.1 python, linux 5090 cuda 12.
My question
I'm trying to train a model of neuromechanical model of c.elegans to imitate real animals behaviors and I'm able to get it to successfully imitate forward locomotion, however, backwards locomotion has been impossible! This is quite strange to me because as far as I can tell, the model is pretty much symmetric (slightly different lengthranges at the muscles and the tail is missing 1 muscle as in the real animal) and the assymetries that do exist shouldn't impair it this much right? I feel like it has to do with some small thing in the body model that I'm not understanding. I tried reversing the actions from a forward locomotion rollout as well as reverseing the actions and flipping the left and right muscle actions and it seems to push the model forwards from the tail rather than pull it backwards along the tail. I've attached a few videos below demonstrating the issue.
successful forward locomotion:
Minimal model and/or code that explain my question
Model:
I've taken the C. elegans biomechanical model from this repo. It's based on the $n$-link swimmer from gymnasium and contains 25 body components with corresponding meshes. The total length of the model is 1mm. I am trying to simulate a worm on agar so I'm using air as the medium. It is constrained to 2D movement in the xy plane with 24 joints hinge joints actuated by 95 muscles. Each joint is actuated by a set of 4 muscles organized into dorsal/ventral and left/right Except for the last one which is missing its ventral left muscle (as in the real animal). In order to get the model to work efficiently with mjx I removed mesh contact computation and used collision geoms instead. I also only kept contacts between the floor and the body (ie no inter body contact). I've also scaled the model to CGS units so its 0.1 cm etc.
Hi there,
First of all, congrats on the great work.
I was wondering if you ever managed to get the backward locomotion working?
Could it be that this isn't a physics or friction bug, but rather a Reinforcement Learning bottleneck?
Since the head is perfectly symmetric, learning forward locomotion is a relatively "easy" policy for the agent to discover (symmetric waves = straight forward movement). However, moving backward means the asymmetric tail has to act as the leading engine. To maintain a straight trajectory backwards, the network would have to learn a highly unintuitive, asymmetric contraction pattern to compensate for that missing muscle.
Also, was there a specific reason you chose to override the anisotropic friction from the original XML?
I will try setting up this exact 3D model to be controlled by my own Spiking Neural Network (SNN) model. If I make any progress, I will make sure to share my results and findings here.
Thanks again for open-sourcing your work!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a graduate student at MIT, I use MuJoCo for my research on celegans neuromechanics.
My setup
Mujoco/mjx 3.4.1 python, linux 5090 cuda 12.
My question
I'm trying to train a model of neuromechanical model of c.elegans to imitate real animals behaviors and I'm able to get it to successfully imitate forward locomotion, however, backwards locomotion has been impossible! This is quite strange to me because as far as I can tell, the model is pretty much symmetric (slightly different lengthranges at the muscles and the tail is missing 1 muscle as in the real animal) and the assymetries that do exist shouldn't impair it this much right? I feel like it has to do with some small thing in the body model that I'm not understanding. I tried reversing the actions from a forward locomotion rollout as well as reverseing the actions and flipping the left and right muscle actions and it seems to push the model forwards from the tail rather than pull it backwards along the tail. I've attached a few videos below demonstrating the issue.
successful forward locomotion:
forword_locomotion.mp4
failed learning of backwards locomotion:
media_videos_videos_rollout_2_563878cc95f30509b5e0.mp4
time Reversed rollout:
reversed_locomotion.mp4
time reversed + directionally flipped rollout:
reversed_flipped_locomotion.mp4
Minimal model and/or code that explain my question
Model:
$n$ -link swimmer from gymnasium and contains 25 body components with corresponding meshes. The total length of the model is 1mm. I am trying to simulate a worm on agar so I'm using air as the medium. It is constrained to 2D movement in the xy plane with 24 joints hinge joints actuated by 95 muscles. Each joint is actuated by a set of 4 muscles organized into dorsal/ventral and left/right Except for the last one which is missing its ventral left muscle (as in the real animal). In order to get the model to work efficiently with mjx I removed mesh contact computation and used collision geoms instead. I also only kept contacts between the floor and the body (ie no inter body contact). I've also scaled the model to CGS units so its 0.1 cm etc.
I've taken the C. elegans biomechanical model from this repo. It's based on the
celegans_body_model.zip
Code:
I'm using mujoco-playground with mjspec to dynamically change the floor and other parameters. I instantiate the model as follows:
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions