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_reconfigure crashes with IndexError #92

Open
mallela opened this issue Jul 22, 2020 · 7 comments
Open

rqt_reconfigure crashes with IndexError #92

mallela opened this issue Jul 22, 2020 · 7 comments
Assignees
Labels

Comments

@mallela
Copy link

mallela commented Jul 22, 2020

I encounter the following error logs when I create a unique pointer to a dynamic_reconfigure::Server and a nodehandle as a param.

PluginManager._load_plugin() could not load plugin "rqt_reconfigure/Param":
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/plugin_handler.py", line 99, in load
    self._load()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/plugin_handler_direct.py", line 54, in _load
    self._plugin = self._plugin_provider.load(self._instance_id.plugin_id, self._context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui_py/ros_py_plugin_provider.py", line 60, in load
    return super(RosPyPluginProvider, self).load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/ros_plugin_provider.py", line 101, in load
    return class_ref(plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_reconfigure/param_plugin.py", line 51, in __init__
    self._plugin_widget = ParamWidget(context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_reconfigure/param_widget.py", line 100, in __init__
    self._nodesel_widget = NodeSelectorWidget(self, rp, self.sig_sysmsg)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_reconfigure/node_selector_widget.py", line 97, in __init__
    self._update_nodetree_pernode()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_reconfigure/node_selector_widget.py", line 332, in _update_nodetree_pernode
    node_name_grn, TreenodeQstdItem.NODE_FULLPATH)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_reconfigure/treenode_qstditem.py", line 87, in __init__
    self._set_param_name(grn_current_treenode)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_reconfigure/treenode_qstditem.py", line 235, in _set_param_name
    self._toplevel_treenode_name = self._list_treenode_names[0]
IndexError: list index out of range
@cottsay cottsay transferred this issue from ros-visualization/rqt_common_plugins Jul 22, 2020
@cottsay cottsay self-assigned this Jul 22, 2020
@cottsay cottsay added the bug label Jul 22, 2020
@cottsay
Copy link
Member

cottsay commented Jul 22, 2020

Hi @mallela -

From what I can tell of your backtrace, you're using a version of rqt_reconfigure prior to 0.5.0. The latest version of rqt_reconfigure in ROS Kinetic is 0.5.3. It is always a good idea to make sure you're using an up-to-date version of software before reporting bugs. Please try updating to see if your issue is resolved.

If your issue is not resolved, please post the results of this command after the rqt failure:

rosnode list

@rolaechea
Copy link
Contributor

rolaechea commented Oct 2, 2020

I have created a patch that fixes the issue. This issue happens even with the latest rqt_reconfigure when a ros node has not shut down properly or has segfaulted. This patch permits to continue using rqt_reconfigure even if some nodes have crashed. cc @cottsay cc @mjeronimo

@rolaechea
Copy link
Contributor

Is there anything else I can do to help you @cottsay @mjeronimo be able to review the pull request ? cc @mallela

@mjeronimo
Copy link
Contributor

@rolaechea Sorry for the delay. I've been investigating the source of problems like these, which all come down to having rqt_reconfigure's list of nodes out of sync with the nodes actually running. Unfortunately, rqt_reconfigure uses the Refresh button to manually update its list. Instead, it should use an automated method to monitor for active nodes (see
#64 for a bit of discussion on this). Meanwhile, util we can fix this correctly, we may need workarounds like this one. I'm OK with this one for now, but would like to fix the core issue.

mjeronimo pushed a commit that referenced this issue Oct 20, 2020
@rolaechea
Copy link
Contributor

Just a heads up @mjeronimo that the function find_reconfigure_services returns as one of the "reconfigurable" services/nodes, the empty string "" whenever there is a service called "/set_parameters". This was the root cause of this crash. When the crash occurred I listed the results of roservice list and saw that there is one called "/set_parameters". Because of the way find_reconfigure_services is written, this results in "" being included as list of reconfigurable services/nodes:

[email protected]:~/Dev/robot-dev/repos/autonomy/ros_indigo/src$ rosservice list | grep -E /set_parameters$
/amcl/set_parameters
...
/set_parameters

``
def find_reconfigure_services():
import rosservice
return sorted([s[:-len('/set_parameters')] for s in rosservice.get_service_list() if s.endswith('/set_parameters')])

@mjeronimo
Copy link
Contributor

Thanks for the background info, @rolaechea. Very helpful.

knorth55 added a commit to jsk-ros-pkg/coral_usb_ros that referenced this issue Feb 5, 2021
knorth55 added a commit to jsk-ros-pkg/coral_usb_ros that referenced this issue Feb 5, 2021
knorth55 added a commit to jsk-ros-pkg/coral_usb_ros that referenced this issue Feb 5, 2021
@Leeable
Copy link

Leeable commented Apr 2, 2021

solution in ROS melodic :
run the command **sudo gedit /opt/ros/melodic/lib/python2.7/dist-packages/rqt_reconfigure/node_selector_widget.py
**

and find the line of 325, replace original one : if node_name_grn in self._nodeitems or node_name_grn =='':

that'all ~ enjoy rqt_reconfigure

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

No branches or pull requests

5 participants