小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
使用鱼香的docker安装ROS,可以启动roscore,但是无法启动rviz和gazebo
-
-
问题描述
在B站看到鱼香的用Docker实现一键安装ROS,干好是我需要的,于是按照视频的指引一路向下。安装的过程很顺利,一直到容器的启动都很流畅。启动容器后,可以启动roscore和rqt,但是在启动rviz和gazebo的时候就会报错无法启动。试了indigo和melodic两个版本的ros都有这样的问题。
宿主机是ubuntu20.04+ros noetic,GPU是N卡4060,CUDA版本是12.2,已经安装了NVIDIA Container Runtime和nvidia-docker2。看到前面有人说使用xhost +,但是没有解决我的问题。在启动roscore时可以正常启动并显示ros版本。
启动rviz时报错如下:[ WARN] [1710482553.383389765]: OGRE EXCEPTION(3:RenderingAPIException): Unable to create a suitable GLXContext in GLXContext::GLXContext at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXContext.cpp (line 61)
rviz::RenderSystem: error creating render window: OGRE EXCEPTION(3:RenderingAPIException): Unable to create a suitable GLXContext in GLXContext::GLXContext at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXContext.cpp (line 61)
[ERROR] [1710482553.383460661]: Unable to create the rendering window after 100 tries.
[ INFO] [1710482553.383477886]: Stereo is NOT SUPPORTED
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Aborted (core dumped)上面是最后显示的内容,前面一直是
[ WARN] [1710482553.383389765]: OGRE EXCEPTION(3:RenderingAPIException): Unable to create a suitable GLXContext in GLXContext::GLXContext at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXContext.cpp (line 61)
rviz::RenderSystem: error creating render window: OGRE EXCEPTION(3:RenderingAPIException): Unable to create a suitable GLXContext in GLXContext::GLXContext at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXContext.cpp (line 61)循环显示
在启动gazebo时的报错如下:
libGL error: No matching fbConfigs or visuals found
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
X Error of failed request: GLXBadContext
Major opcode of failed request: 152Major opcode of failed request: 152 (GLX)
(GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)Minor opcode of failed request: 6
(X_GLXIsDirect)
Serial number of failed request: 44
Serial number of failed request: 44Current serial number in output stream: 43Current serial number in output stream: 43
希望能有好心的大佬帮忙分析一下是什么问题,可以参考什么方法进行解决。万分感谢!
-
-
@1974020172 在 使用鱼香的docker安装ROS,可以启动roscore,但是无法启动rviz和gazebo 中说:
nvidia-docker2
要用nvidia的镜像才行,一键安装的都不合适
-
@小鱼 您好!请问可以说的详细一点吗?或者说能不能告知一些比较详细的教程在哪里可以找到?因为docker用不了还重装了系统了
新入门的小白却是不是很懂怎么解决这种问题,恳请大佬赐教! -
@1974020172 就是nvidia显卡显示需要专门的docker镜像,可以去docker hub找一下相关镜像,nvidia开头的