Color problem when using emissive property
Hello everyone! I’m having a problem trying to apply the emissive property to a material in Gazebo. Specifically I'm using Ubuntu 18.04.5 LTS, ROS melodic and Gazebo 8.
I want to simulate a LED and I’m using my own plugin (not the one that comes with Gazebo 9). And so to have more intense colors I would like to use the emissive property, that according to the documentation “It appears as if light was emitted from the object, though emissive light does not add light to other objects in the world”.
The thing is, the emissive property seems to work fine with basic colors like (0 1 0 1). It adds and intense uniform color to the whole visual:
(0 1 0 1) without emissive
(0 1 0 1) with emissive
But if I try to use a combination of RGB like (0.631 1 0 1) that is a green, when I use the same values for the emissive it shows a bright yellow:
(0.631 1 0 1) without emissive
(0.631 1 0 1) with emissive
Here is the code of my SDF:
<?xml version='1.0'?>
<sdf version='1.5'>
<model name="fake_led_matrix">
<static>false</static>
<pose>0 0 0 0 0 0</pose>
<link name='led_test'>
<pose>0 0 0 0 0 0</pose>
<gravity>0</gravity>
<visual name='visual'>
<geometry>
<sphere>
<radius>0.05</radius>
</sphere>
</geometry>
<transparency>0.0</transparency>
<material>
<!-- <ambient>0 1 0 1</ambient>
<diffuse>0 1 0 1</diffuse>
<specular>0 1 0 1</specular>
<emissive>0 1 0 1</emissive> -->
<ambient>0.631 1 0 1</ambient>
<diffuse>0.631 1 0 1</diffuse>
<specular>0.631 1 0 1</specular>
<emissive>0.631 1 0 1</emissive>
</material>
<!-- <plugin name='led_control' filename='libharu_leds_visual_plugin_test.so'>
<led_number>6</led_number>
</plugin> -->
</visual>
</link>
</model>
</sdf>
I’m not sure if that result is the right one when applying the emissive property, but I would like to keep the ambient color I want (for example (0.631 1 0 1) as I am simulating a robot that use those colors) while getting the uniform intense bright for simulating a LED. I would appreciate any help to achieve something like that.
Thank you!
Asked by Domi on 2020-10-15 06:47:06 UTC
Comments
Wild guess, but what if you expressed them all as floats, i.e.
(0.631 1.0 0.0 1.0)
, does that change anything?Asked by wongrufus on 2020-10-16 04:22:07 UTC
Wild guess, but what if you expressed them all as decimals, i.e.
(0.631 1.0 0.0 1.0)
, does that change anything?Asked by wongrufus on 2020-10-16 04:22:22 UTC
Thank you for the answer @wongrufus. I tried to use floats but didn't change anything.
Asked by Domi on 2020-10-16 06:07:23 UTC