How to rotate system of interconnected bodies #2524
Replies: 1 comment 5 replies
-
Maybe you want to wrap everything with a frame? https://mujoco.readthedocs.io/en/latest/XMLreference.html#frame-r |
Beta Was this translation helpful? Give feedback.
5 replies
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.
-
Intro
Hi!
I am quite new to MuJoCo. I've found my way through the basics, though I am stuck at a task that I did not find in any examples nor docs..
My setup
MoJoCo 3.3.0, Python 3.11.9, Win 11.
My question
I need to simulate an object that cannot be described as a single tree with a single root body. I need to connect several simple trees interconnected with welds. The basic example is pasted below (a kind of elastic tetrahedron falling on the floor).
Now, I would like to repeat simulation, starting from randomly rotated initial state. I am working in python. I can to rotate all the positions and quaternions of my object vertices and edges, and the rendering looks correct. But I cannot get correct simulation when starting from the rotated state. The object gets deformed or it is jumping like there were some incorrect forces applied to joints. I attribute this to the problem with rotation of sites that are connected with welds. I tried to apply rotation to the data structure from
mujoco.MjData(model)
, and also tried to compile rotated model created withmujoco.MjSpec
, but with similar problems.How to approach such a simulation task correctly?
Btw.: why there is discrepancy in the quaternions of the
model
andspec
objects, like in the following code (while positions are equal):this results with:
Thanks for any hint!
Minimal model and/or code that explain my question
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions