How to get global position, linear velocity, orientation and angular velocity #2575
-
IntroHi! I am a student at UNED, I use MuJoCo for my research on human motion generation. I'm trying to replicate Control-VAE using MuJoCo, but I'm yet very noob with it. My setupPy-MuJoCo My questionI need to get the bodies position, linear velocity, orientation and angular velocity in the with regard to global frame for every body in a humanoid model (not the same but similar to the one that you can found in the MuJoCo environment in the gymnasium package). I think that i can get the position using the global position using the Minimal model and/or code that explain my questionimport mujoco model_xml = """ model = mujoco.MjModel.from_xml_string(model_xml) data.ctrl[0] = 0.1 for step in range(421): vel_array = np.zeros(6) print("Linear velocity for body '{}':".format("body0"), vel_array) Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You probably want |
Beta Was this translation helpful? Give feedback.
-
This solve my doubt, thanks! |
Beta Was this translation helpful? Give feedback.
You probably want
mjOBJ_XBODY
. "BODY" is the inertial frame of the body, "XBODY" is the traditional body frame. Not great naming, I know...