Go to the documentation of this file.
8 <root BTCPP_format="4">
9 <BehaviorTree ID="MainTree">
11 <Script code="val_A:= 'john' "/>
12 <Script code="val_B:= 42 "/>
13 <SaySomething message="{val_A}" />
14 <SaySomething message="hello world" />
15 <SubTree ID="Sub" val="{val_A}" _autoremap="true" />
16 <SaySomething message="{reply}" />
19 <BehaviorTree ID="Sub">
21 <SaySomething message="{val}" />
22 <SaySomething message="{val_B}" />
23 <Script code="reply:= 'done' "/>
46 tree.tickWhileRunning();
50 tree.tickWhileRunning();
59 std::cout <<
"--- blackboard serialized as JSON: ----\n"
60 << json_after_tick.dump(2) << std::endl;
void BlackboardRestore(const std::vector< Blackboard::Ptr > &backup, BT::Tree &tree)
BlackboardRestore uses Blackboard::cloneInto to restore all the blackboards of the tree.
Tree createTree(const std::string &tree_name, Blackboard::Ptr blackboard=Blackboard::create())
static const char * xml_tree
void registerNodeType(const std::string &ID, const PortsList &ports, ExtraArgs... args)
nlohmann::json ExportTreeToJSON(const BT::Tree &tree)
ExportTreeToJSON it calls ExportBlackboardToJSON for all the blackboards in the tree.
void ImportTreeFromJSON(const nlohmann::json &json, BT::Tree &tree)
ImportTreeFromJSON it calls ImportBlackboardFromJSON for all the blackboards in the tree.
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
std::vector< Blackboard::Ptr > BlackboardBackup(const BT::Tree &tree)
BlackboardBackup uses Blackboard::cloneInto to backup all the blackboards of the tree.
basic_json<> json
default specialization
void registerBehaviorTreeFromText(const std::string &xml_text)