LoginSignup
0
1

More than 5 years have passed since last update.

rqt_graphでノードが表示されなくなった場合

Last updated at Posted at 2017-08-12

目的

ROSのrqt_graphで、ノードが表示されなくなった場合の対処。

症状

rqt_graphをコンソールから立ち上げるとdot_parserが定義されていないとエラーがでる。
pythonをアップデートするなどで、依存関係が壊れたことが原因と思われる。

$ 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/indigo/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/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 206, in restore_settings
    self._refresh_rosgraph()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 231, in _refresh_rosgraph
    self._update_graph_view(self._generate_dotcode())
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 266, in _update_graph_view
    self._redraw_graph_view()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 299, in _redraw_graph_view
    same_label_siblings=True)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/qt_dotgraph/dot_to_qt.py", line 234, in dotcode_to_qt_items
    graph = pydot.graph_from_dot_data(dotcode.encode("ascii", "ignore"))
  File "/usr/lib/python2.7/dist-packages/pydot.py", line 220, in graph_from_dot_data
    return dot_parser.parse_dot_data(data)
NameError: global name 'dot_parser' is not defined

対処

pydotとpyparsingを再インストールする

sudo chmod 777 -R /usr/lib/python2.7/dist-packages/
pip uninstall pydot
pip uninstall pyparsing
pip install pydot
pip install pyparsing

参考

ROS indigoでrqt関連のパッケージがなくなったり、いろいろ動作しなくなった件:かわうそまつり
http://kawauso-festival.blogspot.jp/2016/07/ros-indigorqt.html
・・・pyparsingのバージョンを変更しないと修復できない場合もある。

NameError: global name 'dot_parser' is not definedとpythonで出てきたときの対処法:qiita
http://qiita.com/v_and_p/items/e6f0243d7d3cba5b7a2f

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1