Go to the documentation of this file. 1 #include <gtest/gtest.h>
7 using std::chrono::milliseconds;
18 return NodeStatus::RUNNING;
22 return ++
count_ < 10 ? NodeStatus::RUNNING : NodeStatus::SUCCESS;
36 TEST(Reactive, TestLogging)
40 static const char* reactive_xml_text = R
"(
42 <BehaviorTree ID="Main">
45 <AlwaysSuccess name="success"/>
56 std::array<int, 1> counters;
62 auto ret = tree.tickRootWhileRunning();
65 int num_ticks = counters[0];
66 ASSERT_GE(num_ticks, 10);
void registerNodeType(const std::string &ID)
static BT::PortsList providedPorts()
void RegisterTestTick(BT::BehaviorTreeFactory &factory, const std::string &name_prefix, std::array< int, N > &tick_counters)
std::unordered_map< std::string, PortInfo > PortsList
const NodeConfiguration & config() const
StatefulActionNode(const std::string &name, const NodeConfiguration &config)
TEST(Reactive, TestLogging)
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
NodeStatus onRunning() override
method invoked by a RUNNING action.
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
const std::string & name() const
Name of the instance, not the type.
NodeStatus onStart() override
SleepNode(const std::string &name, const BT::NodeConfiguration &config)
The ActionNode is the prefered way to implement asynchronous Actions. It is actually easier to use co...
AddStdCoutLoggerToTree. Give the root node of a tree, a simple callback is subscribed to any status c...
behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Wed Jun 26 2024 02:51:19