From 8d8d3a19c7c4335d8180081358965ee259e5d9b8 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Thu, 3 Oct 2024 09:30:55 +0200 Subject: [PATCH 1/3] 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( From 3c1075e8e8ef3a93a80103887caa27f26ae917a0 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Thu, 3 Oct 2024 09:36:34 +0200 Subject: [PATCH 2/3] Rename param j2t_panther -> j2t_ugv --- joy2twist/config/{joy2twist_panther.yaml => joy2twist_ugv.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename joy2twist/config/{joy2twist_panther.yaml => joy2twist_ugv.yaml} (100%) diff --git a/joy2twist/config/joy2twist_panther.yaml b/joy2twist/config/joy2twist_ugv.yaml similarity index 100% rename from joy2twist/config/joy2twist_panther.yaml rename to joy2twist/config/joy2twist_ugv.yaml From b589e1bccf1abe8856866f7be6c3b8312bd21d4e Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Thu, 3 Oct 2024 09:42:18 +0200 Subject: [PATCH 3/3] Rename all occurrence --- README.md | 2 +- demo/single_robot/compose.panther.yaml | 4 ++-- joy2twist/launch/gamepad_controller.launch.py | 1 - joy2twist/launch/joy2twist.launch.py | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 01d3985..39b5943 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ The robot can be operated at 3 scales of speed depending on pressed buttons. It' - `regular` *(float, default: 0.5)* - `slow` *(float, default: 0.2)* -The node can be configured using parameters described below to work with robots equipped with an E-stop interface. An example configuration for a robot with an E-stop interface can be found in [panther config file](./joy2twist/config/joy2twist_panther.yaml). +The node can be configured using parameters described below to work with robots equipped with an E-stop interface. An example configuration for a robot with an E-stop interface can be found in [panther config file](./joy2twist/config/joy2twist_ugv.yaml). - `~e_stop/present` *(bool, default: false)* - `~e_stop/topic` *(string, default: e_stop)* diff --git a/demo/single_robot/compose.panther.yaml b/demo/single_robot/compose.panther.yaml index 84a4b36..bdaed17 100644 --- a/demo/single_robot/compose.panther.yaml +++ b/demo/single_robot/compose.panther.yaml @@ -9,7 +9,7 @@ services: devices: - /dev/input/js0 volumes: - - ./../../joy2twist/config/joy2twist_panther.yaml:/joy2twist_panther.yaml + - ./../../joy2twist/config/joy2twist_ugv.yaml:/joy2twist_ugv.yaml command: > ros2 launch joy2twist gamepad_controller.launch.py - joy2twist_params_file:=/joy2twist_panther.yaml + joy2twist_params_file:=/joy2twist_ugv.yaml diff --git a/joy2twist/launch/gamepad_controller.launch.py b/joy2twist/launch/gamepad_controller.launch.py index 2769568..f0e3f0e 100644 --- a/joy2twist/launch/gamepad_controller.launch.py +++ b/joy2twist/launch/gamepad_controller.launch.py @@ -42,7 +42,6 @@ def generate_launch_description(): joy_linux_node = Node( package="joy_linux", executable="joy_linux_node", - # output={"stdout": "screen", "stderr": "screen"}, emulate_tty="true", namespace=namespace, remappings=[("/diagnostics", "diagnostics")], diff --git a/joy2twist/launch/joy2twist.launch.py b/joy2twist/launch/joy2twist.launch.py index 9a7cb62..2c870fd 100644 --- a/joy2twist/launch/joy2twist.launch.py +++ b/joy2twist/launch/joy2twist.launch.py @@ -28,7 +28,6 @@ def generate_launch_description(): package="joy2twist", executable="joy2twist", parameters=[LaunchConfiguration("joy2twist_params_file")], - # output={"stdout": "screen", "stderr": "screen"}, emulate_tty="true", namespace=namespace, )