BehaviorTree / Groot2

36 stars 0 forks source link

Includes are not loaded if xml doesn't contain BehaviorTree tag #18

Closed OPerepadia closed 1 year ago

OPerepadia commented 1 year ago

Describe the bug If included file doesn't contain any trees, it's includes are not loaded.

To Reproduce

Create top level tree:

<?xml version="1.0" encoding="UTF-8"?>
<root BTCPP_format="4">

  <include path="macros.xml"/>

  <BehaviorTree ID="MainTree">
    <SubTree ID="IncludedSubtree"/>
  </BehaviorTree>

</root>

Create macros.xml:

<?xml version="1.0" encoding="UTF-8"?>
<root BTCPP_format="4">

  <include path="macros_sim.xml"/>

<!-- <BehaviorTree ID="aaaaa">
    <AlwaysSuccess/>
  </BehaviorTree> -->

</root>

Create macros_sim.xml:

<?xml version="1.0" encoding="UTF-8"?>
<root BTCPP_format="4">

  <BehaviorTree ID="IncludedSubtree">
    <AlwaysSuccess/>
  </BehaviorTree>

</root>

The subtree IncludedSubtree is loaded only if the dummy tree in macros.xml is uncommented.

Expected behavior

Includes are loaded even if xml doesn't have any behavior trees.

facontidavide commented 1 year ago

I will check this out, thanks for reporting

facontidavide commented 1 year ago

fixed. Next version will include this change