gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.21k stars 484 forks source link

Separate cache files for each heightmap LOD #3200

Closed WilliamLewww closed 2 years ago

WilliamLewww commented 2 years ago

Closes #3199

To prevent gazebo from loading the wrong cache files, each heightmap LOD will have its own set of cache files.

The LOD is appended to the cache files' names (5 in the example):

[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00000000.dat
[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00010000.dat
[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00000001.dat
[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00010001.dat
scpeters commented 2 years ago

Closes #3199

To prevent gazebo from loading the wrong cache files, each heightmap LOD will have its own set of cache files.

The LOD is appended to the cache files' names (5 in the example):

[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00000000.dat
[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00010000.dat
[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00000001.dat
[Msg] Loading heightmap cache data: /root/.gazebo/paging/heightmap_bowl_2/gazebo_terrain_5_00010001.dat

thanks I'll go ahead and test this. It's possible that cache files are equivalent for any nonzero LOD values, in which case we could simplify this a bit, but I expect that this will fix the issue

mogumbo commented 2 years ago

Tested some big terrains using gzserver lod = 0 and gzclient lod = 3. Terrain looked good in both gzclient and cameras. Without this PR, the structure of the terrain had visible flaws.