Sarafun Behavior Trees package
1
Behavior trees for the SARAFun project
Main Page
Data Structures
All
Data Structures
Namespaces
Functions
Variables
Enumerations
Enumerator
sarafun_tree
src
demo_bt_nodes
IsSimple.cpp
1
#include <sarafun_tree/demo_bt_nodes/IsSimple.h>
2
3
namespace
sarafun {
4
5
bool
IsSimple::isSystemActive
() {
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
20
bool
IsSimple::conditionEvaluation
() {
21
22
if
(
isSystemActive
()) {
23
counter_
++;
24
}
25
26
ROS_INFO(
"%s: counter is %d"
,
bt_name_
.c_str(),
counter_
);
27
28
if
(
counter_
<
condition_limit_
)
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
}
sarafun::IsSimple::condition_limit_
int condition_limit_
Definition:
IsSimple.h:26
sarafun::IsSimple
Definition:
IsSimple.h:8
sarafun::IsSimple::conditionEvaluation
bool conditionEvaluation()
Definition:
IsSimple.cpp:20
sarafun::IsSimple::bt_name_
std::string bt_name_
Definition:
IsSimple.h:24
sarafun::IsSimple::isSystemActive
bool isSystemActive()
Definition:
IsSimple.cpp:5
sarafun::IsSimple::counter_
int counter_
Definition:
IsSimple.h:26
Generated on Fri Feb 17 2017 11:14:54 for Sarafun Behavior Trees package by
1.8.6