What is required such that the Joint State component works?

I’ve seen the Joint State component working in some examples.
I can not make it work in my projects.
I added Physics Scene, PhysxAPI, ArticulationRoot and tried out various types of hierarchy setups.
When does it produce values other than zero?

Hello @MartinBischoff! I’ve reached out to the devs for some assistance to your question. In the meantime, here is some information that may help!

The Joint State in create allows the ability to add JointStateAPI to a joint prim. The state API holds the current state of the joint (position and velocity). This API can be used to store joint state in the middle of a simulation and save its current state. The simulation will then continue from this state. Please note that his is currently implemented only for joints that belong to an articulation.

Articulations must have a tree structure in terms of the rigid-body links and the joints between them (loops are possible, however). The tree structure is created solely by the Body 0 and Body 1 relationships of the joints connecting the articulation links (i.e. rigid bodies) - the USD hierarchy has no impact on the articulation structure other than during parsing. Therefore, you may organize the joints and links in the stage tree as you see fit.

I think the issue here is that the parsing is not exactly correct, it creates a fixed joint between the two cubes so you cant really move those. If I create a bit bigger chain like on this video:

Things work as expected, I will try to figure out why this simple articulation fall back to a fixed joint.

Here are my most recent findings:

  • Physics Scene and PhysXAPI are not needed
  • also Hierarchy is irrelevant as long as no RBs are stacked.
  • JointStates work with Articulations only, i.e. an Articulation Root is required in the kinematic chain.
  • All Targets of the Joint for which Joint States are needed require a Rigid Body. Setting no Target, or a Target w/o physics as a fixed anchor in the Stage, makes Joint States to produce 0 values only. Physics are still valid in this case, no errors or warnings appear. Also Joints and Joint Drives still work.

Accordingly, I managed to set up a minimalistic example with working Joint States which consists of the following objects and components:

  • Xform (Anchor):
    • Rigid Body
    • Articulation Root
  • Fixed Joint
    • set one target to anchor, leave the other one empty
  • Cube (Axis):
    • Rigid Body
    • Collider
  • Revolute Joint
    • set targets to Anchor and Axis
    • Joint States

Can you please verify if my statements above are correct?
If they are, I’d suggest to improve Joint States in future versions and make them work also for non-articulation joints and for Joints without Targets or with Targets that don’t have Rigid Bodies.

Yes, that should be correct.

This is on the plan to add support of joint states for maximal coordinate joints (non-articulation), though it needs to be first implemented in the PhysX SDK.