gazebo-classic icon indicating copy to clipboard operation
gazebo-classic copied to clipboard

Lunar DEMs : Make Heightmap loader use spherical coordinates.

Open adityapande-1995 opened this issue 1 year ago • 0 comments

This PR is an ongoing set of PRs to make lunar dem support available in gazebo classic.

Problem tackled

For gzserver

HeightmapDataLoader::LoadDEMAsTerrain() needs access to the world's spherical coordiantes object to load lunar DEMs correctly. This in turn is called by HeightmapDataLoader::LoadTerrain() , which is loaded by HeightmapShape::LoadTerrainFile() which ultimately has access to the spherical coordiantes object.

This PR overloads the above functions so that the spherical coordinates pointer is available to the DEM object.

# Inside gazebo/gazebo/physics/
HeightmapDataLoader::LoadDEMAsTerrain() --> Loads DEMs, needs access to SphericalCoordinates
  |
HeightmapDataLoader::LoadTerrainFile()
  |
HeightmapShape::LoadTerrain() --> Has access to SphericalCoordinates

For gzclient

# inside gazebo/rendering

HeightmapLoader::LoadTerrainFile() --> Needs SphericalCoordiantesPtr
 | 
Heightmap::Load() --> queries spherical coordinates using a service
 |
World.cc --> Exposes service to return world surface type.

Possible issues

This might still lead to some ABI incompatibility issues, and I can go for a different approach then, probably by renaming functions or deprecating old ones.

It is also possible to direct use the service in HeightmapDataLoader::LoadDEMAsTerrain(), but that might slow down the loading of DEMs even in server mode.

adityapande-1995 avatar Sep 10 '22 00:09 adityapande-1995