<launch> <!-- Load RQT with a pre-setup GUI for Baxter controls from a perspective file --> <node name="exoskeleton_rqt" pkg="rqt_gui" type="rqt_gui" respawn="false" output="screen" args="--perspective-file $(find exoskeleton)/launch/exoskeleton.perspective"/> </launch>
...
"plugin": {
"keys": {
"splitter": {
"type": "repr(QByteArray.hex)",
"repr(QByteArray.hex)": "QtCore.QByteArray('000000ff0000000100000002000000ce0000006401ffffffff010000000100')",
"pretty-print": " d "
},
"_splitter": {
"type": "repr(QByteArray.hex)",
"repr(QByteArray.hex)": "QtCore.QByteArray('000000ff00000001000000020000012c000000640100000009010000000200')",
"pretty-print": " , d "
}
},
"groups": {}
}...
报错:
Traceback (most recent call last):
File "/opt/ros/melodic/lib/rqt_gui/rqt_gui", line 13, in <module>
sys.exit(main.main())
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_gui/main.py", line 61, in main
return super(
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/main.py", line 614, in main
perspective_manager.import_perspective_from_file(
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 360, in import_perspective_from_file
self._convert_values(data, self._import_value)
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 422, in _convert_values
self._convert_values(groups[group], convert_function)
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 422, in _convert_values
self._convert_values(groups[group], convert_function)
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 422, in _convert_values
self._convert_values(groups[group], convert_function)
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 419, in _convert_values
keys[key] = convert_function(keys[key])
File "/opt/ros/melodic/lib/python2.7/dist-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>
TypeError: arguments did not match any overloaded call:
QByteArray(): too many arguments
QByteArray(size: int, c: str): argument 1 has unexpected type 'str'
QByteArray(a: Union[QByteArray, bytes, bytearray]): argument 1 has unexpected type 'str'
解决办法:
将对应的
"repr(QByteArray.hex)":"QtCore.QByteArray('000000ff0000000100000002000000ce0000006401ffffffff010000000100')",
更改为
"repr(QByteArray.hex)":"b'000000ff0000000100000002000000ce0000006401ffffffff010000000100'"
即在用字节内容替换值后,例如b'000000ff'并删除QtCore.QByteArray()创建,就rqt_gui可以无错误地启动。无需修补其他代码。
参考连接:
rqt_gui error in perspective manager in ROS noetic - ROS Answers: Open Source Q&A Forum