From 8a480a01ca1708f0e5445e1dc5442d74d8b18e7a Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Fri, 5 Feb 2021 16:15:25 +0900 Subject: [PATCH] fix dynamic_reconfigure namespace #53 related to https://github.com/ros-visualization/rqt_reconfigure/issues/92 --- python/coral_usb/face_detector.py | 5 ++++- python/coral_usb/human_pose_estimator.py | 6 +++++- python/coral_usb/object_detector.py | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/python/coral_usb/face_detector.py b/python/coral_usb/face_detector.py index 9d92ac1..a1a15fd 100644 --- a/python/coral_usb/face_detector.py +++ b/python/coral_usb/face_detector.py @@ -21,6 +21,9 @@ def __init__(self, namespace='~'): self.label_names = ['face'] # dynamic reconfigure + dyn_namespace = namespace + if namespace == '~': + dyn_namespace = '' self.srv = Server( EdgeTPUFaceDetectorConfig, - self.config_callback, namespace=namespace) + self.config_callback, namespace=dyn_namespace) diff --git a/python/coral_usb/human_pose_estimator.py b/python/coral_usb/human_pose_estimator.py index 792da8b..588f599 100644 --- a/python/coral_usb/human_pose_estimator.py +++ b/python/coral_usb/human_pose_estimator.py @@ -83,8 +83,12 @@ def __init__(self, namespace='~'): self.label_names = ['human'] # dynamic reconfigure + dyn_namespace = namespace + if namespace == '~': + dyn_namespace = '' self.srv = Server( - EdgeTPUHumanPoseEstimatorConfig, self.config_callback) + EdgeTPUHumanPoseEstimatorConfig, + self.config_callback, namespace=dyn_namespace) self.pub_pose = self.advertise( namespace + 'output/poses', PeoplePoseArray, queue_size=1) diff --git a/python/coral_usb/object_detector.py b/python/coral_usb/object_detector.py index cb53fc3..1317013 100644 --- a/python/coral_usb/object_detector.py +++ b/python/coral_usb/object_detector.py @@ -19,6 +19,9 @@ def __init__(self, namespace='~'): model_file, label_file, namespace) # dynamic reconfigure + dyn_namespace = namespace + if namespace == '~': + dyn_namespace = '' self.srv = Server( EdgeTPUObjectDetectorConfig, - self.config_callback, namespace=namespace) + self.config_callback, namespace=dyn_namespace)