groot2_publisher.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <array>
4 #include <future>
7 
8 namespace BT
9 {
10 
20 {
22  static std::set<unsigned> used_ports;
23 
25 
26 public:
27  Groot2Publisher(const BT::Tree& tree, unsigned server_port = 1667);
28 
29  ~Groot2Publisher() override;
30 
31  Groot2Publisher(const Groot2Publisher& other) = delete;
32  Groot2Publisher& operator=(const Groot2Publisher& other) = delete;
33 
34  Groot2Publisher(Groot2Publisher&& other) = default;
35  Groot2Publisher& operator=(Groot2Publisher&& other) = default;
36 
44  void setMaxHeartbeatDelay(std::chrono::milliseconds delay);
45 
46  std::chrono::milliseconds maxHeartbeatDelay() const;
47 
48 private:
49  void callback(Duration timestamp, const TreeNode& node, NodeStatus prev_status,
50  NodeStatus status) override;
51 
52  void flush() override;
53 
54  void serverLoop();
55 
56  void heartbeatLoop();
57 
58  void updateStatusBuffer();
59 
60  std::vector<uint8_t> generateBlackboardsDump(const std::string& bb_list);
61 
62  bool insertHook(Monitor::Hook::Ptr breakpoint);
63 
64  bool unlockBreakpoint(Position pos, uint16_t node_uid, NodeStatus result, bool remove);
65 
66  bool removeHook(Position pos, uint16_t node_uid);
67 
68  void removeAllHooks();
69 
70  Monitor::Hook::Ptr getHook(Position pos, uint16_t node_uid);
71 
72  struct PImpl;
73  std::unique_ptr<PImpl> _p;
74 
75  void enableAllHooks(bool enable);
76 };
77 } // namespace BT
BT
Definition: ex01_wrap_legacy.cpp:29
BT::Groot2Publisher::updateStatusBuffer
void updateStatusBuffer()
BT::Groot2Publisher::_p
std::unique_ptr< PImpl > _p
Definition: groot2_publisher.h:72
BT::Monitor::Hook::Ptr
std::shared_ptr< Hook > Ptr
Definition: groot2_protocol.h:207
BT::Groot2Publisher::insertHook
bool insertHook(Monitor::Hook::Ptr breakpoint)
Definition: groot2_publisher.cpp:539
BT::Groot2Publisher::callback
void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
Definition: groot2_publisher.cpp:199
BT::Groot2Publisher::removeHook
bool removeHook(Position pos, uint16_t node_uid)
Definition: groot2_publisher.cpp:632
BT::Groot2Publisher::getHook
Monitor::Hook::Ptr getHook(Position pos, uint16_t node_uid)
Definition: groot2_publisher.cpp:696
BT::Groot2Publisher::Groot2Publisher
Groot2Publisher(const BT::Tree &tree, unsigned server_port=1667)
Definition: groot2_publisher.cpp:107
BT::TreeNode
Abstract base class for Behavior Tree Nodes.
Definition: tree_node.h:118
BT::Tree
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
Definition: bt_factory.h:91
BT::Groot2Publisher::serverLoop
void serverLoop()
Definition: groot2_publisher.cpp:232
BT::StatusChangeLogger
Definition: abstract_logger.h:15
BT::Duration
std::chrono::high_resolution_clock::duration Duration
Definition: basic_types.h:628
mutex
static pthread_mutex_t mutex
Definition: minitrace.cpp:77
BT::Monitor::Hook::Position
Position
Definition: groot2_protocol.h:212
BT::Groot2Publisher::unlockBreakpoint
bool unlockBreakpoint(Position pos, uint16_t node_uid, NodeStatus result, bool remove)
Definition: groot2_publisher.cpp:598
BT::Groot2Publisher
The Groot2Publisher is used to create an interface between your BT.CPP executor and Groot2.
Definition: groot2_publisher.h:19
BT::Groot2Publisher::flush
void flush() override
Definition: groot2_publisher.cpp:227
BT::Groot2Publisher::used_ports_mutex
static std::mutex used_ports_mutex
Definition: groot2_publisher.h:21
BT::Groot2Publisher::generateBlackboardsDump
std::vector< uint8_t > generateBlackboardsDump(const std::string &bb_list)
Definition: groot2_publisher.cpp:518
groot2_protocol.h
BT::Groot2Publisher::PImpl
Definition: groot2_publisher.cpp:54
BT::Groot2Publisher::heartbeatLoop
void heartbeatLoop()
Definition: groot2_publisher.cpp:497
BT::Groot2Publisher::maxHeartbeatDelay
std::chrono::milliseconds maxHeartbeatDelay() const
Definition: groot2_publisher.cpp:170
BT::Groot2Publisher::operator=
Groot2Publisher & operator=(const Groot2Publisher &other)=delete
BT::Groot2Publisher::enableAllHooks
void enableAllHooks(bool enable)
Definition: groot2_publisher.cpp:481
BT::Groot2Publisher::setMaxHeartbeatDelay
void setMaxHeartbeatDelay(std::chrono::milliseconds delay)
setMaxHeartbeatDelay is used to tell the publisher when a connection with Groot2 should be cancelled,...
Definition: groot2_publisher.cpp:165
BT::Groot2Publisher::~Groot2Publisher
~Groot2Publisher() override
Definition: groot2_publisher.cpp:175
BT::Groot2Publisher::removeAllHooks
void removeAllHooks()
Definition: groot2_publisher.cpp:670
BT::NodeStatus
NodeStatus
Definition: basic_types.h:33
BT::Groot2Publisher::used_ports
static std::set< unsigned > used_ports
Definition: groot2_publisher.h:22
abstract_logger.h


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:16