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

Update param_groups.py #101

Merged
merged 2 commits into from
Mar 19, 2021
Merged

Conversation

augustinmanecy
Copy link
Contributor

Sometimes, config is None, which leads to crash of rqt_reconfigure (impossible to update node list).
This seems to happen when starting rqt_reconfigure from rqt_gui perspective if .cfg of a node was changed since the .perspective file was saved.

gus@gus-Latitude-E7450:~/ressac/dropter_ws$ roslaunch ajs_controller GS_ajs_controller.launch 
... logging to /home/gus/.ros/log/63da6ad6-7c21-11eb-98ab-61ba7a381d04/roslaunch-gus-Latitude-E7450-319633.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://gus-Latitude-E7450:35103/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES
  /
    rqt (rqt_gui/rqt_gui)

ROS_MASTER_URI=http://localhost:11311

process[rqt-1]: started with pid [319647]
[ INFO] [1614776876.098282277]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_cmd-pwm.xml]
[ INFO] [1614776876.129489212]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_health.xml]
[ INFO] [1614776876.207241394]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_pwm.xml]
[ INFO] [1614776876.258609577]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_head-tracking.xml]
[ INFO] [1614776876.333267639]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_speed-tracking.xml]
[ INFO] [1614776876.385054616]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_state_basic.xml]
[ INFO] [1614776876.408935832]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_motor.xml]
[ INFO] [1614776876.461575977]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_state_vehicle.xml]
[ INFO] [1614776876.478985540]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/cpu_monitor/extra/rqt_multiplot_cpu_monitor.xml]
[ERROR] [1614776888.924537]: bad callback: <bound method Client._updates_msg of <dynamic_reconfigure.client.Client object at 0x7f02743601f0>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/dynamic_reconfigure/client.py", line 327, in _updates_msg
    self._config_callback(self.config)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 130, in config_callback
    widget.update_group(cfg)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_groups.py", line 219, in update_group
    if 'state' in config:
TypeError: argument of type 'NoneType' is not iterable

[ERROR] [1614776889.662080]: bad callback: <bound method Client._updates_msg of <dynamic_reconfigure.client.Client object at 0x7f02743601f0>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/dynamic_reconfigure/client.py", line 327, in _updates_msg
    self._config_callback(self.config)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 130, in config_callback
    widget.update_group(cfg)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_groups.py", line 219, in update_group
    if 'state' in config:
TypeError: argument of type 'NoneType' is not iterable

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/node_selector_widget.py", line 282, in _selection_changed_slot
    self._selection_selected(index_current, rosnode_name_selected)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/node_selector_widget.py", line 233, in _selection_selected
    item_widget = item_child.get_param_client_widget()
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/treenode_qstditem.py", line 159, in get_param_client_widget
    self._param_client_widget = ParamClientWidget(
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 103, in __init__
    self.reconf.config_callback = self.config_callback
  File "/opt/ros/noetic/lib/python3/dist-packages/dynamic_reconfigure/client.py", line 276, in set_config_callback
    self._config_callback(self.config)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 130, in config_callback
    widget.update_group(cfg)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_groups.py", line 219, in update_group
    if 'state' in config:
TypeError: argument of type 'NoneType' is not iterable

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sometimes, config is None, which leads to crash of rqt_reconfigure (impossible to update node list). 
This seems to happen when starting rqt_reconfigure from rqt_gui perspective if .cfg of a node was changed since the .perspective file was saved.

```bash
gus@gus-Latitude-E7450:~/ressac/dropter_ws$ roslaunch ajs_controller GS_ajs_controller.launch 
... logging to /home/gus/.ros/log/63da6ad6-7c21-11eb-98ab-61ba7a381d04/roslaunch-gus-Latitude-E7450-319633.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://gus-Latitude-E7450:35103/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES
  /
    rqt (rqt_gui/rqt_gui)

ROS_MASTER_URI=http://localhost:11311

process[rqt-1]: started with pid [319647]
[ INFO] [1614776876.098282277]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_cmd-pwm.xml]
[ INFO] [1614776876.129489212]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_health.xml]
[ INFO] [1614776876.207241394]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_pwm.xml]
[ INFO] [1614776876.258609577]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_head-tracking.xml]
[ INFO] [1614776876.333267639]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_speed-tracking.xml]
[ INFO] [1614776876.385054616]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_state_basic.xml]
[ INFO] [1614776876.408935832]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_motor.xml]
[ INFO] [1614776876.461575977]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/ajs_controller/extra/rqt_multiplot_state_vehicle.xml]
[ INFO] [1614776876.478985540]: Loaded configuration from [file:///home/gus/ressac/ressac_ws/src/cpu_monitor/extra/rqt_multiplot_cpu_monitor.xml]
[ERROR] [1614776888.924537]: bad callback: <bound method Client._updates_msg of <dynamic_reconfigure.client.Client object at 0x7f02743601f0>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/dynamic_reconfigure/client.py", line 327, in _updates_msg
    self._config_callback(self.config)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 130, in config_callback
    widget.update_group(cfg)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_groups.py", line 219, in update_group
    if 'state' in config:
TypeError: argument of type 'NoneType' is not iterable

[ERROR] [1614776889.662080]: bad callback: <bound method Client._updates_msg of <dynamic_reconfigure.client.Client object at 0x7f02743601f0>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/dynamic_reconfigure/client.py", line 327, in _updates_msg
    self._config_callback(self.config)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 130, in config_callback
    widget.update_group(cfg)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_groups.py", line 219, in update_group
    if 'state' in config:
TypeError: argument of type 'NoneType' is not iterable

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/node_selector_widget.py", line 282, in _selection_changed_slot
    self._selection_selected(index_current, rosnode_name_selected)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/node_selector_widget.py", line 233, in _selection_selected
    item_widget = item_child.get_param_client_widget()
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/treenode_qstditem.py", line 159, in get_param_client_widget
    self._param_client_widget = ParamClientWidget(
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 103, in __init__
    self.reconf.config_callback = self.config_callback
  File "/opt/ros/noetic/lib/python3/dist-packages/dynamic_reconfigure/client.py", line 276, in set_config_callback
    self._config_callback(self.config)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_client_widget.py", line 130, in config_callback
    widget.update_group(cfg)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_reconfigure/param_groups.py", line 219, in update_group
    if 'state' in config:
TypeError: argument of type 'NoneType' is not iterable
```
Copy link
Member

@cottsay cottsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and for posting a backtrace and steps to reproduce the error - it makes review a lot easier.

I made a suggestion to simplify the change.

src/rqt_reconfigure/param_groups.py Outdated Show resolved Hide resolved

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay merged commit fbc8323 into ros-visualization:master Mar 19, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants