Functions | Variables
t06_subtree_port_remapping.cpp File Reference
#include "behaviortree_cpp/loggers/bt_cout_logger.h"
#include "behaviortree_cpp/bt_factory.h"
#include "movebase_node.h"
#include "dummy_nodes.h"
Include dependency graph for t06_subtree_port_remapping.cpp:

Go to the source code of this file.

Functions

int main ()
 

Variables

static const char * xml_text
 

Function Documentation

int main ( )

Definition at line 57 of file t06_subtree_port_remapping.cpp.

Variable Documentation

const char* xml_text
static
Initial value:
= R"(
<root main_tree_to_execute = "MainTree">
<BehaviorTree ID="MainTree">
<Sequence name="main_sequence">
<SetBlackboard output_key="move_goal" value="1;2;3" />
<SubTree ID="MoveRobot" target="move_goal" output="move_result" />
<SaySomething message="{move_result}"/>
</Sequence>
</BehaviorTree>
<BehaviorTree ID="MoveRobot">
<Fallback name="move_robot_main">
<SequenceStar>
<MoveBase goal="{target}"/>
<SetBlackboard output_key="output" value="mission accomplished" />
</SequenceStar>
<ForceFailure>
<SetBlackboard output_key="output" value="mission failed" />
</ForceFailure>
</Fallback>
</BehaviorTree>
</root>
)"

In the CrossDoor example we did not exchange any information between the Maintree and the DoorClosed subtree.

If we tried to do that, we would have noticed that it can't be done, because each of the tree/subtree has its own Blackboard, to avoid the problem of name clashing in very large trees.

But a SubTree can have its own input/output ports. In practice, these ports are nothing more than "soft links" between the ports inside the SubTree (called "internal") and those in the parent Tree (called "external").

Definition at line 23 of file t06_subtree_port_remapping.cpp.



behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:05