Difference between get_actor_dof_states and acquire_dof_state_tensor

I am working on the quadruped robot XterraRobotics SvanM2 and I have spawned it in isaac gym. I am doing some experiments to gain some clarity on the frames and reference for various quantities that the isaac gym api gives me.

Using gym.set_actor_dof_states(env.envs[0], 0, dof_state_list ,1) I have set the dofs of each joint of the robot. The robot in such a position looks like the following. You can also observe the joint values for the FL Hip and FL Thigh joint which are respectively 0.6 and 1.3. And these are indeed the values that I am setting. So the GUI shows the right value and the robot’s dofs do go where the api asks them to go.

Curiously, when I obtain the joint DOF values through the following use of gym API:

    dof_state_tensor = self.gym.acquire_dof_state_tensor(self.sim)
    self.gym.refresh_dof_state_tensor(self.sim)
    dof_state = gymtorch.wrap_tensor(dof_state_tensor)
    dof_pos = self.dof_state.view(self.num_envs, self.num_dof, 2)[..., 0]
    print("DOF Pose: ", dof_pos)

I am obtaining very different values for the DOFs. The corresponding two values (for the ones I have noted previously) are 0.4174, 1.0286. For the sake of completeness, I’ll add all the DOF states:

Can anybody please clarify this discrepancy? Why are the quantities obtained through acquire_dof_state_tensor not the same as the ones in the GUI?

Did your print code excuted after pre_physics_step? the pos might already been updated, try to set the velocity to 0 and print again.