ami-iit / matlab-whole-body-simulator

A robot simulator running on simulink
BSD 3-Clause "New" or "Revised" License
31 stars 9 forks source link

Changing plane color #80

Closed fabiodinatale closed 2 years ago

fabiodinatale commented 2 years ago

This PR was opened in order to update the file Plane.urdf in the folder lib/+mwbs/+Visualizers/+robotVisualizer/Urdf/Plane/FlatPlane, adding the possibility to change its color.

fabiodinatale commented 2 years ago

The aim of this PR is to change the color of the plane displayed in the iDynTree Visualizer.

After performing the modification (i.e. including the <color> tag and inserting the proper RGBA values), using the command idyntree-model-view, the plane was shown with the desired color. Despite this and despite the installation procedure was properly followed, the plane and the robot had still the same color when the visualizer is opened through a simulation.

This problem was related to these lines of code of the iDynTreeIrrlichtVisualizer.m file:

obj.viz.enviroment().addLight('sun1');
obj.viz.enviroment().lightViz('sun1').setType(iDynTree.DIRECTIONAL_LIGHT);
obj.viz.enviroment().lightViz('sun1').setDirection(iDynTree.Direction(-1, 0, 0));
obj.viz.enviroment().addLight('sun2');
obj.viz.enviroment().lightViz('sun2').setType(iDynTree.DIRECTIONAL_LIGHT);
obj.viz.enviroment().lightViz('sun2').setDirection(iDynTree.Direction(1, 0, 0));

which set the lights of the environment. Commenting them out, it was possible to display both the robot and the plane with their real colors.

Using the Blame function of GitHub, it was possible to discover that these lines where added through this commit by @Giulero, to whom we ask: are these lines important for some specific reason and thus they can't be commented or is it possible to comment them?

Thanks in advance for your response!

Giulero commented 2 years ago

Ciao @fabiodinatale ! Yes, these lines just set the light. You can happily remove them :)

fabiodinatale commented 2 years ago

Thanks for the very quick feedback @Giulero! Going to comment them then! 😄

Done with this commit.

fabiodinatale commented 2 years ago

Friendly ping @VenusPasandi for the Review! Thanks!

traversaro commented 2 years ago

@VenusPasandi can we merge? Thanks!

fabiodinatale commented 2 years ago

can we merge? Thanks!

Done!