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

Fix materials exported in URDF file #36

Closed
traversaro opened this issue Dec 13, 2016 · 9 comments
Closed

Fix materials exported in URDF file #36

traversaro opened this issue Dec 13, 2016 · 9 comments
Assignees

Comments

@traversaro
Copy link
Member

Currently all the models exported using the creo --> simmechanics --> urdf workflow do not properly export materials.
For example if you load of today any URDF in iDynTree, you get the following warnings:

`[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material green not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material green not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material black not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material red not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material blue not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material yellow not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material pink not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material cyan not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material green not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material white not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material dblue not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material dgreen not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material gray not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material green not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material black not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material red not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material blue not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material yellow not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material pink not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material cyan not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material green not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material white not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material dblue not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material dgreen not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material gray not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material green not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material black not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, material red not found in model database.
[ERROR]  :: parseURDFMaterial : Impossible to parse URDF material, setting material to white.
traversaro added a commit to robotology/idyntree that referenced this issue Dec 13, 2016
Until the issue is not solved in the icub models, see robotology/icub-models-generator#36 .
Ugly workaround, but will permit to merge robotology-legacy/yarp-wholebodyinterface#63
@traversaro
Copy link
Member Author

When we fix this issue, we can revert this commit: robotology/idyntree@5e760ab .

@traversaro
Copy link
Member Author

We checked this problem with @diegoferigo and apparently this line of simmechanics-to-urdf seems related: https://github.com/robotology/simmechanics-to-urdf/blob/8c23cbcda83687dcb32d83f98a9fbb6b5f221349/simmechanics_to_urdf/firstgen.py#L989 .
It could be interesting to check upstream (on https://github.com/ros/urdfdom) if you are allowed to refer by name a material that is only defined in a link, rather than in the robot tag.

@traversaro
Copy link
Member Author

I am a bit confused. By a quick check it seems that indeed this kind of "global scope for link material names" is not supported by the urdfdom reference implementation :
https://github.com/ros/urdfdom/blob/8b27e0b6fbddbb4cc670156961bd52b4d5ea632b/urdf_parser/src/model.cpp#L146 .

However, the iCub models seem to be correctly parsed by urdf_to_graphviz, so I am a bit confused.

@nunoguedelha
Copy link
Contributor

ciao @traversaro , do you agree with moving this issue to the backlog for now?
cc @diegoferigo

@traversaro
Copy link
Member Author

Yes, I think it already easy is in the backlog de facto.

@nunoguedelha
Copy link
Contributor

ok, updated the pipeline.

@traversaro
Copy link
Member Author

To be honest, I would simply suppress the warning in iDynTree until we found a way to fix the problem at the generator level.

@diegoferigo
Copy link
Member

This is somehow related to #62 if I remember correctly. If colors are properly exported from the pipeline, the generator would not fill the model with these random colors.

@traversaro
Copy link
Member Author

Another way to fix this is to make sure that the simmechanics-to-urdf converter does not emits malformed URDF files (referencing to non-existing colors) if the MaterialProp element is not present.

traversaro added a commit to robotology/simmechanics-to-urdf that referenced this issue Jun 18, 2018
The URDF specification allows to have a material element without a color child element,
but only if the name of the color is specified in the model-wide material database.
Otherwise, it is always necessary to specify the color of the material of the link.

Fix robotology/icub-models-generator#36
See robotology/icub-models-generator#36 (comment)
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

3 participants