Go to the documentation of this file. 1 #ifndef SIMPLE_BT_NODES_H
2 #define SIMPLE_BT_NODES_H
60 return { BT::InputPort<std::string>(
"message") };
78 return { BT::InputPort<int>(
"msec") };
88 return NodeStatus::SUCCESS;
92 using namespace std::chrono;
94 deadline_ = system_clock::now() + milliseconds(msec);
95 return NodeStatus::RUNNING;
102 if(std::chrono::system_clock::now() >=
deadline_)
104 return NodeStatus::SUCCESS;
108 return NodeStatus::RUNNING;
115 std::cout <<
"SleepNode interrupted" << std::endl;
139 #endif // SIMPLE_BT_NODES_H
Result getInput(const std::string &key, T &destination) const
static BT::PortsList providedPorts()
ApproachObject(const std::string &name)
const NodeConfig & config() const
std::chrono::system_clock::time_point deadline_
StatefulActionNode(const std::string &name, const NodeConfig &config)
NodeStatus onRunning() override
method invoked by an action in the RUNNING state.
Abstract base class for Behavior Tree Nodes.
BT::NodeStatus CheckBattery()
BT::NodeStatus SaySomethingSimple(BT::TreeNode &self)
NodeStatus tick() override
Method to be implemented by the user.
NodeStatus tick() override
Method to be implemented by the user.
std::unordered_map< std::string, PortInfo > PortsList
constexpr auto bind(Callback &&callback, BoundArgs &&... args)
Binds the operator() of the callback with pre-defined/remapped values.
SleepNode(const std::string &name, const BT::NodeConfig &config)
void registerNodeType(const std::string &ID, const PortsList &ports, ExtraArgs... args)
void RegisterNodes(BT::BehaviorTreeFactory &factory)
SyncActionNode(const std::string &name, const NodeConfig &config)
NodeStatus onStart() override
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.
BT::NodeStatus SayHello()
void registerSimpleCondition(const std::string &ID, const SimpleConditionNode::TickFunctor &tick_functor, PortsList ports={})
registerSimpleCondition help you register nodes of type SimpleConditionNode.
static BT::PortsList providedPorts()
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
BT::NodeStatus CheckTemperature()
void registerSimpleAction(const std::string &ID, const SimpleActionNode::TickFunctor &tick_functor, PortsList ports={})
registerSimpleAction help you register nodes of type SimpleActionNode.
The StatefulActionNode is the preferred way to implement asynchronous Actions. It is actually easier ...
SaySomething(const std::string &name, const BT::NodeConfig &config)