Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rqt can't export a perspective with an active rqt_image_overlay layer plugin #57

Open
Kettenhoax opened this issue Jan 11, 2023 · 3 comments

Comments

@Kettenhoax
Copy link
Contributor

When trying to export an rqt perspective including a rqt_image_overlay instance with an active layer using the GUI, it fails with with a terminal-printed error.
The GUI doesn't show a warning or error.

Traceback (most recent call last):
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 188, in save_settings_completed
    callback(*callback_args)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 399, in _on_export_perspective_continued
    self._convert_values(data, self._export_value)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 423, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 423, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 423, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 420, in _convert_values
    keys[key] = convert_function(keys[key])
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 463, in _export_value
    reimported = self._import_value(data)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/perspective_manager.py", line 428, in _import_value
    return eval(value['repr'])
  File "<string>", line 1
    [{'Color': <PyQt5.QtGui.QColor object at 0x7f60b8b9e340>, 'Enabled': True, 'Plugin': 'overlay_test_plugins::EmptyLayer', 'Topic': '/data'}]
               ^
SyntaxError: invalid syntax

It seems the color associated with the layer can't be serialized.

@ijnek
Copy link
Member

ijnek commented Jan 12, 2023

Thanks for the bug report @Kettenhoax ! I don't think I'll get around to looking into it this week, but I'm happy to review a PR with a unit test during the week if you do come up with a fix.

@Kettenhoax
Copy link
Contributor Author

Looking into this, I found that rqt plugins in general can't store QColors in perspective files. Since QColors are valid QVariants in terms of qt_gui_cpp::Settings, rqt_image_overlay doesn't violate api constraints as far as I could find.

I've opened an issue at ros-visualization/qt_gui_core#271, but would like to keep this one open.
Based on the upstream response we can serialize QColors in a different format instead.

@ijnek
Copy link
Member

ijnek commented Jan 13, 2023

Thanks for looking into it! And yes, please keep this issue open too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants