Skip to content

SubTrees in the same BT xml file lead to crash when a filepath is used #5923

@adivardi

Description

@adivardi

Bug report

Following dicussion in #5494.

When using a SubTree, defined in the same file as the main tree, it is now not possible to use a filepath to specify the BT. Only ID works. When requesting a file (or using a file as the default BT), the subtree fails due to remapping. When specifing the ID of the main tree, it works fine.

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

Simply extract a subtree from one of the default BT xml.
For example, I did it to the nav_through_poses xml here:
subtree.patch

Expected behavior

BT can run and execute the subTree.

Actual behavior

Remapping errors appear immediately when launching nav2:

[bt_navigator] [/opt/enway/ros2_ws/install/nav2_behavior_tree/include/nav2_behavior_tree/nav2_behavior_tree/bt_action_server_impl.hpp:327] Created BT from ID: NavToPoseWithConsistentReplanningAndIfPathBecomesInvalidEnway
[bt_navigator] [/opt/enway/ros2_ws/install/nav2_behavior_tree/include/nav2_behavior_tree/nav2_behavior_tree/bt_action_server_impl.hpp:437] Setting internal error error_code:9101, error_msg:Exception when creating BT tree from ID: Blackboard::get() error. Missing key [node]
[bt_navigator] [/opt/enway/ros2_ws/install/nav2_behavior_tree/include/nav2_behavior_tree/nav2_behavior_tree/bt_action_server_impl.hpp:194] Error loading BT: /opt/enway/ros2_ws/install/nav2_bt_navigator/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_and_recovery.xml
[bt_navigator] [/opt/enway/ros2_ws/src/enway_ros2/navigation/navigation2/nav2_bt_navigator/src/bt_navigator.cpp:152] Deactivating
[bt_navigator] [/opt/enway/ros2_ws/install/nav2_ros_common/include/nav2_ros_common/nav2_ros_common/lifecycle_node.hpp:364] Destroying bond (bt_navigator) to lifecycle manager.
[lifecycle_manager_navigation] [/opt/enway/ros2_ws/src/enway_ros2/navigation/navigation2/nav2_lifecycle_manager/src/lifecycle_manager.cpp:315] Failed to change state for node: bt_navigator
[lifecycle_manager_navigation] [/opt/enway/ros2_ws/src/enway_ros2/navigation/navigation2/nav2_lifecycle_manager/src/lifecycle_manager.cpp:382] Failed to bring up all requested nodes. Aborting bringup.

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