Gazebo | Ignition | Community
Ask Your Question
0

Heightmap not updating in Gazebo 8 after changing .world file

asked 2017-11-16 05:44:58 -0600

Raskkii gravatar image

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.

edit retag flag offensive close merge delete

Comments

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?

zywang gravatar imagezywang ( 2018-10-22 21:50:33 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-16 10:26:27 -0600

chapulina gravatar image

It looks like there is a bug in the function which checks if the terrain has changed and needs to be reloaded. It would be great if you could ticket an issue explaining, like you did on your question, in which situation it works and in which it doesn't.

edit flag offensive delete link more

Comments

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?

zywang gravatar imagezywang ( 2018-10-22 22:47:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-16 04:52:27 -0600

Seen: 787 times

Last updated: Nov 16 '17