启用arbotix_gui程序时报错,wx._core.PyAssertionError
arbotix_gui
Traceback (most recent call last):
File "/home/huanyu/robot_ws/devel/bin/arbotix_gui", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/huanyu/robot_ws/src/arbotix_ros-indigo-devel/arbotix_python/bin/arbotix_gui", line 205, in <module>
frame = controllerGUI(None, True)
File "/home/huanyu/robot_ws/src/arbotix_ros-indigo-devel/arbotix_python/bin/arbotix_gui", line 131, in __init__
self.onPaint()
File "/home/huanyu/robot_ws/src/arbotix_ros-indigo-devel/arbotix_python/bin/arbotix_gui", line 160, in onPaint
dc = wx.PaintDC(self.movebase)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_gdi.py", line 5130, in __init__
_gdi_.PaintDC_swiginit(self,_gdi_.new_PaintDC(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "IsOk()" failed at ../src/common/dcgraph.cpp(437) in SetTextBackground(): wxGCDC(cg)::SetTextBackground - invalid DC
该回答通过自己思路及引用到GPTᴼᴾᴱᴺᴬᴵ搜索,得到内容具体如下:
根据报错信息,看起来是wxPython版本问题引起的错误。这个错误可能是由于旧版本的wxPython库中的某些功能被弃用导致的。建议您尝试更新wxPython库,然后重新运行程序,看看问题是否解决了。
如果您使用的是Ubuntu或Debian等基于Debian的Linux发行版,请尝试使用以下命令更新wxPython库:
sudo apt-get update
sudo apt-get install python-wxgtk3.0 python-wxgtk3.0-dev
如果您使用的是其他Linux发行版或操作系统,请查看wxPython的官方文档,了解如何在您的系统上安装最新版本的wxPython库。
如果以上回答对您有所帮助,点击一下采纳该答案~谢谢
这个错误可能是由于wxPython库的一个bug引起的。尝试更新wxPython库,看看是否解决了问题。你可以使用以下命令在终端中更新wxPython库:
pip install -U wxPython
如果更新wxPython库不起作用,你可以尝试使用另一个版本的wxPython。根据你的操作系统和Python版本,可以在wxPython官网上找到不同版本的wxPython库。
另外,还要确保你的系统已经安装了OpenGL和GLUT库,因为这些库是arbotix_gui程序的依赖项之一。你可以使用以下命令在Ubuntu中安装这些库:
sudo apt-get install freeglut3 freeglut3-dev libglu1-mesa libglu1-mesa-dev mesa-common-dev
如果你使用的是其他操作系统,可以在官网上找到对应的安装方式。