robotology / icub-models-generator

Resources and programs to generated models (URDF, SDF) of the iCub robot
14 stars 23 forks source link

Investigate on how to fix the colors in the urdf models #216

Closed GiulioRomualdi closed 2 years ago

GiulioRomualdi commented 2 years ago

Thanks to https://github.com/robotology/idyntree/pull/961 it will be possible to display the icub models with the colors defined in the urdf files.

I noticed that the robot colors are "randomly" chosen when the model is generated. As a consequence, the representation of the model is a bit bizarre

image

This is how TALOS is loaded by the very same visualizer

Do you think it's possible to fix the color of the links?

cc @traversaro

GiulioRomualdi commented 2 years ago

I think it's related to this: https://github.com/robotology/simmechanics-to-urdf/blob/f6055ab8d627c45138ddde46532ea42a74b48caa/simmechanics_to_urdf/firstgen.py#L24-L28

traversaro commented 2 years ago

Yes, we can:

Both options are fine for me. We also need to identify which color we want to use.

Note that simmechanics-to-urdf already have a similar option (see https://github.com/robotology/simmechanics-to-urdf/blob/f6055ab8d627c45138ddde46532ea42a74b48caa/simmechanics_to_urdf/firstgen.py#L1116), but that would require to add a line in the yaml for each link to set a different color, so it may not be super-convenient.

GiulioRomualdi commented 2 years ago

Note that simmechanics-to-urdf already have a similar option (see https://github.com/robotology/simmechanics-to-urdf/blob/f6055ab8d627c45138ddde46532ea42a74b48caa/simmechanics_to_urdf/firstgen.py#L1116), but that would require to add a line in the yaml for each link to set a different color, so it may not be super-convenient.

I actually noticed that this dictionary is filled by the xml file and not by the yaml file: From here -> here -> finally here

As far as I understood the xml file is generated by simmechanics and it cannot be modified.

Should I replicate the same logic for the yaml file?

traversaro commented 2 years ago

Note that simmechanics-to-urdf already have a similar option (see https://github.com/robotology/simmechanics-to-urdf/blob/f6055ab8d627c45138ddde46532ea42a74b48caa/simmechanics_to_urdf/firstgen.py#L1116), but that would require to add a line in the yaml for each link to set a different color, so it may not be super-convenient.

I actually noticed that this dictionary is filled by the xml file and not by the yaml file: From here -> here -> finally here

As far as I understood the xml file is generated by simmechanics and it cannot be modified.

You are right, I misunderstood the code.

Should I replicate the same logic for the yaml file?

I guess not, until we have a need for it.

GiulioRomualdi commented 2 years ago

https://github.com/robotology/icub-models-generator/pull/217 attempts to close this issue