Skip to content

Commit

Permalink
Merge pull request #98 from ros2/BMarchi/add_pid_suffix_to_launch_ros
Browse files Browse the repository at this point in the history
Add pid to launch_ros node name as suffix
  • Loading branch information
BMarchi committed Nov 28, 2019
2 parents 025596b + 04f131a commit 848b201
Showing 1 changed file with 4 additions and 1 deletion.
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()),
context=self.__rclpy_context)
context.extend_globals({
'ros_startup_action': self,
'launch_ros_node': self.__launch_ros_node
Expand Down

0 comments on commit 848b201

Please sign in to comment.