BehaviorTree.CPP icon indicating copy to clipboard operation
BehaviorTree.CPP copied to clipboard

_autoremap keyword not behaving as expected in version 4.4.0

Open Omar-Elmofty opened this issue 3 years ago • 1 comments

Hello, I just upgraded from version 4.1.1 to 4.4.0, and been having issues with the _autoremap keyword.

I had the following pattern in my application:

<root BTCPP_format="4">
  <BehaviorTree ID="Subtree1">\n"
    <Sequence>
      <PrintToConsole message="{msg1}"/>
      <PrintToConsole message="{msg2}"/>
    </Sequence>
  </BehaviorTree>
                          
  <BehaviorTree ID="Subtree2">
    <Sequence>
      <SubTree ID="Subtree1" msg1="foo1" _autoremap="true"/>
      <SubTree ID="Subtree1" msg1="foo2" _autoremap="true"/>
    </Sequence>
  </BehaviorTree>
                          
  <BehaviorTree ID="MainTree">
    <SubTree ID="Subtree2" msg2="bar"/>
  </BehaviorTree>
</root>
  • Subtree1 accepts 2 input ports (msg1 and msg2) and prints them to console using the custom PrintToConsole node
  • Subtree2 calls Subtree1 twice with _autoremap=true and the msg1 port explicitly specified (foo1 and foo2)
  • MainTree calls Subtree2 and sets the msg2 port set to be bar

I would have expected the output of running MainTree to produce

foo1
bar
foo2
bar

However, the output I am getting is:

foo2
bar
foo2
bar

For some reason the msg1 port value seems to contain foo2 for both instances of Subtree1, even though for the first instance msg1 should be foo1.

Would appreciate it if you could advise if this is a bug, or if the intention/use of the _autoremap keyword has changed?

Omar-Elmofty avatar Nov 07 '23 06:11 Omar-Elmofty

fixed. thanks for reporting

facontidavide avatar Nov 08 '23 18:11 facontidavide