conda-forge / libignition-gazebo-feedstock

A conda-smithy repository for libignition-gazebo.
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

Could not open gazebo gui (ogre 1.12 segfaults) #6

Open diegoferigo opened 3 years ago

diegoferigo commented 3 years ago

Issue:

Even after the fix I proposed in https://github.com/conda-forge/libignition-gazebo-feedstock/issues/4#issuecomment-824709977, the GUI fails to open. Note that running just the server seems working fine. Here below the runtime error:

~ 🅒 test  
❯ ign gazebo
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-dferigo'
terminate called after throwing an instance of 'Ogre::RuntimeAssertionException'
  what():  RuntimeAssertionException: Ogre/ShadowExtrudePointLight not found. Verify that you referenced the 'ShadowVolume' folder in your resources.cfg in initialise at /home/conda/feedstock_root/build_artifacts/ogre_1618751642257/work/OgreMain/src/OgreShadowVolumeExtrudeProgram.cpp (line 70)
Verbose output ``` ~ 🅒 test ❯ ign gazebo -v [Msg] Ignition Gazebo Server v4.6.0 [Msg] Ignition Gazebo GUI v4.6.0 [Msg] Loading default world. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-dferigo' [Msg] Loaded level [3] [Msg] No systems loaded from SDF, loading defaults [Msg] Create service on [/world/default/create] [Msg] Remove service on [/world/default/remove] [Msg] Pose service on [/world/default/set_pose] [Msg] Light configuration service on [/world/default/light_config] [Msg] Physics service on [/world/default/set_physics] [Msg] Serving world controls on [/world/default/control] and [/world/default/playback/control] [Msg] Serving GUI information on [/world/default/gui/info] [Msg] World [default] initialized with [default_physics] physics profile. [Msg] Serving world SDF generation service on [/world/default/generate_world_sdf] [Msg] Serving world names on [/gazebo/worlds] [Msg] Resource path add service on [/gazebo/resource_paths/add]. [Msg] Resource path get service on [/gazebo/resource_paths/get]. [Msg] Resource paths published on [/gazebo/resource_paths]. [GUI] [Wrn] [Application.cc:649] [QT] file::/Gazebo/GazeboDrawer.qml:178:3: QML Dialog: Binding loop detected for property "implicitHeight" [GUI] [Wrn] [Application.cc:649] [QT] file::/Gazebo/GazeboDrawer.qml:178:3: QML Dialog: Binding loop detected for property "implicitHeight" [GUI] [Msg] Loading config [/home/dferigo/.ignition/gazebo/gui.config] [GUI] [Msg] Video recorder stats topic advertised on [/gui/record_video/stats] [GUI] [Msg] Transform mode service on [/gui/transform_mode] [GUI] [Msg] Record video service on [/gui/record_video] [GUI] [Msg] Move to service on [/gui/move_to] [GUI] [Msg] Follow service on [/gui/follow] [GUI] [Msg] View angle service on [/gui/view_angle] [GUI] [Msg] Move to pose service on [/gui/move_to/pose] [GUI] [Msg] Camera pose topic advertised on [/gui/camera/pose] [GUI] [Msg] View collisions service on [/gui/view/collisions] [GUI] [Msg] Added plugin [3D View] to main window [GUI] [Msg] Loaded plugin [GzScene3D] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libGzScene3D.so] [GUI] [Msg] Using world control service [/world/default/control] [GUI] [Msg] Listening to stats on [/world/default/stats] [GUI] [Msg] Added plugin [World control] to main window [GUI] [Msg] Loaded plugin [WorldControl] from path [/conda/envs/test/lib/ign-gui-4/plugins/libWorldControl.so] [GUI] [Msg] Listening to stats on [/world/default/stats] [GUI] [Msg] Added plugin [World stats] to main window [GUI] [Msg] Loaded plugin [WorldStats] from path [/conda/envs/test/lib/ign-gui-4/plugins/libWorldStats.so] [GUI] [Msg] Added plugin [Transform control] to main window [GUI] [Msg] Loaded plugin [TransformControl] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libTransformControl.so] [GUI] [Msg] Added plugin [Shapes] to main window [GUI] [Msg] Loaded plugin [Shapes] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libShapes.so] [GUI] [Msg] Added plugin [Component inspector] to main window [GUI] [Msg] Loaded plugin [ComponentInspector] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libComponentInspector.so] [GUI] [Msg] Added plugin [Entity tree] to main window [GUI] [Msg] Loaded plugin [EntityTree] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libEntityTree.so] [GUI] [Wrn] [Application.cc:649] [QT] file::/Gazebo/GazeboDrawer.qml:178:3: QML Dialog: Binding loop detected for property "implicitHeight" [GUI] [Msg] Loading plugin [ignition-rendering-ogre] [GUI] [Wrn] [Application.cc:649] [QT] Qt has caught an exception thrown from an event handler. Throwing exceptions from an event handler is not supported in Qt. You must not let any exception whatsoever propagate through Qt code. If that is not possible, in Qt 5 you must at least reimplement QCoreApplication::notify() and catch all exceptions there. terminate called after throwing an instance of 'Ogre::RuntimeAssertionException' what(): RuntimeAssertionException: Ogre/ShadowExtrudePointLight not found. Verify that you referenced the 'ShadowVolume' folder in your resources.cfg in initialise at /home/conda/feedstock_root/build_artifacts/ogre_1618751642257/work/OgreMain/src/OgreShadowVolumeExtrudeProgram.cpp (line 70) [Msg] Found no publishers on /stats, adding root stats topic [Msg] Found no publishers on /clock, adding root clock topic [Msg] Serving scene information on [/world/default/scene/info] [Msg] Serving graph information on [/world/default/scene/graph] [Msg] Serving full state on [/world/default/state] [Msg] Serving full state (async) on [/world/default/state_async] [Msg] Publishing scene information on [/world/default/scene/info] [Msg] Publishing entity deletions on [/world/default/scene/deletion] [Msg] Publishing state changes on [/world/default/state] [Msg] Publishing pose messages on [/world/default/pose/info] [Msg] Publishing dynamic pose messages on [/world/default/dynamic_pose/info] ```


