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

Go to the source code of this file.

Classes

class  ThinkWhatToSay
 

Functions

int main ()
 

Variables

static const char * xml_text
 

Function Documentation

int main ( )

Definition at line 71 of file t02_basic_ports.cpp.

Variable Documentation

const char* xml_text
static
Initial value:
= R"(
<root main_tree_to_execute = "MainTree" >
<BehaviorTree ID="MainTree">
<Sequence name="root">
<SaySomething message="start thinking..." />
<ThinkWhatToSay text="{the_answer}"/>
<SaySomething message="{the_answer}" />
<SaySomething2 message="SaySomething2 works too..." />
<SaySomething2 message="{the_answer}" />
</Sequence>
</BehaviorTree>
</root>
)"

This tutorial will teach you how basic input/output ports work.

Ports are a mechanism to exchange information between Nodes using a key/value storage called "Blackboard". The type and number of ports of a Node is statically defined.

Input Ports are like "argument" of a functions. Output ports are, conceptually, like "return values".

In this example, a Sequence of 5 Actions is executed:

  • Actions 1 and 4 read the input "message" from a static string.
  • Actions 3 and 5 read the input "message" from an entry in the blackboard called "the_answer".
  • Action 2 writes something into the entry of the blackboard called "the_answer".

Definition at line 29 of file t02_basic_ports.cpp.



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