ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

rqt on ROS2 - cannot export perspective - 'QtCore' is not defined

asked 2019-05-07 12:21:34 -0600

bergercookie gravatar image

updated 2019-05-08 03:12:24 -0600

gvdhoorn gravatar image

I've launched rqt and I'm getting the following error when I'm trying to save the current layout to a perspective file:

Traceback (most recent call last):
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/", line 188, in save_settings_completed
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/", line 399, in _on_export_perspective_continued
    self._convert_values(data, self._export_value)
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/", line 423, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/", line 420, in _convert_values
    keys[key] = convert_function(keys[key])
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/", line 460, in _export_value
    reimported = self._import_value(data)
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/", line 429, in _import_value
    return QByteArray.fromHex(eval(value['repr(QByteArray.hex)']))
  File "<string>", line 1, in <module>
NameError: name 'QtCore' is not defined

I 'm using rqt on ROS 2. The same procedure is successful when launching the ROS 1 equivalent. Any pointers?

edit retag flag offensive close merge delete


Re-importing QtCore as follows solves it, but sounds more of a hack to me than an actual solution:

import python_qt_binding.QtCore as QtCore

bergercookie gravatar image bergercookie  ( 2019-05-07 12:36:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-06 09:56:21 -0600

marguedas gravatar image

I faced the same issue today and it looks like the code included this import until recently and it was (I believe involuntarily) removed. See for a PR to add it back

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-05-07 12:21:34 -0600

Seen: 209 times

Last updated: Jun 06 '19