Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ip and port as launch arguments in the ros2 launch file #145

Open
wants to merge 2 commits into
base: dev-ros2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion launch/endpoint.py
Original file line number Diff line number Diff line change
@@ -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(
"tcp_ip", default_value=TextSubstitution(text="0.0.0.0")
)

ros_tcp_port = DeclareLaunchArgument(
"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('tcp_ip'),
"ROS_TCP_PORT": LaunchConfiguration('tcp_port')
}],
)
]
)