Problem using xpos to obtain the location of the xml file loaded model #1985
Unanswered
MingchaoQi
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
-
Hi,
I'm a student and I'm trying to use MuJoCo for homework.
I'm looking for some help with obtaining joint position coordinates.
I wrote an xml file to represent the drawer.
Here I want to get the position coordinates of the joint, but the coordinates obtained are always [0, 0, 0]. Here is my code:
self.object_joint_ids["cabinet_joint"] = self.sim.model.joint_name2id(self.cabinet_object.cabint_joint)
(or self.cabinet_qpos_addrs = self.sim.model.get_joint_qpos_addr(self.cabinet_object.joints[0]))
cabinet_joint_pos = self.sim.data.xpos[self.cabinet_qpos_addrs]
Can you answer this for me? Thanks you!
Beta Was this translation helpful? Give feedback.
All reactions