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

rqt_gui error in perspective manager in ROS noetic

asked 2020-11-10 06:43:02 -0500

abata gravatar image

I run my code flawlessly in ROS Melodic but in ROS Noetic, I am having the following error (maybe because of python3):

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/rqt_gui/rqt_gui", line 13, in <module>
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/", line 61, in main
    return super(
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 614, in main
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 360, in import_perspective_from_file
    self._convert_values(data, self._import_value)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 422, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 422, in _convert_values
    self._convert_values(groups[group], convert_function)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 422, in _convert_values
    self._convert_values(groups[group], convert_function)
  [Previous line repeated 1 more time]
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 419, in _convert_values
    keys[key] = convert_function(keys[key])
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/", line 429, in _import_value
    return QByteArray.fromHex(eval(value['repr(QByteArray.hex)']))
  File "<string>", line 1, in <module>
TypeError: arguments did not match any overloaded call:
  QByteArray(): too many arguments
  QByteArray(int, str): argument 1 has unexpected type 'str'
  QByteArray(Union[QByteArray, bytes, bytearray]): argument 1 has unexpected type 'str'

Any idea on this? Or have you encountered this before?


edit retag flag offensive close merge delete



I'm hitting exact same error with rqt. I'm able to get it to run by changing /opt/ros/noetic/lib/python3/dist-packages/qt_gui/ to return value['repr(QByteArray.hex)']. Still get a bunch of errors, but it at least runs.

mikessut gravatar image mikessut  ( 2020-11-11 10:36:21 -0500 )edit

My launch file was using a .perspective file. Also, when I tried to load it manually in rqt. The same errors happened. It was not necessary for me to load that file, then I modified the launch file :)

abata gravatar image abata  ( 2020-11-11 11:48:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-01-06 14:54:12 -0500

selyunin gravatar image

updated 2021-01-06 14:58:43 -0500

Hey, I also encountered the same problem when porting some existing code to the ROS noetic.

In my case I had a launch file which invoked rqt_gui with a so-called perspective file, like this:

<node name="rqt_gui" pkg="rqt_gui" 
type="rqt_gui" respawn="false" 
args="--perspective-file $(find cyton_gamma_300_gazebo)/config/gazebo_effort_controller.perspective"/>

The perspective file in turn looked similar to the following:

    ..., "mainwindow": {
  "keys": {
    "geometry": {
      "type": "repr(QByteArray.hex)", 
      "repr(QByteArray.hex)": "QtCore.QByteArray('01d9d')", 
      "pretty-print": "     :     I :     I     "
    "state": {
      "type": "repr(QByteArray.hex)", 
      "repr(QByteArray.hex)": "QtCore.QByteArray('000000ff')", 
      "pretty-print": "                 Lrqt_topic__TopicPlugin__1__TopicWidget          Xrqt_publisher__Publisher__1__PublisherWidget                            6MinimizedDockWidgetsToolbar        "
  }, ....

We are interested in the key-value pairs looking similar to the following:

"repr(QByteArray.hex)": "QtCore.QByteArray('000000ff')",

and change it to the following:

"repr(QByteArray.hex)": "b'000000ff'",

I.e. after replacing the value with only byte content, like b'000000ff' and removing QtCore.QByteArray() creation, the rqt_gui is able to start without errors. No patching of noetic code required. Hope this helps!

edit flag offensive delete link more


This worked perfectly for me. Thanks a lot

M Usamah Shahid gravatar image M Usamah Shahid  ( 2021-01-29 09:05:32 -0500 )edit

Question Tools

1 follower


Asked: 2020-11-10 06:43:02 -0500

Seen: 1,294 times

Last updated: Jan 06 '21