所以我正在我的 MacBook Air M1 上使用 ROS2,并且需要 Gazebo 进行模拟。我正在使用的操作系统是 Parallels Desktop 18 上的 Ubuntu 22.04 ARM。我运行的是 ros2 Humble 及其对应的 Gazebo Gazebo Gardens。 Rviz 运行得很好,但是当我启动 Gazebo 模拟器时运行命令
gz sim
gazebo 打开,显示演示菜单(我猜它们是演示,其中一个写着“NAO Joint Control”)。当我单击任一演示的“空项目”时,编辑器式窗口会打开,但随后立即崩溃。终端输出以下错误消息:
libGL error: pci id for fd 42: 1ab8:0010, driver (null)
pci id for fd 43: 1ab8:0010, driver (null)
libGL error: pci id for fd 44: 1ab8:0010, driver (null)
pci id for fd 52: 1ab8:0010, driver (null)
libEGL warning: pci id for fd 64: 1ab8:0010, driver (null)
pci id for fd 65: 1ab8:0010, driver (null)
terminate called after throwing an instance of 'Ogre::UnimplementedException'
what(): OGRE EXCEPTION(9:UnimplementedException): in GL3PlusTextureGpu::copyTo at ./RenderSystems/GL3Plus/src/OgreGL3PlusTextureGpu.cpp (line 685)
Stack trace (most recent call last):
#31 Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff93fcb06b, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
#30 Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff9402b523, in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#29 Object "/lib/aarch64-linux-gnu/libglib-2.0.so.0", at 0xffff92e02f13, in g_main_context_iteration
#28 Object "/lib/aarch64-linux-gnu/libglib-2.0.so.0", at 0xffff92e5aeab, in
#27 Object "/lib/aarch64-linux-gnu/libglib-2.0.so.0", at 0xffff92e05a6f, in g_main_context_dispatch
#26 Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff9402c057, in
#25 Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff93fcff87, in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
#24 Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff93fccb8f, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#23 Object "/lib/aarch64-linux-gnu/libQt5Widgets.so.5", at 0xffff95472abf, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#22 Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff93ffcfd3, in QObject::event(QEvent*)
#21 Object "/usr/lib/aarch64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0xffff58337dd7, in gz::gui::plugins::RenderWindowItem::Ready()
#20 Object "/usr/lib/aarch64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0xffff58337917, in gz::gui::plugins::RenderThread::Initialize[abi:cxx11]()
#19 Object "/usr/lib/aarch64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0xffff58343d17, in gz::gui::plugins::RenderThreadRhiOpenGL::Initialize[abi:cxx11]()
#18 Object "/usr/lib/aarch64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0xffff5833b10f, in gz::gui::plugins::GzRenderer::Initialize[abi:cxx11]()
#17 Object "/lib/aarch64-linux-gnu/libgz-rendering7.so.7", at 0xffff582c39c3, in gz::rendering::v7::BaseRenderEngine::CreateScene(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#16 Object "/lib/aarch64-linux-gnu/libgz-rendering7.so.7", at 0xffff582cc03f, in gz::rendering::v7::BaseRenderEngine::CreateScene(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#15 Object "/lib/aarch64-linux-gnu/libgz-rendering7.so.7", at 0xffff582dfff3, in gz::rendering::v7::BaseScene::CreateMaterials()
#14 Object "/usr/lib/aarch64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0xffff33b50423, in gz::rendering::v7::Ogre2Material::SetTextureMapImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Ogre::PbsTextureTypes)
#13 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0xffff337ab46b, in Ogre::TextureGpuManager::_waitFor(Ogre::TextureGpu*, bool)
#12 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0xffff337ab0af, in Ogre::TextureGpuManager::_update(bool)
#11 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0xffff3368ebaf, in Ogre::ObjCmdBuffer::execute()
#10 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0xffff3368cf37, in Ogre::ObjCmdBuffer::NotifyDataIsReady::execute()
#9 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0xffff3379cef3, in Ogre::TextureFilter::GenerateHwMipmaps::_executeSerial(Ogre::TextureGpu*)
#8 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/OGRE/RenderSystem_GL3Plus.so", at 0xffff330f2633, in Ogre::GL3PlusTextureGpu::copyTo(Ogre::TextureGpu*, Ogre::TextureBox const&, unsigned char, Ogre::TextureBox const&, unsigned char, bool, Ogre::CopyEncTransitionMode::CopyEncTransitionMode, Ogre::CopyEncTransitionMode::CopyEncTransitionMode)
#7 Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/OGRE/RenderSystem_GL3Plus.so", at 0xffff330b4997, in
#6 Object "/lib/aarch64-linux-gnu/libstdc++.so.6", at 0xffff971e2d23, in __cxa_throw
#5 Object "/lib/aarch64-linux-gnu/libstdc++.so.6", at 0xffff971e2a3f, in std::terminate()
#4 Object "/lib/aarch64-linux-gnu/libstdc++.so.6", at 0xffff971e29db, in
#3 Object "/lib/aarch64-linux-gnu/libstdc++.so.6", at 0xffff971e51fb, in __gnu_cxx::__verbose_terminate_handler()
#2 Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff9b22712f, in abort
#1 Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff9b23a67b, in raise
#0 Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff9b27f200, in
Aborted (Signal sent by tkill() 13395 1000)
有人在配备 M1/M2 芯片的 MacBook 上运行 Gazebo 吗?如果是的话,怎么办?
您是否尝试使用旧的渲染引擎(ogre 而不是 ogre2)运行?
ign Gazebo --渲染引擎食人魔
根据此 GitHub 问题评论,您可以尝试通过将
export LIBGL_ALWAYS_SOFTWARE=1
放入 .bashrc 文件中来启用环境变量 LIBGL_ALWAYS_SOFTWARE。
使用不同的 Gazebo sim 和相同的设置(除了我有 Parallels 19),我遇到了同样的错误 - 尝试此操作后,它能够成功启动并工作。