ODE Joints and Panda Joints

A few clarifications: when I said “absolute space” in the above, I really meant “in the space of the model’s root”. This is only the same thing as render if your overall model is positioned at (0, 0, 0) with no rotation or scale.

But that’s probably not your problem, since you say it works well with the root joint. The problem, then, is that you also have to reconstruct the joint hierarchy within Panda. When you expose a joint, Panda creates a node that it parents directly to the actor root, and every frame it copies the “absolute” (relative to the model root) transform of that joint onto this node.

This means that if you expose all of your joints, you end up with a linear list of nodes, each of them with the “absolute” transform of its corresponding joint.

You need better than that. You need the full hierarchy of nodes, so you can calculate relative transforms. You need a hierarchy of nodes that exactly matches the hierarchy of joints, and each one should have the relative transform of its corresponding joint.

Panda can do this too, but it’s not as automatic. To make it work, you’ll have to first create the hierarchy of nodes yourself. If you don’t already know the hierarchy, you can use part = actor.getPartBundle(‘modelRoot’), then part.getNumChildren()/part.getChild() to walk through the joints recursively.

Then when you call actor.exposeJoint(), pass in the corresponding node as the first parameter, and also pass localTransform = True. This tells Panda to use that node, and to apply the local transform instead of its “absolute” transform.

Or you can try the egg-optchar trick, which might be easier.

David