|
2 | 2 | #include "crossdoor_nodes.h" |
3 | 3 | #include "behaviortree_cpp/bt_factory.h" |
4 | 4 | #include "behaviortree_cpp/loggers/groot2_publisher.h" |
5 | | -#include "behaviortree_cpp/loggers/bt_sqlite_logger.h" |
6 | 5 | #include "behaviortree_cpp/xml_parsing.h" |
7 | 6 | #include "behaviortree_cpp/json_export.h" |
8 | 7 |
|
@@ -119,26 +118,8 @@ int main() |
119 | 118 | // Add two more loggers, to save the transitions into a file. |
120 | 119 | // Both formats are compatible with Groot2 |
121 | 120 |
|
122 | | - // Lightweight serialization |
| 121 | + // Logging with lightweight serialization |
123 | 122 | 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); |
142 | 123 |
|
143 | 124 | while(1) |
144 | 125 | { |
|
0 commit comments