Heightmap not updating in Gazebo 8 after changing .world file
I am using Gazebo 8 and ROS Lunar.
I have this heightmap.world file which utilises heightmap.
To launch the .world file in Gazebo I use the following command: rosrun gazebo_ros gazebo heightmap.world
<?xml version="1.0" ?>
<sdf version="1.4">
<world name="default">
<include>
<uri>model://sun</uri>
</include>
<scene>
<shadows>0</shadows>
</scene>
<model name="heightmap">
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<heightmap>
<uri>model://path/to/heightmap.png</uri>
<size>100 100 10</size>
<pos>0 0 0</pos>
</heightmap>
</geometry>
</collision>
<visual name="heightmap_visual">
<cast_shadows>false</cast_shadows>
<geometry>
<heightmap>
<texture>
<diffuse>model://path/to/dirt_diffusespecular.png</diffuse>
<normal>model://path/to/flat_normal.png</normal>
<size>5</size>
</texture>
<uri>model://path/to/heightmap.png</uri>
<size>100 100 10</size>
<pos>0 0 0</pos>
</heightmap>
</geometry>
</visual>
</link>
</model>
</world>
</sdf>
Now, the first time I launch this .world file, everything seems as it should be. However, when I make certain changes in the .world file, then launch it again in Gazebo, the heightmap doesn't change, it's as if it didn't register the change in the .world file.
For example let's say I want to replace the dirt texture with grass. The diffuse line in the .world file would have to be changed to: <diffuse>model://path/to/grass_diffusespecular.png</diffuse>
. It would be expected that the heightmap texture would then become grass instead of dirt. However, when I launch the .world file with the changes made, the displayed texture is still the dirt texture.
The same problem arises with multiple textures and the x and y of the size tag (visual).
The only way I've managed to make the changes shown in Gazebo is to change the heightmap visual z size to something else. It seems like any different z value will do it. So everytime I make a heightmap change in the .world file, I am required to also change the visual z value to have the change displayed in Gazebo.
Surely this can't be intended behaviour?
EDIT: I've found another way of making the changes shown in Gazebo and that is to delete the ~/.gazebo/paging directory. It seems that the newer gazebos store heightmaps into cache for faster loading times. It does seem a bit counter-productive having to delete the cache everytime you'd like to make a change though.
I am having the same issue here with gazebo 7.14 and ros kinectic. Is it solved or is there someway to work around it?