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

Fix crash with DEM and Camera #3279

Closed scpeters closed 2 years ago

scpeters commented 2 years ago

🦟 Bug fix

Fixes crash introduced by #3257

Summary

While reviewing #3257, I didn't notice one instance in rendering/Heightmap.cc in which a SphericalCoordinates pointer will be passed in its default nullptr state when the surface type is EARTH_WGS84. It particularly causes a crash when loading a DEM in gzclient or loading a DEM with a camera sensor in gzserver. This adds a failing test with a CameraSensor and DEM in https://github.com/gazebosim/gazebo-classic/commit/9739cebbb4d56e427ff99edca2a97b7dc85f8670 and.a fix in https://github.com/gazebosim/gazebo-classic/commit/75f9e6cc73ccc4f999db8925939e3cf9c3237985.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.