This tutorial gives an introduction to Ignition Gazebo's service /world/<world name>/light_config
. This service will allow to modify lights in the scene.
Modifying lights
To modify lights inside the scene we need to use the service /world/<world name>/light_config
and fill the message ignition::msgs::Light
. In particular this example modifies the point light that we introduced with the function createLight()
.
NOTE:: You can check the entity creation tutorial to learn how to include models and lights in the scene.
As you can see in the snippet we modify the specular and diffuse colors of the light in the scene.
In this case we are creating random numbers to fill the diffuse and specular.
Run the example
To run this example you should cd
into examples/standalone/light_control
and build the code:
Then you should open two terminals and run:
- Terminal one: ign gazebo -r -v 4 empty.sdf
- Terminal two: ./light_control