Go to the documentation of this file.
14 using namespace std::chrono;
16 constexpr
const char* whitespaces =
" ";
17 constexpr
const size_t ws_count = 25;
19 double since_epoch = duration<double>(timestamp).count();
20 printf(
"[%.3f]: %s%s %s -> %s", since_epoch, node.
name().c_str(),
21 &whitespaces[std::min(ws_count, node.
name().size())],
22 toStr(prev_status,
true).c_str(),
toStr(status,
true).c_str());
23 std::cout << std::endl;
28 std::cout << std::flush;
~StdCoutLogger() override
virtual void flush() override
Abstract base class for Behavior Tree Nodes.
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
virtual void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
std::chrono::high_resolution_clock::duration Duration
StdCoutLogger(const BT::Tree &tree)
const std::string & name() const
Name of the instance, not the type.
std::string toStr(const T &value)
toStr is the reverse operation of convertFromString.