Updating the visual of a model using the ModelPlugin
I am working on a plugin that updates needs to update the mesh of a model or a scene object. The data of visual and collision links both needs to be updated at the same time.
I tried to implement these updates solely using the ModelPlugin, I can see the changes taking place for the collision but updates to the visual link are never reflected in Gazebo GUI. I can only observe these updates reflected in Gazebo if I move the code that updates the visual link into a VisualPlugin. This means that I have to split my code into two plugins to manipulate a single model.
To give better insight you may refer to the current implementation: https://github.com/Samahu/robotics-dy.... You should notice that I have two separate plugins to update a single terrain object.
Is this the expected behavior or there is a better way?
Thanks!
Have you tried using the
ModelPlugin
to publish to~/visual
?Is there a way to manipulate object mesh vertices or terrain heightmap values by pushing message to ~/visual? any example on this?
No, that kind of deformation is not exposed through the message API. You'd have to create a visual plugin and handle the communication yourself.
Hm...that's a good question. We have an example plugin that creates a visual by publishing to this topic, but I'll have to check if it can modify as well: https://bitbucket.org/osrf/gazebo/src...
Yes, it looks like it can modify existing visuals: https://bitbucket.org/osrf/gazebo/src...
There was a branch from a while ago that tried to support deformation of mesh vertices, but it never got merged and might be a bit slow: https://bitbucket.org/osrf/gazebo/bra...
Knowing that I need to have a separate visual plugin for my case is enough since this was the path I already took to manipulate the object on low level. I mainly wanted to make sure there is no better way to address this. I will check the mesh deformation branch to see what can I learn from it. Thanks scpeters and chapulina!
Hi, is there an equivalent functionality or even a example within Ignition Gazebo (Fortress)? If so, which is the appropriate topic a message should be send so in order to change a model's visual, which is equivalent to the formers model plugin and therefore publisher's namespace/topic
BR