RViz2 in docker - error while starting
Hi, I'm trying ros2-humble in a docker setup on my m1 mac.
So far, I got a devcontainer running and I can use gui tools like rqt, rqt_graph and that from turtlesim_node (tutorial). I'm therefore using XQuartz (In the xquartz terminal expose the ip: xhost + 192.168.0.114:0) and in the docker container, I'm setting the env variable DISPLAY=192.168.0.114:0 as well. When I start GUI apps, XQuartz automatically opens and works fine!
But not with RViz2. I installed it with sudo apt-get install ros-humble-rviz2
within my running container.
When I try to run with rviz2
or ros2 run rviz2 rviz2
I get the following error message:
[ERROR] [1675002518.131453001] [rviz2]: Failed to create an OpenGL context. BadValue (integer parameter out of range for operation)
[ERROR] [1675002518.131543001] [rviz2]: RenderingAPIException: Unable to create a suitable GLXContext in GLXContext::GLXContext at ./.obj-aarch64-linux-gnu/ogre-v1.12.1-prefix/src/ogre-v1.12.1/RenderSystems/GLSupport/src/GLX/OgreGLXContext.cpp (line 60)
[ERROR] [1675002518.131683460] [rviz2]: rviz::RenderSystem: error creating render window: RenderingAPIException: Unable to create a suitable GLXContext in GLXContext::GLXContext at ./.obj-aarch64-linux-gnu/ogre-v1.12.1-prefix/src/ogre-v1.12.1/RenderSystems/GLSupport/src/GLX/OgreGLXContext.cpp (line 60)
You should be able to reproduce with:
docker run -it --privileged -e DISPLAY=192.168.0.114:0 -e QT_X11_NO_MITSHM=1 --net=host --name test-rviz2 ros:humble bash
Really appreciate some ideas :) Robin