Skip to content

Commit 696a27b

Browse files
committed
cleanup t12
1 parent 3018e16 commit 696a27b

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

examples/t12_groot_howto.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "crossdoor_nodes.h"
33
#include "behaviortree_cpp/bt_factory.h"
44
#include "behaviortree_cpp/loggers/groot2_publisher.h"
5-
#include "behaviortree_cpp/loggers/bt_sqlite_logger.h"
65
#include "behaviortree_cpp/xml_parsing.h"
76
#include "behaviortree_cpp/json_export.h"
87

@@ -119,26 +118,8 @@ int main()
119118
// Add two more loggers, to save the transitions into a file.
120119
// Both formats are compatible with Groot2
121120

122-
// Lightweight serialization
121+
// Logging with lightweight serialization
123122
BT::FileLogger2 logger2(tree, "t12_logger2.btlog");
124-
// SQLite logger can save multiple sessions into the same database
125-
bool append_to_database = true;
126-
BT::SqliteLogger sqlite_logger(tree, "t12_sqlitelog.db3", append_to_database);
127-
128-
// We can add some extra information to the SqliteLogger, for instance the value of the
129-
// "door_open" blackboard entry, at the end of node "tryOpen" (Fallback)
130-
131-
auto sqlite_callback = [](BT::Duration timestamp, const BT::TreeNode& node,
132-
BT::NodeStatus prev_status,
133-
BT::NodeStatus status) -> std::string {
134-
if(node.name() == "tryOpen" && BT::isStatusCompleted(status))
135-
{
136-
auto is_open = BT::toStr(node.config().blackboard->get<bool>("door_open"));
137-
return "[tryOpen] door_open=" + is_open;
138-
}
139-
return {};
140-
};
141-
sqlite_logger.setAdditionalCallback(sqlite_callback);
142123

143124
while(1)
144125
{

0 commit comments

Comments
 (0)