From 3620d91f3c9a4ed543cd6b1a64f224c8320f2bd9 Mon Sep 17 00:00:00 2001 From: Elie Youssef Date: Thu, 28 Apr 2022 11:38:23 +0300 Subject: [PATCH 1/2] Added the ip and port as launch arguments --- launch/endpoint.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/launch/endpoint.py b/launch/endpoint.py index 2e1bf8c..e8aac6c 100644 --- a/launch/endpoint.py +++ b/launch/endpoint.py @@ -1,15 +1,31 @@ from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node +from launch.substitutions import TextSubstitution +from launch.substitutions import LaunchConfiguration def generate_launch_description(): + ros_ip = DeclareLaunchArgument( + "ROS_IP", default_value=TextSubstitution(text="0.0.0.0") + ) + + ros_tcp_port = DeclareLaunchArgument( + "ROS_TCP_PORT", default_value="10000" + ) + return LaunchDescription( [ + ros_ip, + ros_tcp_port, Node( package="ros_tcp_endpoint", executable="default_server_endpoint", emulate_tty=True, - parameters=[{"ROS_IP": "0.0.0.0"}, {"ROS_TCP_PORT": 10000}], + parameters=[{ + "ROS_IP": LaunchConfiguration('ROS_IP'), + "ROS_TCP_PORT": LaunchConfiguration('ROS_TCP_PORT') + }], ) ] ) From 813e10bcb63a93a42fedd92faf75f067d32dacfe Mon Sep 17 00:00:00 2001 From: Elie Youssef Date: Mon, 27 Jun 2022 15:26:08 +0300 Subject: [PATCH 2/2] renamed launch arguments to tcp_ip and tcp_port --- launch/endpoint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/launch/endpoint.py b/launch/endpoint.py index e8aac6c..334c9f8 100644 --- a/launch/endpoint.py +++ b/launch/endpoint.py @@ -7,11 +7,11 @@ def generate_launch_description(): ros_ip = DeclareLaunchArgument( - "ROS_IP", default_value=TextSubstitution(text="0.0.0.0") + "tcp_ip", default_value=TextSubstitution(text="0.0.0.0") ) ros_tcp_port = DeclareLaunchArgument( - "ROS_TCP_PORT", default_value="10000" + "tcp_port", default_value="10000" ) return LaunchDescription( @@ -23,8 +23,8 @@ def generate_launch_description(): executable="default_server_endpoint", emulate_tty=True, parameters=[{ - "ROS_IP": LaunchConfiguration('ROS_IP'), - "ROS_TCP_PORT": LaunchConfiguration('ROS_TCP_PORT') + "ROS_IP": LaunchConfiguration('tcp_ip'), + "ROS_TCP_PORT": LaunchConfiguration('tcp_port') }], ) ]