Skip to content

Exception being thrown: failed to initialize rcl node: Logger already initialized for node #375

@mkhansenbot

Description

@mkhansenbot

Bug report

Required Info:

  • Operating System:

    • Ubuntu 18.04
  • Installation type:

    • source
  • Version or commit hash:

  • DDS implementation:

    • Default - FastRTPS
  • Client library (if applicable):

    • rclcpp

Steps to reproduce issue

Install navigation2

ros2 launch nav2_bringup nav2_bringup_1st_launch.py map:=<path/to/map>

Expected behavior

Should launch fine without issue.

Actual behavior

Exception occurs, and crashes amcl node:

ros2 launch nav2_bringup nav2_bringup_1st_launch.py map:=/home/mkhansen/ros2_dev/navigation2_ws/src/navigation2/nav2_system_tests/maps/map_circular.yaml
[INFO] [launch]: process[amcl-1]: started with pid [14806]
[INFO] [amcl]: Initializing AMCL
[INFO] [amcl]: Sensor model type is: "likelihood_field"
[INFO] [amcl]: Robot motion model is differential
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
  what():  failed to initialize rcl node: Logger already initialized for node., at /home/mkhansen/ros2_dev/ros2_ws/src/ros2/rcl/rcl/src/rcl/logging_rosout.c:156
[ERROR] [launch]: process[amcl-1] process has died [pid 14806, exit code -6, cmd '/home/mkhansen/ros2_dev/navigation2_ws/install/nav2_amcl/lib/nav2_amcl/amcl __node:=amcl'].

Additional information

SO, the launch file by default has this for the amcl portion:

        launch_ros.actions.Node(
            package='nav2_amcl',
            node_executable='amcl',
            node_name='amcl',
            output='screen'),
            parameters=[{ 'use_sim_time': use_sim_time}]),

When I comment out these 2 lines, setting the node_name and parameters, it works fine, but use_sim_time isn't set (which is needed).

        launch_ros.actions.Node(
            package='nav2_amcl',
            node_executable='amcl',
#            node_name='amcl',
            output='screen'),
#            parameters=[{ 'use_sim_time': use_sim_time}]),

I suspect the issue has something to do with the node_name field, but I don't know exactly what the issue is because I use nearly the same syntax for map_server in the same launch file and it works fine:

        launch_ros.actions.Node(
            package='nav2_map_server',
            node_executable='map_server',
            node_name='map_server',
            output='screen',
            parameters=[{ 'use_sim_time': use_sim_time}, { 'yaml_filename':  map_yaml_file }]),

The only difference there being the use of a yaml file for a second parameter in the list.

This only recently stopped working (last week), and it coincided with #350, and the message was added in that PR, so it has to be related. I'm just not sure what the PR added and why having the node name and parameters makes it fail. I see the failure occurs here:
logging_rosout.c:156

Please help to understand why I'm hitting this error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions