pinocchio icon indicating copy to clipboard operation
pinocchio copied to clipboard

Start implementing changeRootJoint

Open jcarpent opened this issue 5 years ago • 11 comments

jcarpent avatar Oct 06 '20 20:10 jcarpent

Related to #1308.

jcarpent avatar Oct 06 '20 20:10 jcarpent

In this PR, it is still needed to inverse the joint placements, change the inertias and the frame placements according to the new root joint.

jcarpent avatar Oct 06 '20 20:10 jcarpent

One note about that (not sure if it is relevant): the degrees of freedom on the chain from (old root) to (new root) should be "backward" if you want that the same q state vector to produce the same configuration

Gregwar avatar Oct 06 '20 21:10 Gregwar

One note about that (not sure if it is relevant): the degrees of freedom on the chain from (old root) to (new root) should be "backward" if you want that the same q state vector to produce the same configuration

Yes this is precisely the content of my previous comment and what I have started to implement. Did you check the code?

jcarpent avatar Oct 07 '20 05:10 jcarpent

One note about that (not sure if it is relevant): the degrees of freedom on the chain from (old root) to (new root) should be "backward" if you want that the same q state vector to produce the same configuration

Yes this is precisely the content of my previous comment and what I have started to implement. Did you check the code?

isn't this breaking compactness on which some algorithms rely ?

jmirabel avatar Oct 07 '20 07:10 jmirabel

Normally not.

jcarpent avatar Oct 07 '20 07:10 jcarpent

I am not sure to understand how it is possible to have the same configuration order for the original model and the re-rooted model, while keeping the fact that all the child joints of a joint A corresponds to the n DoFs following the parameter of joint A...

Anyway, I think this is a useful feature. Thanks for implementing it.

jmirabel avatar Oct 07 '20 07:10 jmirabel

No, the configuration order will change. This is the role of the user to provide the correct configuration. For all the basic joints except the FreeFlyer, SphericalZYX and Composite this is possible.

jcarpent avatar Oct 07 '20 07:10 jcarpent

The fact that the configuration order will change should indeed be specified on the documentation, a common thing the user will want is to write some code to remap the values of its model data from the original model to the re-rooted one. My comment above is that the values themselves could be compatible (which I guess is what @jcarpent also wants).

Thanks as well for implementing this.

Gregwar avatar Oct 07 '20 08:10 Gregwar

@Gregwar It would be nice if you can provide some help on this feature. For instance, the remaping function for joints configuration, so far an so on.

jcarpent avatar Oct 07 '20 08:10 jcarpent

I am not sure what is your philosophy here: do you want the values of the joints to be compatible with the re-rooted robot or not?

As a simple example; will a revolute joint axis that is on the re-root support in the tree have its orientation inverted (newAxis=-axis) or not?

Gregwar avatar Oct 12 '20 14:10 Gregwar