Skip to content

Subtree input port defaults not applied when _autoremap is enabled #1271

Open

Description

@ottojo

When calling a subtree with _autoremap enabled, the default values for the subtrees input ports are not applied.

I would expect this BT to execute successfully:

<root main_tree_to_execute = "MainTree" BTCPP_format="4">
  <TreeNodesModel>
    <SubTree ID="MySub">
      <input_port name="in_value" default="42"/>
    </SubTree>
  </TreeNodesModel>

  <BehaviorTree ID="MainTree">
    <Sequence>
      <SubTree ID="MySub" _autoremap="true" />
    </Sequence>
  </BehaviorTree>

  <BehaviorTree ID="MySub">
    <Sequence>
      <ScriptCondition code="in_value==42" />
    </Sequence>
  </BehaviorTree>
</root>

but instead an exception is thrown: Exception in node 'MySub::2/ScriptCondition::4' [ScriptCondition]: Error in script [in_value==42] Variable not found: in_value

A failing unit test is added in #1272

Activity

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

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