Environment (conda list):

``` ~ 🅒 test ❯ mamba list __ __ __ __ / \ / \ / \ / \ / \/ \/ \/ \ ███████████████/ /██/ /██/ /██/ /████████████████████████ / / \ / \ / \ / \ \____ / / \_/ \_/ \_/ \ o \__, / _/ \_____/ ` |/ ███╗ ███╗ █████╗ ███╗ ███╗██████╗ █████╗ ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗ ██╔████╔██║███████║██╔████╔██║██████╔╝███████║ ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║ ██║ ╚═╝ ██║██║ ██║██║ ╚═╝ ██║██████╔╝██║ ██║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ mamba (0.11.3) supported by @QuantStack GitHub: https://github.com/mamba-org/mamba Twitter: https://twitter.com/QuantStack █████████████████████████████████████████████████████████████ # packages in environment at /conda/envs/test: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge assimp 5.0.1 hedfc422_5 conda-forge binutils 2.35.1 hdd6e379_2 conda-forge binutils_impl_linux-64 2.35.1 h193b22a_2 conda-forge binutils_linux-64 2.35 h67ddf6f_30 conda-forge boost-cpp 1.74.0 hc6e9bd1_2 conda-forge brotlipy 0.7.0 py38h497a2fe_1001 conda-forge bullet-cpp 3.09 h1abd341_2 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge c-compiler 1.1.1 h516909a_0 conda-forge ca-certificates 2021.4.13 h06a4308_1 certifi 2020.12.5 py38h578d9bd_1 conda-forge cffi 1.14.5 py38ha65f79e_0 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge clang 11.1.0 ha770c72_0 conda-forge clang-11 11.1.0 default_ha53f305_0 conda-forge clang-tools 11.1.0 default_ha53f305_0 conda-forge clangxx 11.1.0 default_ha53f305_0 conda-forge cmake 3.20.1 h541d2ed_0 conda-forge compilers 1.1.1 0 conda-forge conda 4.10.1 py38h578d9bd_0 conda-forge conda-package-handling 1.7.3 py38h497a2fe_0 conda-forge console_bridge 1.0.1 hc9558a2_0 conda-forge cppzmq 4.7.1 hf7cf922_2 conda-forge cryptography 3.4.7 py38ha5dfef3_0 conda-forge cxx-compiler 1.1.1 hc9558a2_0 conda-forge dartsim 6.9.5 h53b96f2_5 conda-forge dbus 1.13.18 hb2f20db_0 eigen 3.3.9 h4bd325d_1 conda-forge expat 2.3.0 h9c3ff4c_0 conda-forge fcl 0.6.1 h2cbc392_3 conda-forge ffmpeg 4.3.1 hca11adc_2 conda-forge flann 1.9.1 h44f99b7_1008 conda-forge fontconfig 2.13.1 hba837de_1005 conda-forge fortran-compiler 1.1.1 he991be0_0 conda-forge freeimage 3.18.0 hadfbfc9_7 conda-forge freetype 2.10.4 h0708190_1 conda-forge gcc_impl_linux-64 7.5.0 habd7529_19 conda-forge gcc_linux-64 7.5.0 h47867f9_30 conda-forge gdbm 1.18 h0a1914f_2 conda-forge gettext 0.21.0 hf68c758_0 gfortran_impl_linux-64 7.5.0 h56cb351_19 conda-forge gfortran_linux-64 7.5.0 h78c8a43_30 conda-forge glib 2.68.1 h9c3ff4c_0 conda-forge glib-tools 2.68.1 h9c3ff4c_0 conda-forge gmp 6.2.1 h58526e2_0 conda-forge gnutls 3.6.15 he1e5248_0 gst-plugins-base 1.18.4 h29181c9_0 conda-forge gstreamer 1.18.4 h76c114f_0 conda-forge gts 0.7.6 h64030ff_2 conda-forge gxx_impl_linux-64 7.5.0 hd0bb8aa_19 conda-forge gxx_linux-64 7.5.0 h555fc39_30 conda-forge hdf5 1.10.6 nompi_h7c3c948_1111 conda-forge icu 68.1 h58526e2_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge ilmbase 2.5.5 h780b84a_0 conda-forge jpeg 9d h516909a_0 conda-forge jsoncpp 1.9.4 h4bd325d_2 conda-forge jxrlib 1.1 h516909a_2 conda-forge kernel-headers_linux-64 2.6.32 h77966d4_13 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge lame 3.100 h14c3975_1001 conda-forge lcms2 2.12 hddcbb42_0 conda-forge ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge libarchive 3.5.1 h3f442fb_1 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libccd 2.1 he1b5a44_1 conda-forge libclang 11.1.0 default_ha53f305_0 conda-forge libclang-cpp11.1 11.1.0 default_ha53f305_0 conda-forge libcurl 7.76.1 hc4aaa36_1 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libevent 2.1.10 hcdb4288_3 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-devel_linux-64 7.5.0 hda03d7c_19 conda-forge libgcc-ng 9.3.0 h2828fa1_19 conda-forge libgfortran-ng 7.5.0 h14aa051_19 conda-forge libgfortran4 7.5.0 h14aa051_19 conda-forge libglib 2.68.1 h3e27bee_0 conda-forge libglu 9.0.0 he1b5a44_1001 conda-forge libgomp 9.3.0 h2828fa1_19 conda-forge libiconv 1.16 h516909a_0 conda-forge libidn2 2.3.0 h516909a_0 conda-forge libignition-cmake2 2.7.0 h9c3ff4c_1 conda-forge libignition-common3 3.11.1 h4b9f6df_0 conda-forge libignition-fuel-tools5 5.1.1 hf08c594_6 conda-forge libignition-gazebo4 4.6.0 h420ee80_0 conda-forge libignition-gui4 4.3.0 h3975b97_1 conda-forge libignition-math6 6.8.0 h9c3ff4c_0 conda-forge libignition-msgs6 6.4.0 hc438e01_0 conda-forge libignition-physics3 3.1.0 h9c3ff4c_4 conda-forge libignition-plugin1 1.2.0 h9c3ff4c_0 conda-forge libignition-rendering4 4.7.0 hd9181ad_1 conda-forge libignition-sensors4 4.1.0 hc438e01_0 conda-forge libignition-tools1 1.1.0 h33ecc0d_0 conda-forge libignition-transport9 9.1.0 h3ef4182_3 conda-forge liblapack 3.9.0 8_openblas conda-forge libllvm11 11.1.0 hf817b99_2 conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libode 0.16.2 h9c3ff4c_5 conda-forge libopenblas 0.3.12 pthreads_hb3c22a3_1 conda-forge libpng 1.6.37 hed695b0_2 conda-forge libpq 13.1 hfd2b0eb_2 conda-forge libprotobuf 3.15.8 h780b84a_0 conda-forge libraw 0.20.2 h10796ff_1 conda-forge libsdformat10 10.3.0 hf765594_1 conda-forge libsodium 1.0.18 h516909a_1 conda-forge libsolv 0.7.18 h780b84a_0 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-devel_linux-64 7.5.0 hb016644_19 conda-forge libstdcxx-ng 9.3.0 h6de172a_19 conda-forge libtasn1 4.16.0 h27cfd23_0 libtiff 4.2.0 hdc55705_0 conda-forge libunistring 0.9.10 h14c3975_0 conda-forge libuuid 2.32.1 h14c3975_1000 conda-forge libuv 1.41.0 h7f98852_0 conda-forge libwebp-base 1.2.0 h7f98852_2 conda-forge libxcb 1.14 h7b6447c_0 libxkbcommon 1.0.3 he3ba5ed_0 conda-forge libxml2 2.9.10 h72842e0_4 conda-forge libxslt 1.1.33 h15afd5d_2 conda-forge libzip 1.7.3 he9f05b3_0 conda-forge lxml 4.6.3 py38hf1fe3a4_0 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge lzo 2.10 h516909a_1000 conda-forge mamba 0.11.3 py38h2aa5da1_0 conda-forge mysql-common 8.0.23 ha770c72_1 conda-forge mysql-libs 8.0.23 h935591d_1 conda-forge ncurses 6.2 h58526e2_4 conda-forge nettle 3.7.2 hbbd107a_1 nspr 4.30 h9c3ff4c_0 conda-forge nss 3.64 hb5efdd6_0 conda-forge numpy 1.20.2 py38h9894fe3_0 conda-forge octomap 1.9.6 h4bd325d_0 conda-forge ogre 1.12.11 h89131c6_0 conda-forge openexr 2.5.5 hf817b99_0 conda-forge openh264 2.1.1 h780b84a_0 conda-forge openjpeg 2.4.0 hf7af979_0 conda-forge openssl 1.1.1k h7f98852_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge pip 21.0.1 pyhd8ed1ab_0 conda-forge pkg-config 0.29.2 h516909a_1008 conda-forge pkgconfig 1.5.2 py38h578d9bd_0 conda-forge protobuf 3.15.8 py38h709712a_0 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge pugixml 1.11.4 h9c3ff4c_0 conda-forge pycosat 0.6.3 py38h497a2fe_1006 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge python 3.8.8 hffdb5ce_0_cpython conda-forge python_abi 3.8 1_cp38 conda-forge qt 5.12.9 hda022c4_4 conda-forge readline 8.1 h46c0cb4_0 conda-forge reproc 14.2.1 h36c2ea0_0 conda-forge reproc-cpp 14.2.1 h58526e2_0 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge rhash 1.4.1 h7f98852_0 conda-forge ruamel_yaml 0.15.80 py38h497a2fe_1004 conda-forge ruby 2.7.2 he592edb_3 conda-forge sdl2 2.0.12 h58526e2_1 conda-forge setuptools 49.6.0 py38h578d9bd_3 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge sqlite 3.35.4 h74cdb3f_0 conda-forge swig 4.0.2 hd3c618e_2 conda-forge sysroot_linux-64 2.12 h77966d4_13 conda-forge tinyxml 2.6.2 h4bd325d_2 conda-forge tinyxml2 8.0.0 he1b5a44_1 conda-forge tk 8.6.10 hed695b0_1 conda-forge tqdm 4.60.0 pyhd8ed1ab_0 conda-forge tzdata 2021a he74cb21_0 conda-forge urdfdom 2.3.3 h4bd325d_1 conda-forge urdfdom_headers 1.0.5 hc9558a2_2 conda-forge urllib3 1.26.4 pyhd8ed1ab_0 conda-forge wheel 0.36.2 pyhd3deb0d_0 conda-forge x264 1!161.3030 h7f98852_0 conda-forge xorg-kbproto 1.0.7 h14c3975_1002 conda-forge xorg-libice 1.0.10 h516909a_0 conda-forge xorg-libsm 1.2.3 hd9c2040_1000 conda-forge xorg-libx11 1.6.12 h516909a_0 conda-forge xorg-libxaw 1.0.14 h7f98852_0 conda-forge xorg-libxext 1.3.4 h516909a_0 conda-forge xorg-libxmu 1.1.3 h516909a_0 conda-forge xorg-libxpm 3.5.13 h516909a_0 conda-forge xorg-libxt 1.1.5 h516909a_1003 conda-forge xorg-xextproto 7.3.0 h14c3975_1002 conda-forge xorg-xproto 7.0.31 h14c3975_1007 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge zeromq 4.3.4 h9c3ff4c_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge zstd 1.4.9 ha95c52a_0 conda-forge zziplib 0.13.69 hed695b0_1 conda-forge ```


