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

rqt_graph not shown in window

asked 2014-02-24 23:03:55 -0600

sara.ershadi gravatar image

updated 2014-07-17 00:01:04 -0600

130s gravatar image

Hi ,

I am new in ROS .

I am using ubuntu 12.04 LTS . ROS Hydro

I want to test the tuturial 6 about undrstanding ROS topics.

I can run the first command . but in part when I want to see the output of rosrun rqt_graph rqt_graph

in the opened window I can't see the map of rqt graph.

the opened window is empty but there are some button in it.

sara@sara:~$ rosrun rqt_graph rqt_graph
Couldn't import dot_parser, loading of dot files will not be possible.
PluginHandlerDirect._restore_settings() plugin "rqt_graph/RosGraph#0" raised an exception:
Traceback (most recent call last):
  File "/opt/ros/hydro/lib/python2.7/dist-packages/qt_gui/plugin_handler_direct.py", line 116, in _restore_settings
    self._plugin.restore_settings(plugin_settings_plugin, instance_settings_plugin)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 202, in restore_settings
    self._refresh_rosgraph()
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 226, in _refresh_rosgraph
    self._update_graph_view(self._generate_dotcode())
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 259, in _update_graph_view self._redraw_graph_view()
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 292, in _redraw_graph_view same_label_siblings=True)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/qt_dotgraph/dot_to_qt.py", line 228, in dotcode_to_qt_items graph = pydot.graph_from_dot_data(dotcode.encode("ascii", "ignore"))
  File "/usr/lib/pymodules/python2.7/pydot.py", line 199, in graph_from_dot_data
    return dot_parser.parse_dot_data(data)
NameError: global name 'dot_parser' is not defined

What should I do ?

Thanks in advance Sarah

edit retag flag offensive close merge delete

Comments

I also got the same problem with you. I am using Ubuntu 13.10 and ROS Hydro, installed from source a week ago.

Veerachart gravatar image Veerachart  ( 2014-03-03 19:14:02 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
7

answered 2017-04-15 14:15:44 -0600

burtbick gravatar image

I know that this is an older topic and that there was an answer given. But in my case that answer did NOT work.

I'm running indigo installed on Linux Mint 17.1 (based on Ubuntu 14.04 Trusty). I was having the same error as listed above and all the solutions I found didn't help. Until I did some digging.

I found that due to having more than one Python version installed the pip that was running by default was updating a different version of Python than ROS was using. So when I tried un-installing pyparsing and pydot and then installing newer versions there was no apparent change in behavior.

Trying to downgrade pyparsing gave an error and would not install the 1.5.7 version.

What I did find was that I had to explicitly run the version of pip from where the version of Python 2.7 being used by ROS was running on my system.

In my case this was sudo /usr/bin/pip install --upgrade pydot This caused pyparsing and pydot to be updated. Note that I got a message about not uninstalling pydot due to it being owned by OS, but this didn't impact the fix

Once the update completed rqt_graph is now working on my system.

You can do: which python To locate the directory where python is running from and double check where your pip is by doing: which pip

Both pip and python should be on the same path (e.g. /usr/bin in my case) but the default pip binary was being found at /usr/local/bin and not /usr/bin.

So I thought I would add this note for anyone who happens to be tearing their hair out with a similar issue.

Burt

edit flag offensive delete link more
2

answered 2014-03-06 19:35:49 -0600

Veerachart gravatar image

updated 2014-03-06 19:37:13 -0600

Well, I found this http://stackoverflow.com/questions/15951748/pydot-and-graphviz-error-couldnt-import-dot-parser-loading-of-dot-files-will and tried according to the top comment. It works! (You may need to add sudo.) Hope it also works with yours. (I cannot post to answer.)

edit flag offensive delete link more

Comments

In case you did not install by pip, try "sudo apt-get remove python-pyparsing".

Veerachart gravatar image Veerachart  ( 2014-03-06 20:33:07 -0600 )edit

Hi @Veerachart can you give all steps you used to resolve the problem? I'm also using Ubuntu 13.10 with Hydro. Thanks!

TSC gravatar image TSC  ( 2014-03-31 12:42:22 -0600 )edit

Never mind: just follow the top comment (1. $ sudo pip uninstall pyparsing 2. $ sudo pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709 3. $ pip install pydot)

TSC gravatar image TSC  ( 2014-04-01 00:53:30 -0600 )edit

I am having the same issue as above, and I tried to do this, but pip stopped working after i uninstalled pyparsing.

LikeSmith gravatar image LikeSmith  ( 2016-04-25 14:35:46 -0600 )edit
0

answered 2016-10-05 04:06:52 -0600

ganam gravatar image

I found this answer in some Asian blog and it worked with me http://kawauso-festival.blogspot.com....

the steps were :

$ sudo pip uninstall pyparsing

$ pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709

$ sudo pip install pydot

$ rosrun rqt_graph rqt_graph
edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2014-02-24 23:03:55 -0600

Seen: 4,671 times

Last updated: Apr 15 '17