Get_dof_state doesn't work

Hi, I’m following this snipet of code from Dynamic Control [omni.isaac.dynamic_control] — isaac_sim 2021.2.0-beta.121 documentation and it seems to be outdated. Can you update line 16?

dof_state = dc.get_dof_state(dof_ptr)

Because as it shows in Dynamic Control [omni.isaac.dynamic_control] — isaac_sim 2021.2.0-beta.121 documentation, get_dof_state takes 2 arguments. I don’t know about is the second one and how to get it.

The second argument is a state flag telling the command what information you wan to acquire.

https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.dynamic_control/docs/index.html?highlight=state_all#state-flags

We have plans to add docstring types but it s a slow manual process, we can add them for some of the core functions with our next release hopefully

1 Like

I’m a little bit confused, when I want to get the state via get_dof_state(...), should the second argument always be _dynamic_control.STATE_ALL ? What would happen if I give another state, for e.g. _dynamic_control.NONE or _dynamic_control.POS ? What is the logic behind it?

Generally you can use STATE_ALL, but if you don’t need everything, there is slightly less overhead if you specify exactly what you need.

The API mirrors set_dof_state where you usually don’t want to use STATE_ALL, but set a specific state like position, to teleport a joint to a specific angle.

1 Like

I see, thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.