Details about conda and system ( conda info ):

``` ~ 🅒 test ❯ conda info active environment : test active env location : /conda/envs/test shell level : 2 user config file : /home/dferigo/.condarc populated config files : /conda/.condarc /home/dferigo/.condarc conda version : 4.10.0 conda-build version : not installed python version : 3.8.8.final.0 virtual packages : __cuda=11.2=0 __linux=5.8.0=0 __glibc=2.31=0 __unix=0=0 __archspec=1=x86_64 base environment : /conda (writable) conda av data dir : /conda/etc/conda conda av metadata url : https://repo.anaconda.com/pkgs/main channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /conda/pkgs /home/dferigo/.conda/pkgs envs directories : /conda/envs /home/dferigo/.conda/envs platform : linux-64 user-agent : conda/4.10.0 requests/2.25.1 CPython/3.8.8 Linux/5.8.0-48-generic ubuntu/20.04.1 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False ```
diegoferigo commented 3 years ago

I remembered some preliminary tests did in https://github.com/robotology/gym-ignition/issues/279, where a specific ogre version was necessary. There, I was building the entire colcon workspace using dependencies provided by a conda environment.

Downgrading ogre to the functioning version I reported, ogre does not segfault. Here below the environment changes.

~ 🅒 test  
❯ mamba install ogre==1.10.12

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (0.11.3) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████

Looking for: ['ogre==1.10.12']

conda-forge/linux-64     Using cache
conda-forge/noarch       Using cache
pkgs/r/linux-64          [====================] (00m:00s) No change
pkgs/r/noarch            [====================] (00m:00s) No change
pkgs/main/noarch         [====================] (00m:00s) No change
pkgs/main/linux-64       [====================] (00m:00s) No change
Transaction

  Prefix: /conda/envs/test

  Updating specs:

   - ogre==1.10.12

  Package                 Version  Build       Channel                    Size
────────────────────────────────────────────────────────────────────────────────
  Change:
────────────────────────────────────────────────────────────────────────────────

  libignition-gui4          4.3.0  h3975b97_1  installed                      
  libignition-gui4          4.3.0  hfcbbd8f_1  conda-forge/linux-64     870 KB
  libignition-rendering4    4.7.0  hd9181ad_1  installed                      
  libignition-rendering4    4.7.0  h65e549c_1  conda-forge/linux-64       2 MB

  Downgrade:
────────────────────────────────────────────────────────────────────────────────

  ogre                    1.12.11  h89131c6_0  installed                      
  ogre                    1.10.12  hf655ca9_7  conda-forge/linux-64     116 MB

  Summary:

  Change: 2 packages
  Downgrade: 1 packages

  Total download: 119 MB

