From 2cf8c02f0aa158de2f4ff51955666da575679039 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sat, 23 Mar 2024 16:12:40 +0000 Subject: [PATCH 1/3] Fix rqt_cm for non-humble --- .../rqt_controller_manager/controller_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rqt_controller_manager/rqt_controller_manager/controller_manager.py b/rqt_controller_manager/rqt_controller_manager/controller_manager.py index 371eefd845..a71a016745 100644 --- a/rqt_controller_manager/rqt_controller_manager/controller_manager.py +++ b/rqt_controller_manager/rqt_controller_manager/controller_manager.py @@ -419,6 +419,6 @@ def _get_parameter_controller_names(node, node_name): return [ n[: -len(suffix)] for n in parameter_names.result().result.names if n.endswith(suffix) ] - finally: + except: # for humble, ros2param < 0.20.0 return [n[: -len(suffix)] for n in parameter_names if n.endswith(suffix)] From c4013ef22ef795aa60f044ac626ce3af2fbb8517 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sat, 23 Mar 2024 16:24:34 +0000 Subject: [PATCH 2/3] Use os.environ.get('ROS_DISTRO') instead --- .../rqt_controller_manager/controller_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rqt_controller_manager/rqt_controller_manager/controller_manager.py b/rqt_controller_manager/rqt_controller_manager/controller_manager.py index a71a016745..0683c53a1e 100644 --- a/rqt_controller_manager/rqt_controller_manager/controller_manager.py +++ b/rqt_controller_manager/rqt_controller_manager/controller_manager.py @@ -415,10 +415,10 @@ def _get_parameter_controller_names(node, node_name): parameter_names = call_list_parameters(node=node, node_name=node_name) suffix = ".type" # @note: The versions conditioning is added here to support the source-compatibility with Humble - try: + if os.environ.get('ROS_DISTRO') == "humble": + # for humble, ros2param < 0.20.0 + return [n[: -len(suffix)] for n in parameter_names if n.endswith(suffix)] + else: return [ n[: -len(suffix)] for n in parameter_names.result().result.names if n.endswith(suffix) ] - except: - # for humble, ros2param < 0.20.0 - return [n[: -len(suffix)] for n in parameter_names if n.endswith(suffix)] From 19bb074720fd9b17bc4981a37708c4aff45d45e5 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sat, 23 Mar 2024 16:33:52 +0000 Subject: [PATCH 3/3] Fix format --- .../rqt_controller_manager/controller_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rqt_controller_manager/rqt_controller_manager/controller_manager.py b/rqt_controller_manager/rqt_controller_manager/controller_manager.py index 0683c53a1e..4a89b3cb97 100644 --- a/rqt_controller_manager/rqt_controller_manager/controller_manager.py +++ b/rqt_controller_manager/rqt_controller_manager/controller_manager.py @@ -415,7 +415,7 @@ def _get_parameter_controller_names(node, node_name): parameter_names = call_list_parameters(node=node, node_name=node_name) suffix = ".type" # @note: The versions conditioning is added here to support the source-compatibility with Humble - if os.environ.get('ROS_DISTRO') == "humble": + if os.environ.get("ROS_DISTRO") == "humble": # for humble, ros2param < 0.20.0 return [n[: -len(suffix)] for n in parameter_names if n.endswith(suffix)] else: