Model unable to generate correct thrust. #2991
Unanswered
aaprasad
asked this question in
Asking for Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a graduate student at MIT in the Brain & Cognitive Sciences under Dr. Steven Flavell. I use mujoco to develop neural controllers for C. elegans biomechanical models in order to study the neural computations underlying natural behaviors in C. elegans.
My setup
mujoco 3.7.0, mjx, python, mujoco-playground, ubuntu, nvidia 5090.
My question
TLDR
I'm trying to simulate a C.elegans biomechanical model moving on agar by learning a low-level controller via imitation learning. I'm having issues with learning a realistic policy and I think its coming from issues with the body model itself as well difficulties simulating the agar environment's friction
Problem
I've been collaborating with Dr. Talmo Pereira and his group to integrate a body model into their mimic-mjx platform using imitation learning to train low-level controllers for virtual neuroscience. Although the imitation learning seems to be working, I had been seeing this issue where it seems like the controller has learned to exploit the physics of the model by oscillating the head rapidly in order to generate thrust to propel the body model. Below I've shared a couple videos.
The first is just injecting random noise into the body model's actuators via the mujoco viewer. It seems like the body model is struggling to move much despite the high noise scale.
celegans_mjx_noise-2.mp4
The second is randomly sampling actions from a standard normal distribution in my environment. It seems strange that the head of the model is sort of perpendicular to the rest of the body.
celegans_mjx_random_action.mp4
The final one is an example of the issue with the imitation I've described above. The foreground is the learned neural controller attempting to imitate the expert trajectory which is displayed as the transparent body model in the background.
29_clip.109.mp4
What I've tried
After reading the discussions I saw this conversation with @yuvaltassa and realized that although my body model is in mm (ie the full length of the model adds up to 1 mm), the physical units (e.g gravity, viscosity and density) were in MKS units. I tried scaling the body model so that its in CGS units (the body model length now is 0.1 cm) which required me to switch to the RK4 integrator and decrease armature in order to stabilize the physics but the issue still persisted. I've explored a few parts of the body model that I think could be the issue:
lengthrangesuch that the simulator would converge. However, when I've tried looking in the literature for feasible values, I've had difficulty translating them to mujoco in a way that makes sense as they've usually caused the model to not be able to move at all.I've also shared below the corresponding videos for the CGS version of the model.
celegans_cgs_noise.mp4
celegans_cgs_random_action.mp4
rollout_cgs.mp4
I'd like some feedback on my body model and how I should change it so that I can generate an undulatory sinusoidal forward/backward locomotor pattern with it. Please let me know if you need any clarification, I'm also happy to share any data necessary.
Minimal model and/or code that explain my question
Model:$n$ -link swimmer from
I've taken the C. elegans biomechanical model from this repo. It's based on the
gymnasiumand 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. 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 shared three versions of the body model:celegans_og.xmlis the original body model taken from the above repo, The other two are the xmls for themjx_modelI've dynamically created inmujoco-playgroundusingmjspec.celegans_mjx.xmlis the model I've modified for mjx, andcelegans_cgs.xmlis the mjx model scaled down to cgs units.celegans_bodymodel.zip
Code:
I'm using
mujoco-playgroundwith 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