Robotics StackExchange | Archived questions

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

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/perspective_manager.py", line 188, in save_settings_completed
    callback(*callback_args)
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/perspective_manager.py", 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/perspective_manager.py", line 423, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/perspective_manager.py", line 420, in _convert_values
    keys[key] = convert_function(keys[key])
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/perspective_manager.py", line 460, in _export_value
    reimported = self._import_value(data)
  File "/opt/ros/crystal/lib/python3.6/site-packages/qt_gui/perspective_manager.py", 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?

Asked by bergercookie on 2019-05-07 12:21:34 UTC

Comments

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

Asked by bergercookie on 2019-05-07 12:36:25 UTC

Answers

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 https://github.com/ros-visualization/qt_gui_core/pull/178 for a PR to add it back

Asked by marguedas on 2019-06-06 09:56:21 UTC

Comments