Fatal error when loading heightmap : Assertion failed
Hi! I'm trying to load a heightmap into gazebo garden. I haven't encountered this error with previous heigthmaps of different dimensions, so I'm wondering if someone would know what the error means and how it can be fixed. Thanks!
Setup :
- Ubuntu 20.04
- Gazebo Garden
- .IMG heightmap from https://www.uahirise.org/dtm/ESP_0168... converted to .tif using
gdal_translate -of GTIFF
as recommended and placed in models/map_marsHiLabyrinth/dem/labyrinth.tif
Code to replicate :
models/map_marsHiLabyrinth/model.sdf
<?xml version="1.0" ?>
<sdf version="1.7">
<model name="labyrinth">
<static>true</static>
<link name="link">
<visual name="visual">
<geometry>
<heightmap>
<uri>dem/labyrinth.tif</uri>
<size>5317 11578 2</size>
<pos>0 0 0</pos>
</heightmap>
</geometry>
</visual>
</link>
</model>
</sdf>
worlds/labyrinth.sdf
<?xml version="1.0" ?>
<sdf version="1.7">
<world name="labyrinth">
<!-- PLUGINS -->
<plugin
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>
<plugin
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<!-- PHYSICS -->
<physics name="1ms" type="ignored">
<max_step_size>0.001</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>
<gravity>0 0 -9.8</gravity>
<!-- TERRAIN -->
<spherical_coordinates>
<surface_model>CUSTOM_SURFACE</surface_model>
<world_frame_orientation>ENU</world_frame_orientation>
<latitude_deg>-5.0</latitude_deg>
<longitude_deg>267.81</longitude_deg>
<elevation>0</elevation>
<heading_deg>0</heading_deg>
<surface_axis_equatorial>3396190</surface_axis_equatorial>
<surface_axis_polar>3376200</surface_axis_polar>
</spherical_coordinates>
<include><uri>model://map_marsHiLabyrinth</uri></include>
<!-- GUI -->
<gui fullscreen='false'>
<plugin name='3D View' filename='GzScene3D'>
<gz-gui>
<title>3D View</title>
<property type='bool' key='showTitleBar'>0</property>
<property type='string' key='state'>docked</property>
</gz-gui>
<engine>ogre2</engine>
<scene>scene</scene>
</plugin>
</gui>
</world>
</sdf>
Error :
$ gz sim labyrinth.sdf
[Err] [SDFFeatures.cc:843] The geometry element of collision [collision] couldn't be created
libEGL warning: DRI2: failed to create dri screen
libEGL warning: DRI2: failed to create dri screen
gz sim gui: /home/jenkins/workspace/gz-rendering7-debbuilder/build/gz-rendering-7.4.0/ogre2/src/terrain/Terra/src/TerraShadowMapper.cpp:281: void Ogre::ShadowMapper::updateShadowMap(const Ogre::Vector3&, const Ogre::Vector2&, float): Assertion `m_shadowStarts->getNumElements() >= (m_heightMapTex->getHeight() << 4u)' failed.
Stack trace (most recent call last) in thread 138111:
#29 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#28 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f49bce88132, in clone
#27 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7f49bcd4e608, in
#26 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b73f89d1, in
#25 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b73f7784, in QThread::exec()
#24 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b75bf3aa, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
#23 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b7618434, in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#22 Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f49b53d14a2, in g_main_context_iteration
#21 Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f49b53d13ff, in
#20 Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f49b53d117c, in g_main_context_dispatch
#19 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b7618e36, in
#18 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b75c3487, in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
#17 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b75c0809, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#16 Object "/lib/x86_64-linux-gnu ...