timeout_node.h
Go to the documentation of this file.
00001 #ifndef DECORATOR_TIMEOUT_NODE_H
00002 #define DECORATOR_TIMEOUT_NODE_H
00003 
00004 #include "behaviortree_cpp/decorator_node.h"
00005 #include <atomic>
00006 #include "timer_queue.h"
00007 
00008 namespace BT
00009 {
00010 class TimeoutNode : public DecoratorNode
00011 {
00012   public:
00013     TimeoutNode(const std::string& name, unsigned milliseconds);
00014 
00015     TimeoutNode(const std::string& name, const NodeParameters& params);
00016 
00017     static const NodeParameters& requiredNodeParameters()
00018     {
00019         static NodeParameters params = {{"msec", "0"}};
00020         return params;
00021     }
00022 
00023   private:
00024     static TimerQueue& timer()
00025     {
00026         static TimerQueue timer_queue;
00027         return timer_queue;
00028     }
00029 
00030     virtual BT::NodeStatus tick() override;
00031 
00032     std::atomic<bool> child_halted_;
00033     uint64_t timer_id_;
00034 
00035     unsigned msec_;
00036     bool read_parameter_from_blackboard_;
00037 };
00038 }
00039 
00040 #endif   // DEADLINE_NODE_H


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Feb 2 2019 03:50:10