Skip to content

Confusing warning error for duplicate ID BTs #5924

@adivardi

Description

@adivardi

Bug report

Following dicussion in #5494.

When multiple BT xml files contain duplicate IDs (e.g. MainTree), a confusing warning error appears:

[bt_navigator] [/opt/enway/ros2_ws/install/nav2_behavior_tree/include/nav2_behavior_tree/nav2_behavior_tree/bt_action_server_impl.hp
p:277] Skipping conflicting BT file /opt/enway/ros2_ws/install/nav2_bt_navigator/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_an
d_recovery.xml (duplicate ID MainTree)

Looking at the code, it skips the registerTreeFromFile() call. However, it seems that the behaviors can be executed correctly?
The warning is shown again every time any navigator task is requested.

Required Info:

  • Operating System:
    Ubuntu 24.04
  • Computer:
    12th Gen Intel(R) Core(TM) i7-12700H
  • ROS2 Version:
    Jazzy
  • Version or commit hash:
    a17d7d8
  • DDS implementation:
    Zenoh

Steps to reproduce issue

  • Undo some of the BT ID changes from Fix/prevent warning when loading bt #5494 to restore IDs to MainTree
    • For example, change navigate_to_pose_w_replanning_and_recovery.xml and navigate_to_pose_w_replanning_and_recovery.xml which are the defaults. Also modify another nav_to_pose_ xml file
  • Check warnings in nav2
  • Try to run NavigateToPose and NavigateThroughPoses (e.g. using the rviz panel)
    • Also try to set Behavior Tree XML in rviz panel to point to third file you modified.

Expected behavior

All tasks should run correctly whether you request a filepath or ID. No confusing messages.

Actual behavior

  • It seems the tasks run correctly?
  • A confusing warning error is shown at launch and every time a task is started
[bt_navigator] [/opt/enway/ros2_ws/install/nav2_behavior_tree/include/nav2_behavior_tree/nav2_behavior_tree/bt_action_server_impl.hp
p:277] Skipping conflicting BT file /opt/enway/ros2_ws/install/nav2_bt_navigator/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_an
d_recovery.xml (duplicate ID MainTree)

What does this even mean? Are the BTs working correctly? If yes, then why is the warning even needed?

Additional information

Metadata

Metadata

Assignees

No one assigned

    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