@@ -9,13 +9,14 @@ class SimpleCondition : public BT::ConditionNode
9
9
{
10
10
private:
11
11
std::string port_name_;
12
+
12
13
public:
13
14
SimpleCondition (const std::string& name, const BT::NodeConfig& config,
14
- std::string port_name) :
15
- BT::ConditionNode (name, config),
16
- port_name_ (port_name)
15
+ std::string port_name)
16
+ : BT::ConditionNode(name, config), port_name_(port_name)
17
17
{}
18
- static BT::PortsList providedPorts () {
18
+ static BT::PortsList providedPorts ()
19
+ {
19
20
return {};
20
21
}
21
22
BT::NodeStatus tick () override
@@ -30,28 +31,35 @@ class AsyncTestAction : public BT::StatefulActionNode
30
31
{
31
32
int counter_ = 0 ;
32
33
std::string port_name_;
34
+
33
35
public:
34
36
AsyncTestAction (const std::string& name, const BT::NodeConfig& config,
35
- std::string port_name) :
36
- BT::StatefulActionNode (name, config),
37
- port_name_ (port_name)
37
+ std::string port_name)
38
+ : BT::StatefulActionNode(name, config), port_name_(port_name)
38
39
{}
39
40
40
- static BT::PortsList providedPorts (){ return {}; }
41
+ static BT::PortsList providedPorts ()
42
+ {
43
+ return {};
44
+ }
41
45
42
- NodeStatus onStart () override {
46
+ NodeStatus onStart () override
47
+ {
43
48
counter_ = 0 ;
44
49
return NodeStatus::RUNNING;
45
50
}
46
51
47
- NodeStatus onRunning () override {
48
- if (++counter_ == 2 ) {
52
+ NodeStatus onRunning () override
53
+ {
54
+ if (++counter_ == 2 )
55
+ {
49
56
config ().blackboard ->set <bool >(port_name_, true );
50
57
return NodeStatus::SUCCESS;
51
58
}
52
59
return NodeStatus::RUNNING;
53
60
}
54
- void onHalted () override {}
61
+ void onHalted () override
62
+ {}
55
63
};
56
64
// --------------------------
57
65
@@ -112,7 +120,6 @@ TEST(ReactiveBackchaining, EnsureWarm)
112
120
EXPECT_EQ (observer.getStatistics (" wear" ).success_count , 1 );
113
121
}
114
122
115
-
116
123
TEST (ReactiveBackchaining, EnsureWarmWithEnsureHoldingHacket)
117
124
{
118
125
// This test backchains on HoldingHacket => EnsureHoldingHacket to iteratively add reactivity and functionality to the tree.
@@ -181,4 +188,4 @@ TEST(ReactiveBackchaining, EnsureWarmWithEnsureHoldingHacket)
181
188
EXPECT_EQ (tree.tickExactlyOnce (), NodeStatus::SUCCESS);
182
189
}
183
190
184
- }
191
+ } // namespace BT::test
0 commit comments