Robotics StackExchange | Archived questions

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 :

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/libQt5Widgets.so.5", at 0x7f49b6d5f0ef, in QApplication::notify(QObject*, QEvent*)
#15   Object "/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f49b6d55a65, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#14   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f49b75ecc29, in QObject::event(QEvent*)
#13   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f49a12c98a8, in 
gz::gui::plugins::RenderThread::RenderNext(gz::gui::plugins::RenderSync*)
#12   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f49a12daad7, in gz::gui::plugins::RenderThreadRhiOpenGL::RenderNext(gz::gui::plugins::RenderSync*)
#11   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f49a12d213b, in gz::gui::plugins::GzRenderer::Render(gz::gui::plugins::RenderSync*)
#10   Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f21ec7d, in gz::rendering::v7::BaseCamera<gz::rendering::v7::Ogre2Sensor>::Update()
#9    Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f2bde24, in gz::rendering::v7::Ogre2RenderTarget::Render()
#8    Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f2c64e6, in gz::rendering::v7::Ogre2Scene::StartRendering(Ogre::Camera*)
#7    Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f2c61d7, in gz::rendering::v7::Ogre2Scene::UpdateAllHeightmaps(Ogre::Camera*)
#6    Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f259ec7, in gz::rendering::v7::Ogre2Heightmap::UpdateForRender(Ogre::Camera*)
#5    Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f2f3d3c, in Ogre::Terra::update(Ogre::Vector3 const&, float)
#4    Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f496f2f7c24, in Ogre::ShadowMapper::updateShadowMap(Ogre::Vector3 const&, Ogre::Vector2 const&, float)
#3    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f49bcd9cfd5, in __assert_fail
#2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f49bcd8b728, in 
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f49bcd8b858, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f49bcdac00b, in gsignal
Aborted (Signal sent by tkill() 138020 1000)

Asked by tanguy on 2023-07-07 13:09:25 UTC

Comments

Answers