ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
836 stars 464 forks source link

Pixmap error #1154

Closed BrunoXL closed 3 years ago

BrunoXL commented 7 years ago

I am getting a could not load pixmap error on launching rviz from command line. Edit:

env | grep ROS output:

 ROS_ROOT=/opt/ros/kinetic/share/ros
 ROS_PACKAGE_PATH=/home/bruno/rodain/src:/opt/ros/kinetic/share
 ROS_MASTER_URI=http://localhost:11311
 ROSLISP_PACKAGE_DIRECTORIES=/home/bruno/rodain/devel/share/common-lisp
 ROS_DISTRO=kinetic
 ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
[ERROR] [1506641021.377086471]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/rotate.svg'
[ERROR] [1506641021.377135684]: Could not load pixmap 'package://rviz/icons/rotate.svg' -- using default cursor instead.
[ERROR] [1506641021.377253031]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/rotate_cam.svg'
[ERROR] [1506641021.377287850]: Could not load pixmap 'package://rviz/icons/rotate_cam.svg' -- using default cursor instead.
[ERROR] [1506641021.377410667]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/move2d.svg'
[ERROR] [1506641021.377431056]: Could not load pixmap 'package://rviz/icons/move2d.svg' -- using default cursor instead.
[ERROR] [1506641021.377542997]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/move_z.svg'
[ERROR] [1506641021.377562364]: Could not load pixmap 'package://rviz/icons/move_z.svg' -- using default cursor instead.
[ERROR] [1506641021.377665627]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/zoom.svg'
[ERROR] [1506641021.377683917]: Could not load pixmap 'package://rviz/icons/zoom.svg' -- using default cursor instead.
[ERROR] [1506641021.377811890]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/crosshair.svg'
[ERROR] [1506641021.377880949]: Could not load pixmap 'package://rviz/icons/crosshair.svg' -- using default cursor instead.
[ERROR] [1506641021.416289617]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/cursor.svg'
[ERROR] [1506641021.463267288]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/classes/FocusCamera.svg'
[ERROR] [1506641021.463561290]: Could not load pixmap 'package://rviz/icons/crosshair.svg' -- using default cursor instead.
[ERROR] [1506641021.463812126]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/classes/Measure.svg'
[ERROR] [1506641021.463971367]: Could not load pixmap 'package://rviz/icons/crosshair.svg' -- using default cursor instead.
[ERROR] [1506641021.468855407]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/classes/PublishPoint.svg'
[ERROR] [1506641021.469326412]: Could not load pixmap 'package://rviz/icons/rotate.svg' -- using default cursor instead.
[ERROR] [1506641021.469346630]: Could not load pixmap 'package://rviz/icons/rotate_cam.svg' -- using default cursor instead.
[ERROR] [1506641021.469356549]: Could not load pixmap 'package://rviz/icons/move2d.svg' -- using default cursor instead.
[ERROR] [1506641021.469365634]: Could not load pixmap 'package://rviz/icons/move_z.svg' -- using default cursor instead.
[ERROR] [1506641021.469374719]: Could not load pixmap 'package://rviz/icons/zoom.svg' -- using default cursor instead.
[ERROR] [1506641021.469386709]: Could not load pixmap 'package://rviz/icons/crosshair.svg' -- using default cursor instead.
[ERROR] [1506641021.473885044]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/classes/Displays.svg'
[ERROR] [1506641021.477150495]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/classes/Views.svg'
[ERROR] [1506641021.478738232]: Could not load pixmap '/opt/ros/kinetic/share/rviz/icons/classes/Time.svg'

OBS: ogre.log file is not being generated

wjwwood commented 7 years ago

Please do not post a picture of text. I will close this until it is updated, at which point I'll reopen it.

Thanks.

wjwwood commented 7 years ago

Also, please include the output of env | grep ROS and the ogre.log file if you can (see rviz -h for info on how to get the ogre.log file).

BrunoXL commented 7 years ago

@wjwwood I have updated this issue as you asked me. Could you reopen it?

wjwwood commented 7 years ago

Do those files exist, for example does /opt/ros/kinetic/share/rviz/icons/rotate.svg exist?

BrunoXL commented 7 years ago

Yes, I checked some of them and they really exist.

wjwwood commented 7 years ago

Please link the ogre.log file, again see rviz -h for how to generate it.

BrunoXL commented 7 years ago

