Sarafun Behavior Trees package  1
Behavior trees for the SARAFun project
 All Data Structures Namespaces Functions Variables Enumerations Enumerator
IsSimple.cpp
1 #include <sarafun_tree/demo_bt_nodes/IsSimple.h>
2 
3 namespace sarafun {
4 
6  bool running;
7  if (nh_.hasParam("/sarafun/bt/running")) {
8  nh_.getParam("/sarafun/bt/running", running);
9 
10  if (running) {
11  return true;
12  }
13  } else {
14  ROS_WARN("The parameter /sarafun/bt/running must be set"
15  "for a BT action to run!");
16  }
17  return false;
18 }
19 
21 
22  if (isSystemActive()) {
23  counter_++;
24  }
25 
26  ROS_INFO("%s: counter is %d", bt_name_.c_str(), counter_);
27 
29  {
30  return true;
31  }
32 
33  return false;
34 }
35 }
36 
37 int main(int argc, char **argv) {
38  ros::init(argc, argv, "IsSimple");
39  sarafun::IsSimple is_simple(ros::this_node::getName(),
40  "IsSimple");
41  ros::spin();
42  return 1;
43 }
int condition_limit_
Definition: IsSimple.h:26
bool conditionEvaluation()
Definition: IsSimple.cpp:20
std::string bt_name_
Definition: IsSimple.h:24
bool isSystemActive()
Definition: IsSimple.cpp:5