Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce meaningful initial joint ordering for chain models #491

Closed
traversaro opened this issue Sep 16, 2018 · 20 comments
Closed

Enforce meaningful initial joint ordering for chain models #491

traversaro opened this issue Sep 16, 2018 · 20 comments
Milestone

Comments

@traversaro
Copy link
Member

Using the new parser introduced in #460, it is possible that joints of a chain model are loaded out of order.

Why the precise mapping between joint indexes and joint names cannot be fixed, at least the simple invariant that a chain robot with joints joint_0, joint_1, joint_2, ... should be have index 0, 1, 2, etc etc should be respected. This is especially required by industrial robots.

@traversaro
Copy link
Member Author

I think this can be implemented as a pass on the model after the model has been loaded, similarly to the process we use to remove "fake" link and transform them in additional frames.

@traversaro
Copy link
Member Author

Note that the problem was actually there also with the old parser, the new parser just highlighted the issue.

@ahoarau
Copy link
Member

ahoarau commented Sep 18, 2018

Hello again ! We are now 5 people working on this and we tried to load a human urdf.
The order of joint in the chains is not respected. Here's the files to debug the issue :

human_joint_wrong_order_as_given_by_iDynTree.txt
human_joint_names_ordered.txt
human_model_fixed_base.urdf.txt

Thanks again for your help !

@ahoarau
Copy link
Member

ahoarau commented Sep 20, 2018

And icub is strangely missing 1 dof with this PR.

@traversaro
Copy link
Member Author

The order of joint in the chains is not respected.

I am not sure how you define the "correct" ordering for a tree kinematic structure. The order with which the joint elements appear in the URDF file? The problem is this criteria can be conflicting with the "normalized" order as introduced in #492 .

@ahoarau
Copy link
Member

ahoarau commented Sep 20, 2018

You're right it's not trivial. In what order does gazebo load the joints ?

@pattacini pattacini changed the title Enfore meaningful initial joint ordering for chain models Enforce meaningful initial joint ordering for chain models Sep 21, 2018
@traversaro
Copy link
Member Author

In what order does gazebo load the joints ?

Not really sure, but to be honest the Gazebo API does not really use joint/dof serialization a lot (for example there are no methods to get/set joint positions/velocity/accelerations as a vector .

@traversaro
Copy link
Member Author

And icub is strangely missing 1 dof with this PR.

This is strange. Which one?

@ahoarau
Copy link
Member

ahoarau commented Sep 24, 2018

False alarm on my tests.. mister @rlober ?

@ahoarau
Copy link
Member

ahoarau commented Sep 28, 2018

@traversaro False alarm, 32 joints loaded with and without the PR. Good to go sir !

@ahoarau
Copy link
Member

ahoarau commented Sep 28, 2018

I am not sure how you define the "correct" ordering for a tree kinematic structure. The order with which the joint elements appear in the URDF file? The problem is this criteria can be conflicting with the "normalized" order as introduced in #492 .

Very true. If nothing is ordered, then maybe having an ordered map could at least help visibility.
Example on the icub : The torso joints indexes are very far from each other.

     Joint 0: 'torso_roll'
     Joint 1: 'torso_pitch'    
     # Many more joints ....
    Joint 20: 'torso_yaw'

What do you think ?

@traversaro
Copy link
Member Author

"Having an ordered map" in which sense? The Model::getJointIndex(const std::string &jointName) method should basically implement that. Do you think a separate method to obtain a map of some kind would be more useful?

@ahoarau
Copy link
Member

ahoarau commented Sep 28, 2018

I meant order them alphabetically as a rule of thumb, just to improve readability.
I know it's a weak ordering, but usually jonts that are close to one another (like torso_yaw, _pitch, _roll) maybe expected to be found next to each other in the final joint ordering.
Having :

     Joint 0: 'torso_roll'
     Joint 1: 'torso_pitch'    
     # Many more joints ....
    Joint 20: 'torso_yaw'

is very strange. You'd expect them to be 0-1-2 (or 18-19-20).

@traversaro
Copy link
Member Author

Mhh, the problem is that pure alphabetic ordering will fail to work for chains (unless the name of the chain are joint_1, joint_2, etc. I need to think a bit about it.

@ahoarau
Copy link
Member

ahoarau commented Sep 28, 2018

Yes this remark is only valid for non-chains.

@ahoarau
Copy link
Member

ahoarau commented Aug 26, 2019

any news on this issue ?

@traversaro
Copy link
Member Author

traversaro commented Aug 26, 2019

I try to get #492 merged before the end of September, for release 0.12, that I need to use for an IIT-internal project.

@traversaro traversaro added this to the iDynTree 0.12 milestone Aug 26, 2019
@ahoarau
Copy link
Member

ahoarau commented Nov 13, 2019

Any news on this and 0.12 release ?

@traversaro
Copy link
Member Author

Any news on this and 0.12 release ?

Thanks for the ping, we'll try to do a release by the end of November.

@traversaro
Copy link
Member Author

Fixed by #492 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants