ros2 launch creates two nodes of same type

asked 2020-02-14 06:11:18 -0600

Hi, I am experiencing a weird behavior of the ros2 launch command.

Using following example launch file from the robot_localization packge:

from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
import launch_ros.actions
import os
import yaml
from launch.substitutions import EnvironmentVariable
import pathlib
import launch.actions
from launch.actions import DeclareLaunchArgument

def generate_launch_description():
    return LaunchDescription([
        launch_ros.actions.Node(
            package='robot_localization',
            node_executable='ekf_node',
            node_name='ekf_filter_node',
            output='screen',
            parameters=[os.path.join(get_package_share_directory("robot_localization"), 'params', 'ekf.yaml')],
           ),
])

creates following output:

$ ros2 launch robot_localization ekf.launch.py 
[INFO] [launch]: All log files can be found below /home/xxx/.ros/log/2020-02-14-12-59-00-118313-xxx-22388
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ekf_node-1]: process started with pid [22398]
[ekf_node-1] [WARN] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[ekf_node-1] X acceleration is being measured from IMU; X velocity control input is disabled

Listing running nodes with ros2 node list also shows me two ekf_nodes.

The same happens with ros2 cartographer_ros node.

Any Idea why this is happening? I am able to launch other nodes without any problem.

edit retag flag offensive close merge delete