From 8d8d3a19c7c4335d8180081358965ee259e5d9b8 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Thu, 3 Oct 2024 09:30:55 +0200 Subject: [PATCH] Add ROBOT_NAMESPACE env --- joy2twist/launch/gamepad_controller.launch.py | 6 +++--- joy2twist/launch/joy2twist.launch.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/joy2twist/launch/gamepad_controller.launch.py b/joy2twist/launch/gamepad_controller.launch.py index 559fe13..2769568 100644 --- a/joy2twist/launch/gamepad_controller.launch.py +++ b/joy2twist/launch/gamepad_controller.launch.py @@ -4,15 +4,15 @@ from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import LaunchConfiguration, PathJoinSubstitution +from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution def generate_launch_description(): namespace = LaunchConfiguration("namespace") declare_namespace_arg = DeclareLaunchArgument( "namespace", - default_value="", - description="Namespace for all topics and tfs", + default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""), + description="Add namespace to all launched nodes.", ) joy2twist_cfg_path = PathJoinSubstitution( diff --git a/joy2twist/launch/joy2twist.launch.py b/joy2twist/launch/joy2twist.launch.py index c278988..9a7cb62 100644 --- a/joy2twist/launch/joy2twist.launch.py +++ b/joy2twist/launch/joy2twist.launch.py @@ -3,15 +3,15 @@ from launch import LaunchDescription from launch.actions import DeclareLaunchArgument -from launch.substitutions import LaunchConfiguration, PathJoinSubstitution +from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution def generate_launch_description(): namespace = LaunchConfiguration("namespace") declare_namespace_arg = DeclareLaunchArgument( "namespace", - default_value="", - description="Namespace for all topics and tfs", + default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""), + description="Add namespace to all launched nodes.", ) joy2twist_cfg_path = PathJoinSubstitution(