When running ros in Docker and preparing to start GUI nodes such as rviz or gazebo, the error is as follows:
# rosrun rviz rviz
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[ INFO] [1614239106.900079430]: rviz version 1.13.15
[ INFO] [1614239106.900133052]: compiled against Qt version 5.9.5
[ INFO] [1614239106.900144142]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1614239106.911075450]: Forcing OpenGl version 0.
dbus[623]: The last reference on a connection was dropped without closing the connection. This is a bug in an application. See dbus_connection_unref() documentation for details.
Most likely, the application was supposed to call dbus_connection_close(), since this is a private connection.
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)
Two workarounds:
docker run
Add parameters in--priviledged
(not recommended)docker run
Remove the parameter in--network host
(recommended)
This error has nothing to do with QStandardPaths
and XDG_RUNTIME_DIR
, the first warning can be ignored.
For more information, please refer to my other blog about running ROS in Docker: https://blog.csdn.net/liuqixuan1994/article/details/114089786