Isaac Sim Version
4.2.0
Operating System
Ubuntu 22.04
Topic Description
Detailed Description
With python scripting components, I am able to import the Articulation and ArticulationAction libraries. Through these, I can create an ArticulationAction which contains joint position or joint velocity commands. I can then apply that ArticulationAction to an Articulation with the apply_action function, and I can also get the joint position/velocity state data from the Articulation.
Is it possible to do all this via a cpp extension instead? If so, is there example code or relevant documentation?
EDIT:
I did find this website: Articulations ā physx 5.5.0 documentation
However, I am unsure how exactly to go about integrating this in the context of an Isaac Sim cpp extension. Particularly, I am unsure how to go about taking an existing prim with an articulation root in my scene and extracting the corresponding physx related objects that this link uses.
1 Like
I also have this question! It seems like it may be possible to setup a new articulation in the startup function of an extension but Iām not entirely sure. Would also love to get some answers on this question!
Hi,
in some limited way you can interact with the joints directly through C++ code.
For example one can add JointStateAPI to a joint that belongs to an articulation and then you can access the position/velocity data through the joint state API attributes.
See: PhysxSchemaJointStateAPI Class Reference
Additionally you can set the joint drive target velocity or position in a similar matter, just note that the attribute names are a bit more complex in this case, because all those APIs are multiple applied APIs and it depends on the DOF what the final attribute name is. You can apply those APIs in the editor and check the attribute names in the property window by hover over the mouse.
Regards,
Ales
Thanks @AlesBorovicka, so there is no API at the moment that parallels the articulation API that python has? Are there any limitations in terms of fidelity or behavior that would occur by controlling joints via the JointStateAPI (as opposed to an Articulation API of some sort)?
I ask because often documentation pushes the superiority of Articulations (such as here Articulations ā physx 5.5.0 documentation)
The articulation API provides a batched optimized version, controlling individual joints will be limiting.
@AlesBorovicka, it seems like there is a Physx C++ api related to articulations as shown here ( Articulations ā physx 5.5.0 documentation). Of course, this is not necessarily Isaac Sim related.
I installed the physx library in my isaac sim container and have access to it with the hopes of implementing my own isaac sim C++ articulation interface, but I am not quite sure how to bridge the two (like access anything from Isaac Sim that will result in a Px related object or vice versa). Do you have any insight or recommendation as to how to get started with that? Or would you recommend instead just controlling the joints individually in C++?
Yes, this is possible technically, the problem is that we dont have an example how to access those C++ interfaces and how to work with those. Nor are these packages with the headers publicly available.
We dont encourage people to use the raw pointers from omni.physx and then leverage PhysX SDK capabilities directly on top of that, because you are simply not the owner of the objects.
This is currently not possible because we dont expose those interfaces to public, sorry about that. I would love to expose those with samples, but I was not able to do so so far.
Regards,
Ales
@AlesBorovicka, okay fair enough. I did notice as well that the C++ dynamic control library seems to have an articulation API. What is your opinion on using this library? From what I understand, it is being deprecated.
Just to make sure I understand and summarize, besides maybe the dynamic control library, the only articulation API is via python, correct? And we can control joints individually in C++, however, this results in a lower quality, unoptimized simulation of the manipulator?
Its probably not the best idea to use it, as its removed in next release if I see the repository correctly.
Correct, with the tensorAPI you have access to all joints in the articulation, while through the USD/USDRT you are controlling always just one attribute and that results in one call to PhysX, while the tensorAPI is a batched call to PhysX additionally on the GPU.
The access to the C++ headers would help you here, but thats something on me to finally push through after all those years, but there is always more important work, sorry.
Ales