From 53078d3733df85a52e0c298f819aea4bc7ed37f0 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Wed, 30 Oct 2024 07:44:41 +0100 Subject: [PATCH] fix package mapping for mapping rules with additional keys --- ros1_bridge/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ros1_bridge/__init__.py b/ros1_bridge/__init__.py index 407215e5..049a5e7d 100644 --- a/ros1_bridge/__init__.py +++ b/ros1_bridge/__init__.py @@ -531,9 +531,7 @@ def __init__(self, data, expected_package_name): self.ros1_package_name = data['ros1_package_name'] self.ros2_package_name = data['ros2_package_name'] self.foreign_mapping = bool(data.get('enable_foreign_mappings')) - self.package_mapping = ( - len(data) == (2 + int('enable_foreign_mappings' in data)) - ) + self.package_mapping = self.ros1_package_name != self.ros2_package_name else: raise MappingException( 'Ignoring a rule without a ros1_package_name and/or ros2_package_name')