────────────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] y
Finished libignition-gui4                     (00m:00s)             870 KB    867 KB/s
Finished libignition-rendering4               (00m:01s)               2 MB      2 MB/s
Finished ogre                                 (00m:30s)             116 MB      6 MB/s
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
traversaro commented 3 years ago

Thanks @diegoferigo, indeed we are building the Ignition libraries for both Ogre 1.10 and 1.12 at the moment, so I updated the title.

traversaro commented 3 years ago

Related issue: https://github.com/conda-forge/libignition-rendering4-feedstock/issues/13 .

traversaro commented 2 years ago

The same problem happens with libignition-gazebo6 with ogre 1.12, while with ogre 1.10 works fine. Based on an old Gazebo issue ( https://github.com/osrf/gazebo/issues/2700 ) the fix seems just to add the correct missing directories to IGN_RENDERING_RESOURCE_PATH, i.e. after running:

export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media

at least Ignition Gazebo starts.

Tobias-Fischer commented 2 years ago

Cool - should we just amend the activation script to fix this issue?

traversaro commented 2 years ago

Yes, I actually wanted to check on a real Linux machine if that permitted to get ign gazebo to work, as ign gazebo on its own does not work on macOS or Windows, but I guess that also just fixing that aspect would not harm.

traversaro commented 2 years ago

In particular, Ign Gazebo seems to start, but it prints the following error:

[GUI] [Err] [OgreRTShaderSystem.cc:527] Unable to find shader lib. Shader generating will fail.
[GUI] [Err] [OgreRTShaderSystem.cc:112] Cannot find OGRE rtshaderlib. Shadows will be disabled.
traversaro commented 2 years ago

However, even on WSL2 I am able to see something with the same rendering artefacts I have with ogre 1.10, so I guess it is worth to add export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media .

traversaro commented 2 years ago

@Tobias-Fischer do you have any idea on how to modify the build script of libignition-rendering6 to add $CONDA_PREFIX/share/OGRE/Media only if ogre >= 1.12 is used? I am a bit out of ideas on that one.

Tobias-Fischer commented 2 years ago

I'm not sure at all. Do you want me to ask on gitter?

traversaro commented 2 years ago

I'm not sure at all. Do you want me to ask on gitter?

Good idea. I tought we could also just always add $CONDA_PREFIX/share/OGRE/Media also if Ogre is 1.10, but this results in the error:

[GUI] [Err] [OgreRTShaderSystem.cc:527] Unable to find shader lib. Shader generating will fail.
[GUI] [Err] [OgreRTShaderSystem.cc:112] Cannot find OGRE rtshaderlib. Shadows will be disabled.

being printed. Not sure if this actually influnce the rendering, as in WSL2 with Xming the rendering does not work correctly, not sure if it is due to the error:

qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-traversaro'
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported!  This is an application bug!
WARNING: Application calling GLX 1.3 function "glXQueryDrawable" when GLX 1.3 is not supported!  This is an application bug!

that is also printed.

Tobias-Fischer commented 2 years ago

Actually thinking about it - can't we simply do something like this in the activate script? When activating the environment, the packages are installed so we can simply check if a desired file exists. This would only work for ogre==1.12 (not >=1.12) but it might be a good start?

if compgen -G "$CONDA_PREFIX/lib/libOgreMain.so.1.12.*" > /dev/null; then
    export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media
fi
traversaro commented 2 years ago

WSL2 with Xming the rendering does not work correctly

This is actually not true! Simple the default world does not render anything useful, so it is not clear if anything works. By running ign gazebo --render-engine ogre shapes.sdf with ogre.10 I get: ign_gazebo_ogre_10

While just by setting

export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media

indeed the rendering is not working correctly, I wonder if due to the shader problems mentioned in https://github.com/conda-forge/libignition-gazebo-feedstock/issues/6#issuecomment-940845213 :

ign_gazebo_ogre_12

traversaro commented 2 years ago

Actually, I do not think that adding $CONDA_PREFIX/share/OGRE/Media to IGN_RENDERING_RESOURCE_PATH is doing anything in particular: the gui start even if you just set IGN_RENDERING_RESOURCE_PATH to random value:

export IGN_RENDERING_RESOURCE_PATH=ayeyebrazov

The point is that if you check the code (for example https://github.com/ignitionrobotics/ign-rendering/blob/c1b0a4112ae6e4dcb3bf3238022c7b6a33bba009/ogre/src/OgreRTShaderSystem.cc#L480) the IGN_RENDERING_RESOURCE_PATH is always meant to be a single directory, not a list of directories.

traversaro commented 2 years ago

Differently from Gazebo Classic, in which GAZEBO_RESOURCE_PATH is meant to store a list of directories and so the workaround is easy, in Ignition Rendering IGN_RENDERING_RESOURCE_PATH is meant to point to a single directory, so it is not easy to force Ogre to add some directories to the resource manager. However, to easily check if the problem can be solved, I just copied the files in a directory where they can be found:

cp ${CONDA_PREFIX}/share/OGRE/Media/ShadowVolume/* ${CONDA_PREFIX}/share/ignition/ignition-rendering6/ogre/media/rtshaderlib150/

After doing so, indeed the error changes:

(ign-gazebo-ogre-12) traversaro@IITICUBLAP257:~/mambaforge/envs/ign-gazebo-ogre-12/bin$ ign gazebo --render-engine ogre shapes.sdf
qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-traversaro'
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported!  This is an application bug!
WARNING: Application calling GLX 1.3 function "glXQueryDrawable" when GLX 1.3 is not supported!  This is an application bug!
terminate called after throwing an instance of 'Ogre::RuntimeAssertionException'
  what():  RuntimeAssertionException: gpu program could not be created in createGpuPrograms at /home/conda/feedstock_root/build_artifacts/ogre_1630271808061/work/Components/RTShaderSystem/src/OgreShaderProgramManager.cpp (line 251)

This is indeed an error similar to https://github.com/osrf/gazebo/issues/2700 . However, thanks to the experience in https://github.com/ignitionrobotics/ign-gazebo/issues/1116, I discovered that for ogre errors once should check the ogre.log, that in this case give as errors:

18:44:20: All done
18:44:20: Added resource location '/home/traversaro/mambaforge/envs/ign-gazebo-ogre-12/share/ignition/ignition-rendering6/ogre/media/rtshaderlib150' of type 'FileSystem' to resource group 'General'
18:44:20: Added resource location '/home/traversaro/mambaforge/envs/ign-gazebo-ogre-12/share/ignition/ignition-rendering6/media/materials/textures/com.png' of type 'FileSystem' to resource group 'General'
18:44:20: Program 'ea96c539ed38a286b56bd964a9c49f1a_VS' is not supported: 'ea96c539ed38a286b56bd964a9c49f1a_VS' 0:49(2): error: no matching function for call to `C(mat3, vec3, vec3)'; candidates are:
0:49(2): error:    void FFP_Transform(mat4, vec4, vec4)
0:49(2): error:    void FFP_Transform(mat4, vec4, vec3)
0:49(2): error:    void FFP_Transform(mat3x4, vec3, vec3)
0:49(2): error:    void FFP_Transform(mat4, vec3, vec3)

18:44:20: Error: RTSS - creating GpuPrograms for pass 0 of 'scene::Material(65500)' failed
Tobias-Fischer commented 2 years ago

Great investigative work! The ogre error to me looks like an upstream bug?

traversaro commented 2 years ago

Great investigative work! The ogre error to me looks like an upstream bug?

I am not sure. If we go back to the similar Ogre 1.12 error for Classic Gazebo (issue https://github.com/osrf/gazebo/issues/2700) according to https://github.com/osrf/gazebo/issues/2700#issuecomment-894739606 the problem occured in the change from 1.12.4 to 1.12.5. But in https://github.com/robotology/robotology-superbuild-dependencies-vcpkg v0.7.0, I have a build of Gazebo that works fine with Ogre 1.12.9 built via vcpkg, without even adding anything to any env variable. What I noticed is that the vcpkg build of ogre does something strange with the resources.cfg file (see https://github.com/microsoft/vcpkg/blob/2169ab765b49cfc5cd7eddfc8ff3e579326776f8/ports/ogre/portfile.cmake#L83), so I guess that the vcpkg's build of ogre somehow is able to find all that resources on its own, by loading the resources.cfg file, while the conda build of ogre (and also the stock build used in flatpack) is not using the resources.cfg. In particular, the resources.cfg file installed by vcpkg is:

# Ogre Core Resources
[OgreInternal]
FileSystem=../Media/ShadowVolume
FileSystem=../Media/RTShaderLib/materials
FileSystem=../Media/RTShaderLib/GLSL
FileSystem=../Media/RTShaderLib/HLSL_Cg
FileSystem=../Media/Terrain/

# Resources required by the sample browser and most samples.
[Essential]
Zip=../Media/packs/SdkTrays.zip
Zip=../Media/packs/profiler.zip
FileSystem=../Media/thumbnails

# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[General]
# Bites uses the next entry to discover the platform shaders
FileSystem=../Media
FileSystem=../Media/fonts
FileSystem=../Media/materials/programs
FileSystem=../Media/materials/scripts
FileSystem=../Media/materials/textures
FileSystem=../Media/materials/textures/terrain
FileSystem=../Media/models
FileSystem=../Media/particle
FileSystem=../Media/DeferredShadingMedia
FileSystem=../Media/DeferredShadingMedia/DeferredShading/post
FileSystem=../Media/PCZAppMedia
FileSystem=../Media/materials/scripts/SSAO
FileSystem=../Media/materials/textures/SSAO
FileSystem=../Media/volumeTerrain
FileSystem=../Media/CSMShadows
Zip=../Media/packs/cubemap.zip
Zip=../Media/packs/cubemapsJS.zip
Zip=../Media/packs/dragon.zip
Zip=../Media/packs/fresneldemo.zip
Zip=../Media/packs/ogretestmap.zip
Zip=../Media/packs/ogredance.zip
Zip=../Media/packs/Sinbad.zip
Zip=../Media/packs/skybox.zip
Zip=../Media/volumeTerrain/volumeTerrainBig.zip

FileSystem=../Media/PBR
FileSystem=../Media/PBR/filament
FileSystem=../Media/materials/textures/PBR
Zip=../Media/packs/DamagedHelmet.zip
Zip=../Media/packs/filament_shaders.zip

FileSystem=../Media/HLMS

[BSPWorld]
Zip=../Media/packs/oa_rpg3dm2.pk3

# Materials for visual tests
[Tests]
FileSystem=../Tests/Media

(Note that the Media directory is installed by vcpkg in <prefix>, so in a different location w.r.t. to conda). Shaders are still a bit of a mistery for me, but I wonder if the compilation problem can be solved by adding some more directories to the Ogre resource locator, or convince ogre to read directories from the installed resources.cfg file.

kzorina commented 1 year ago

Hello. Is there any solution/fix to this problem? Setting IGN_RENDERING_RESOURCE_PATH did not help me...

polyhobbyist commented 1 year ago

@traversaro I'm working on the flat rendering issue. I've fixed the RT Shader issues (pending PR in the ms-iot org); and have shadows. But the unshaded rendering has been driving me bonkers for longer than I'd care to admit...

traversaro commented 1 year ago

ogre2/ogre-next is now working fine (see https://github.com/conda-forge/libignition-gazebo-feedstock/issues/27#issuecomment-1170911834), I think we can drop the ogre1.12 builds. The issue can be tackled if anyone wants to work on them.