Functions | Variables
t04_blackboard.cpp File Reference
#include "behaviortree_cpp/xml_parsing.h"
#include "behaviortree_cpp/loggers/bt_cout_logger.h"
#include "behaviortree_cpp/blackboard/blackboard_local.h"
#include "movebase_node.h"
Include dependency graph for t04_blackboard.cpp:

Go to the source code of this file.

Functions

NodeStatus CalculateGoalPose (TreeNode &self)
 
int main ()
 

Variables

const std::string xml_text
 

Function Documentation

NodeStatus CalculateGoalPose ( TreeNode self)

Definition at line 42 of file t04_blackboard.cpp.

int main ( )

Definition at line 59 of file t04_blackboard.cpp.

Variable Documentation

const std::string xml_text
Initial value:
= R"(
<root main_tree_to_execute = "MainTree" >
<BehaviorTree ID="MainTree">
<SequenceStar name="root">
<CalculateGoalPose/>
<MoveBase goal="${GoalPose}" />
<SetBlackboard key="OtherGoal" value="-1;3;0.5" />
<MoveBase goal="${OtherGoal}" />
</SequenceStar>
</BehaviorTree>
</root>
)"

This tutorial will tech you:

  • How to use the Blackboard to shared data between TreeNodes
  • How to use a Blackboard as a NodeParameter

The tree is a Sequence of 4 actions

1) Store a value of Pose2D in the key "GoalPose" of the blackboard using the action CalculateGoalPose. 2) Call MoveAction. The NodeParameter "goal" will be read from the Blackboard at run-time. 3) Use the built-in action SetBlackboard to write the key "OtherGoal". 4) Call MoveAction. The NodeParameter "goal" will be read from the Blackboard entry "OtherGoal".

Definition at line 24 of file t04_blackboard.cpp.



behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Feb 2 2019 04:01:53