get_data is slow with mjx #2718
Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
Hi @jstmn - can you say a bit more about why you want to transfer You have two options:
|
Beta Was this translation helpful? Give feedback.
-
Hey, sorry for the delay.
Yep - I'll be using mjx in a sampling based MPC application. Ballpark numbers, I need to have 100 parallel environments each taking ~16 simulation steps. This will be happening as fast as possible to control a robot. Each of the resulting 100*16 simulation states will be evaluated by a reward function A more representative task will a Panda pick-cube task like this one: https://github.com/google-deepmind/mujoco_menagerie/blob/main/franka_emika_panda/mjx_single_cube.xml
Getting only the robots joint angles and the pose of the objects would work, but option 2 sounds more appropriate
This would work for me! I'm new to mjx / mujoco though. Would you mind showing me how for example I can get a batch of joint angles of the robot? Thanks |
Beta Was this translation helpful? Give feedback.
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 USC, I use MuJoCo for my research on robotic manipulation.
My setup
My question
I've noticed that
mjx.get_data()
is really slow. Here's some timing data:I'll need to retrieve the sim's state after every few steps, so this will be prohibitively expensive. Is there some way to speed this call up?
Is there a jitted version of
mjx.get_data
?Minimal model and/or code that explain my question
This code is from the mjx tutorial notebook https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/mjx/tutorial.ipynb#scrollTo=rrdrcKRVK6w9
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions