@@ -13,7 +13,6 @@ using namespace BT;
13
13
* its own thread).
14
14
*/
15
15
16
-
17
16
// clang-format off
18
17
19
18
const std::string xml_text_sequence = R"(
@@ -54,16 +53,17 @@ const std::string xml_text_sequence_star = R"(
54
53
55
54
void Assert (bool condition)
56
55
{
57
- if ( !condition ) throw std::runtime_error (" this is not what I expected" );
56
+ if (!condition)
57
+ throw std::runtime_error (" this is not what I expected" );
58
58
}
59
59
60
60
int main ()
61
61
{
62
62
using namespace DummyNodes ;
63
63
64
64
BehaviorTreeFactory factory;
65
- factory.registerSimpleCondition (" TemperatureOK" , std::bind ( CheckBattery ));
66
- factory.registerSimpleCondition (" BatteryOK" , std::bind ( CheckTemperature ));
65
+ factory.registerSimpleCondition (" TemperatureOK" , std::bind (CheckBattery));
66
+ factory.registerSimpleCondition (" BatteryOK" , std::bind (CheckTemperature));
67
67
factory.registerNodeType <MoveBaseAction>(" MoveBase" );
68
68
factory.registerNodeType <SaySomething>(" SaySomething" );
69
69
@@ -74,7 +74,7 @@ int main()
74
74
// 1) When Sequence is used, BatteryOK and TempearaturOK is executed at each tick()
75
75
// 2) When SequenceStar is used, those ConditionNodes are executed only once.
76
76
77
- for (auto & xml_text: {xml_text_sequence, xml_text_sequence_star})
77
+ for (auto & xml_text : {xml_text_sequence, xml_text_sequence_star})
78
78
{
79
79
std::cout << " \n ------------ BUILDING A NEW TREE ------------" << std::endl;
80
80
@@ -84,17 +84,17 @@ int main()
84
84
85
85
std::cout << " \n --- 1st executeTick() ---" << std::endl;
86
86
status = tree.root_node ->executeTick ();
87
- Assert ( status == NodeStatus::RUNNING);
87
+ Assert (status == NodeStatus::RUNNING);
88
88
89
89
SleepMS (150 );
90
90
std::cout << " \n --- 2nd executeTick() ---" << std::endl;
91
91
status = tree.root_node ->executeTick ();
92
- Assert ( status == NodeStatus::RUNNING);
92
+ Assert (status == NodeStatus::RUNNING);
93
93
94
94
SleepMS (150 );
95
95
std::cout << " \n --- 3rd executeTick() ---" << std::endl;
96
96
status = tree.root_node ->executeTick ();
97
- Assert ( status == NodeStatus::SUCCESS);
97
+ Assert (status == NodeStatus::SUCCESS);
98
98
99
99
std::cout << std::endl;
100
100
}
@@ -138,4 +138,3 @@ Robot says: "mission started..."
138
138
Robot says: "mission completed!"
139
139
140
140
*/
141
-
0 commit comments