Skip to content

Commit f9bb0ca

Browse files
authored
Fix namespace with LifecycleNode (#222)
Fixes #220. Regression since #179. The expectation prior to #179 was that providing no namespace argument to LifecycleNode would result in an empty, relative namespace. This change fixes the code to meet that expectation. Signed-off-by: Jacob Perron <[email protected]>
1 parent 4e74f5a commit f9bb0ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

launch_ros/launch_ros/actions/lifecycle_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(
9191
if name is None:
9292
raise RuntimeError("'name' must not be None.'")
9393
if not namespace:
94-
namespace = '/'
94+
namespace = ''
9595
super().__init__(name=name, namespace=namespace, **kwargs)
9696
self.__logger = launch.logging.get_logger(__name__)
9797
self.__rclpy_subscription = None

launch_ros/launch_ros/actions/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def _perform_substitutions(self, context: LaunchContext) -> None:
337337
validate_node_name(self.__expanded_node_name)
338338
self.__expanded_node_name.lstrip('/')
339339
expanded_node_namespace: Optional[Text] = None
340-
if self.__node_namespace:
340+
if self.__node_namespace is not None:
341341
expanded_node_namespace = perform_substitutions(
342342
context, normalize_to_list_of_substitutions(self.__node_namespace))
343343
base_ns = context.launch_configurations.get('ros_namespace', None)

0 commit comments

Comments
 (0)