For some reason running rosrun rviz rviz -l is not generating the ogre.log file. Therefore, I redirect the command line output to the I`m linking.

ogre.log

wjwwood commented 7 years ago

@BrunoXL It does generate it, but it's probably in ~/.ros, since that is likely the working directory of rosrun.

wjwwood commented 7 years ago

rviz -l might "just work" and put the file in the current directory.

wjwwood commented 7 years ago

How do you have your ogre installed? It looks like it cannot load any svg files, which I think could only really happen if ogre was built without support for it (not even sure that's possible).

Please try to provide the ogre.log file produced by rviz -l based on my previous two comments.

BrunoXL commented 7 years ago

I do have ogre installed.

bruno@glei:~$ sudo dpkg -s libogre-1.9.0v5   
      Package: libogre-1.9.0v5
      Status: install ok installed
      Priority: optional
      Section: libs
      Installed-Size: 11160 
      Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>`

The only log files generated are those from ros.

Neoplanetz commented 7 years ago

I have same problem with BrunoXL. Did you solve this isue??

BrunoXL commented 7 years ago

@Neoplanetz I could not solve it so far. If you run rviz -l a log file is generated?

wjwwood commented 7 years ago

@BrunoXL what's in /home/bruno/rodain/src?

wjwwood commented 7 years ago

Or even, what does rospack find rviz return?

BrunoXL commented 7 years ago

/opt/ros/kinetic/share/rviz

wjwwood commented 7 years ago

@BrunoXL I cannot reproduce your issue on any of my setups.

The code which is producing this error is here:

https://github.com/ros-visualization/rviz/blob/7970ba08cee3810cfa1609c3b0f5136970eb2f7c/src/rviz/load_resource.cpp#L85

It is based solely on the result of QPixmap::load():

http://doc.qt.io/qt-5/qpixmap.html#load

I don't know what else to do to help you. Perhaps the file cannot be read for some reason, permissions or corruption, I don't know. You could try writing a simple Qt program that tries to load those files to further debug it.

I'm sorry I could not figure out the issue for you.

mescarra commented 6 years ago

I'm having the exact same issue here. Files are actually there but the error appears all the same. BTW, I can realize it's not loading the images because the default_class_icon.png appears instead of those images.

This is one of those things you can live with, maybe that's why this thread is dead.

francescomilano172 commented 5 years ago

I had the same problem, due to a corrupted Qt5 installation. You could try setting the following environmental variable: export QT_DEBUG_PLUGINS=1 and then running rviz in the same terminal. In my case the debug prints said: Cannot load library /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqsvg.so: (libQt5Svg.so.5: cannot open shared object file: No such file or directory). So I solved the issue by reinstalling the related Qt plugin (sudo apt-get --reinstall install libqt5svg5).

pirobot commented 5 years ago

Make sure you don't have another Qt library in your LD_LIBRARY_PATH ahead of what ROS needs. I had the same problem because I was also trying VREP and had the following lines in my ~/.bashrc file:

export VREP_ROOT=$HOME/bin/V-REP_PRO_EDU_V3_6_2_Ubuntu16_04/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VREP_ROOT
export QT_QPA_PLATFORM_PLUGIN_PATH=$VREP_ROOT

Once I commented these out and sourced my ~/.bashrc file the problem went away.

jacobhuesman commented 4 years ago

Noticed this bug while running rviz2 from a docker container. It looks like the debian package for rviz2 doesn't include libqt5svg5 as a dependency. Installing the package manually fixed the issue for me.

davetcoleman commented 3 years ago

In ROS2 Rolling I'm getting a lot of errors regarding this icons, and @jacobhuesman's fix did not work. I'm seeing stuff like:

[moveit_studio_ui-1] [rviz_common:debug] Error retrieving file [file:///opt/ros/rolling/share/rviz_default_plugins/icons/classes/Intensity.svg]: Couldn't open file /opt/ros/rolling/share/rviz_default_plugins/icons/classes/Intensity.svg, at /tmp/binarydeb/ros-rolling-rviz-common-8.7.0/src/rviz_common/load_resource.cpp:55

Checking the file system, the file does not exist. It appears in ROS 2 some of the icons where added in this PR https://github.com/ros2/rviz/pull/235/files but not the ones I'm missing, including Intensity.svg

rhaschke commented 3 years ago

@davetcoleman, I think you want to report rviz2 issues over here: https://github.com/ros2/rviz. This is the rviz1 repo.

jasonbeach commented 2 years ago

Noticed this bug while running rviz2 from a docker container. It looks like the debian package for rviz2 doesn't include libqt5svg5 as a dependency. Installing the package manually fixed the issue for me.

@jacobhuesman's solution of installing libqt5svg5 worked for me (ros2 galactic inside ubuntu 18.04 docker image)