Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Hi, the gazebo api is very powerful and well designed.

I try to solve the problem using a VisualPlugin. The ModelPlugins exist to access the physics features of a Model. Nowadays the tutorials says that exists four kind of plugins: World, Model, Sensor and System. But the VisualPlugin exists too, I don't know if there is no documentation about it.

Well I copy the code of "ModelPush" plugin example and modify to do a visual plugin that changes the color of a box. my_plugin.h and my_plugin.cpp and finally the world file teste.world.

I don't know if there is another solution, this one is a little complicated, but maybe it serves you.

After you compile the code and run the gazebo with the world file, you should see a static box that changes the color between red and black.

If you need to change the color of things dynamically probably you need some custom messages to communicate a "physical event" to the visual plugin.

I hope that answer helps you.

Hi, the gazebo api is very powerful and well designed.

I try to solve the problem using a VisualPlugin. The ModelPlugins exist to access the physics features of a Model. Nowadays the tutorials says that exists four kind of plugins: World, Model, Sensor and System. But the VisualPlugin exists too, I don't know if there is no documentation about it.

Well I copy the code of "ModelPush" plugin example and modify to do a visual plugin that changes the color of a box. my_plugin.h and my_plugin.cpp and finally the world file teste.world.

I don't know if there is another solution, this one is a little complicated, but maybe it serves you.

After you compile the code and run the gazebo with the world file, you should see a static box that changes the color between red and black.

If you need to change the color of things dynamically probably you need some custom messages to communicate a "physical event" to the visual plugin.

I hope that answer helps you.


Well there is an example in folder examples/plugins/model_visuals of gazebo source. Take a look: Example passing a message

Hi, the gazebo api is very powerful and well designed.

I try to solve the problem using a VisualPlugin. The ModelPlugins exist to access the physics features of a Model. Nowadays the tutorials says that exists four kind of plugins: World, Model, Sensor and System. But the VisualPlugin exists too, I don't know if there is no documentation about it.

Well I copy the code of "ModelPush" plugin example and modify to do a visual plugin that changes the color of a box. my_plugin.h and my_plugin.cpp and finally the world file teste.world.

I don't know if there is another solution, this one is a little complicated, but maybe it serves you.

After you compile the code and run the gazebo with the world file, you should see a static box that changes the color between red and black.

If you need to change the color of things dynamically probably you need some custom messages to communicate a "physical event" to the visual plugin.

I hope that answer helps you.


Well there is an example in folder examples/plugins/model_visuals of gazebo source. Take a look: Example passing a message

This way is the correct way, I think. Once you known the visual name that you need to modify, you just need to create a visual message and sends it to gazebo. The advantage is that you can keep entire code in the ModelPlugin and modify the visuals through messages.