Skip to content

Conversation

Jad-ELHAJJ
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses N/A
Primary OS tested on Ubuntu
Does this PR contain AI generated software? No
Was this PR description generated by AI software? No

Description of contribution in a few bullet points

A fix PR making sure that BTCPP warning would never be logged. The final logic will be:

  • If a user has conflicting IDs and specifies a file name, only the Behavior Tree (BT) from that file will be loaded. Other trees with the same ID will be ignored. Subtree functionality will fail if subtrees have conflicting IDs.
  • If a user has unique IDs (no conflicts) and specifies a file name, all BTs are loaded, and the subtree feature works correctly.
  • If a user has unique IDs and specifies a BT ID, all BTs are loaded, and the subtree feature works correctly.
  • If a user has conflicting IDs and specifies a BT ID, an error is reported, but the system still attempts to load the BT corresponding to the specified ID.

Description of how this change was tested

  • Tested all 4 conditions listed above on a behavior tree that includes subtrees.
  • Tested with unit tests.

PS: codecov might complain about not covered code in bt_action_server_impl.hpp, but I added unit test for all 4 conditions. So the mock loadBehaviorTree in test_behavior_tree_node.cpp will be covering the new changes.


For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...clude/nav2_behavior_tree/bt_action_server_impl.hpp 72.41% 8 Missing ⚠️
Files with missing lines Coverage Δ
...clude/nav2_behavior_tree/bt_action_server_impl.hpp 88.54% <72.41%> (-1.86%) ⬇️

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull in main / rebase in order for CI to pass

Jad-ELHAJJ and others added 12 commits October 16, 2025 11:12
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Signed-off-by: Jad El Hajj <[email protected]>
Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now. Did you test this again that it works for the cases we had issue with before?

current_bt_id.c_str(), entry.path().string().c_str());
if (registered_ids.count(id)) {
RCLCPP_WARN(logger_, "Skipping conflicting BT file %s (duplicate ID %s)",
entry.path().c_str(), id.c_str());
Copy link
Member

@SteveMacenski SteveMacenski Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants