dummy_nodes.cpp
Go to the documentation of this file.
1 #include "dummy_nodes.h"
2 
3 // This function must be implemented in the .cpp file to create
4 // a plugin that can be loaded at run-time
6 {
8 }
9 
10 namespace DummyNodes
11 {
12 
14 {
15  std::cout << "[ Battery: OK ]" << std::endl;
17 }
18 
20 {
21  _opened = true;
22  std::cout << "GripperInterface::open" << std::endl;
24 }
25 
27 {
28  std::cout << "GripperInterface::close" << std::endl;
29  _opened = false;
31 }
32 
34 {
35  std::cout << "ApproachObject: " << this->name() << std::endl;
37 }
38 
40 {
41  auto msg = getInput<std::string>("message");
42  if (!msg)
43  {
44  throw BT::RuntimeError( "missing required input [message]: ", msg.error() );
45  }
46 
47  std::cout << "Robot says: " << msg.value() << std::endl;
49 }
50 
52 {
53  auto msg = self.getInput<std::string>("message");
54  if (!msg)
55  {
56  throw BT::RuntimeError( "missing required input [message]: ", msg.error() );
57  }
58 
59  std::cout << "Robot says: " << msg.value() << std::endl;
61 }
62 
63 }
void RegisterNodes(BT::BehaviorTreeFactory &factory)
Definition: dummy_nodes.h:67
Abstract base class for Behavior Tree Nodes.
Definition: tree_node.h:53
BT::NodeStatus tick() override
Method to be implemented by the user.
Definition: dummy_nodes.cpp:39
BT::NodeStatus SaySomethingSimple(BT::TreeNode &self)
Definition: dummy_nodes.cpp:51
NodeStatus
Definition: basic_types.h:35
BT_REGISTER_NODES(factory)
Definition: dummy_nodes.cpp:5
BT::NodeStatus tick() override
Method to be implemented by the user.
Definition: dummy_nodes.cpp:33
BT::NodeStatus CheckBattery()
Definition: dummy_nodes.cpp:13


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:04