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

Add pid to launch_ros node name as suffix #98

Merged
merged 1 commit into from
Nov 28, 2019
Merged
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
5 changes: 4 additions & 1 deletion launch_ros/launch_ros/default_launch_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""Module containing the default LaunchDescription for ROS."""

import os
import threading

import launch
Expand Down Expand Up @@ -61,7 +62,9 @@ def _function(self, context: launch.LaunchContext):
if 'rcl_init called while already initialized' in str(exc):
pass
raise
self.__launch_ros_node = rclpy.create_node('launch_ros', context=self.__rclpy_context)
self.__launch_ros_node = rclpy.create_node(
'launch_ros_{}'.format(os.getpid()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BMarchi appending launch PID helps disambiguate but doesn't make it a hidden a node -- you need a leading underscore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the requirement to make the launch_ros node hidden. Are you sure about appending that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I just tossed in a feature request. It's not in the original ticket, you're right. Disregard (I'll propose it afterwards).

context=self.__rclpy_context)
context.extend_globals({
'ros_startup_action': self,
'launch_ros_node': self.__launch_ros_node
Expand Down