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

Added error handling for dynamic_reconfigure exceptions #10

Merged
merged 2 commits into from
Jul 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/rqt_reconfigure/dynreconf_client_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
from .param_groups import GroupWidget, find_cfg
from .param_updater import ParamUpdater

from dynamic_reconfigure import (DynamicReconfigureParameterException,
DynamicReconfigureCallbackException)
from rospy.service import ServiceException

import yaml


Expand Down Expand Up @@ -138,7 +142,15 @@ def load_param(self, filename):
configuration = {}
for doc in yaml.load_all(f.read()):
configuration.update(doc)
self.reconf.update_configuration(configuration)

try:
self.reconf.update_configuration(configuration)
except ServiceException as e:
rospy.logwarn('Call for reconfiguration wasn\'t successful because: %s', e.message)
except DynamicReconfigureParameterException as e:
rospy.logwarn('Reconfiguration wasn\'t successful because: %s', e.message)
except DynamicReconfigureCallbackException as e:
rospy.logwarn('Reconfiguration wasn\'t successful because: %s', e.message)

def close(self):
self.reconf.close()
Expand Down