Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate cache files for each heightmap LOD #3200

Merged
merged 3 commits into from
Mar 28, 2022

Conversation

WilliamLewww
Copy link
Contributor

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

Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
@scpeters
Copy link
Member

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

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

I've confirmed that this fixes the issue, but also that the cache files appear to be identical for any LOD > 0. I've suggested a code change inline that may reduce the number of cache files

gazebo/rendering/Heightmap.cc Outdated Show resolved Hide resolved
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
@mogumbo
Copy link
Contributor

mogumbo commented Mar 25, 2022

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.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters merged commit 212fae8 into gazebosim:gazebo11 Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heightmap paging cache corruption when mixing LOD values
3 participants