Difference between data.cvel[1,3:] and mujoco.mj_objectVelocity(model, data, mujoco.mjtObj.mjOBJ_BODY, 1, vel_array, 0) #2602
Unanswered
Longyouyuan
asked this question in
Asking for Help
Replies: 1 comment 4 replies
-
Hi, I am a MuJoCo user. I hope the following helps. There does not seem to be any discrepancy. Could you run the following and confirm? This is an example of a free-falling ball.
This checks out only because there is a single body in the model. |
Beta Was this translation helpful? Give feedback.
4 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 a graduate student at IIT, I use MuJoCo for my research on rope simulation.
My setup
Python/Windows 11/ Mujoco 3.2.2
My question
I want to get the velocity of center of mass of a body with ID 1.
The attribute data.cvel[1,3:] provides the velocity of COM in global frame.
mujoco.mj_objectVelocity(model, data, mujoco.mjtObj.mjOBJ_BODY, 1, vel_array, 0) should also give the linear velocity of COM (inertial frame based on official documentation) in global frame.
However, these two values are different. Do I misunderstand any thing?
Thanks for your help in advance!!!
Minimal model and/or code that explain my question
If you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue).
Model:
minimal XML
Code:
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions