ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

rxgraph graph not visible on Arch

asked 2011-08-06 21:38:49 -0600

ajc gravatar image

updated 2014-01-28 17:10:10 -0600

ngrennan gravatar image

When I run rxgraph:

[ajc@whales ~]$ rxgraph
Traceback (most recent call last):
  File "/home/ajc/ros-diamondback/rx/xdot/src/xdot/wxxdot.py", line 185, in OnPaint
    ctx = wxcairo.ContextFromDC(dc)
  File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/wxcairo.py", line 124, in ContextFromDC
    ctx = pycairoAPI.Context_FromContext(ctxptr, pycairoAPI.Context_Type, None)
AttributeError: 'Pycairo_CAPI' object has no attribute 'Context_FromContext'
Traceback (most recent call last):
  File "/home/ajc/ros-diamondback/rx/xdot/src/xdot/wxxdot.py", line 185, in OnPaint
    ctx = wxcairo.ContextFromDC(dc)
  File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/wxcairo.py", line 124, in ContextFromDC
    ctx = pycairoAPI.Context_FromContext(ctxptr, pycairoAPI.Context_Type, None)
AttributeError: 'Pycairo_CAPI' object has no attribute 'Context_FromContext'
Traceback (most recent call last):
  File "/home/ajc/ros-diamondback/rx/xdot/src/xdot/wxxdot.py", line 185, in OnPaint
    ctx = wxcairo.ContextFromDC(dc)
  File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/wxcairo.py", line 124, in ContextFromDC
    ctx = pycairoAPI.Context_FromContext(ctxptr, pycairoAPI.Context_Type, None)
AttributeError: 'Pycairo_CAPI' object has no attribute 'Context_FromContext'
^C

The main "pane" is empty, where graphs should be. On the info sidgebar, I see this:

Node [/rosout]
Publications: 
 * /rosout_agg [rosgraph_msgs/Log]

Subscriptions: 
 * /rosout [rosgraph_msgs/Log]

Services: 
 * /rosout/get_loggers
 * /rosout/set_logger_level
Pid: 8337
Connections:
 * topic: /rosout
    * to: http://whales:39606/
    * direction: inbound
    * transport: TCPROS
 * topic: /rosout
    * to: http://whales:52244/
    * direction: inbound
    * transport: TCPROS

I'm running Arch linux. More information:

[ajc@whales ~]$ uname -a
Linux whales 2.6.39-ARCH #1 SMP PREEMPT Sat Jul 9 15:31:04 CEST 2011 i686 AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 AuthenticAMD GNU/Linux
[ajc@whales ~]$ python --version
Python 2.7.2
[ajc@whales ~]$ sudo pacman -Ss wxpython
Password: 
extra/wxpython 2.8.12.1-1 [installed]
    A wxWidgets GUI toolkit for Python
community/wammu 0.35-1
    A wxPython-based GUI for Gammu

My suspicion is that this is a problem with Arch Linux's default /usr/bin/python, which is version 3, and how overriding it to version2 plays with the repo's wxWidgets.

Any help would be greatly appreciated!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2011-09-01 15:44:01 -0600

DavidS gravatar image

I have the same problem. I don't think it is due to conflicts between different versions of python.

$ sudo pacman -Ql wxpython

This command will list all the files installed for wxpython, and you should notice that everything is installed in the python2 site-package directory.

I tried using the latest version of rxgraph from the developer, to no avail.

I believe the problem has to due with cairo and pycairo. You can try installing a local copy of an earlier version of cairo and pycairo (e.g. 1.8). Use the same version that Ubuntu uses. I haven't tried this myself, as I don't need the diagrams badly enough...

edit flag offensive delete link more
1

answered 2011-09-08 00:32:42 -0600

gleechinese gravatar image

I had the same problem as well. I fixed it by changing a line in /usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib:

Line 369: elif cairo.version_info < (1,9) or cairo.version_info == (1,10,8):

to

elif cairo.version_info >= (1,9) or cairo.version_info == (1,10,8):

Admittedly, this is a really poor way to solve the problem, but it worked for me and hasn't caused any problems (yet).

edit flag offensive delete link more
0

answered 2018-04-25 03:46:45 -0600

In order to not be forced to old versions, the following might also help. Instead of messing up random version numbers inside the code, have a look at this commit (which has been merged to wxwidget's main repository):

https://github.com/wxWidgets/wxPython...

The only question is whether 2.8 versions will receive this patch or not. If not, you can manually patch it before installation (if on arch or gentoo for example). Otherwise you must probably install the package from source or modify the file /usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/wxcairo.py manually every time you re-install it.

edit flag offensive delete link more

Comments

Thanks for taking the time to respond here, but do please note this is a 7 year old question. wxWidgets is no longer used in ROS (or at least not in the tools the OP reports about).

gvdhoorn gravatar image gvdhoorn  ( 2018-04-25 03:56:38 -0600 )edit

Question Tools

Stats

Asked: 2011-08-06 21:38:49 -0600

Seen: 648 times

Last updated: Sep 08 '11