Closed fabiodinatale closed 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!
Ciao @fabiodinatale ! Yes, these lines just set the light. You can happily remove them :)
Thanks for the very quick feedback @Giulero! Going to comment them then! 😄
Done with this commit.
Friendly ping @VenusPasandi for the Review! Thanks!
@VenusPasandi can we merge? Thanks!
can we merge? Thanks!
Done!
This PR was opened in order to update the file
Plane.urdf
in the folderlib/+mwbs/+Visualizers/+robotVisualizer/Urdf/Plane/FlatPlane
, adding the possibility to change its color.