@@ -299,6 +299,13 @@ const std::set<std::string>& BehaviorTreeFactory::builtinNodes() const
299299Tree BehaviorTreeFactory::createTreeFromText (const std::string& text,
300300 Blackboard::Ptr blackboard)
301301{
302+ if (!parser_->registeredBehaviorTrees ().empty ()) {
303+ std::cout << " WARNING: You executed BehaviorTreeFactory::createTreeFromText "
304+ " after registerBehaviorTreeFrom[File/Text].\n "
305+ " This is NOTm probably, what you want to do.\n "
306+ " You should probably use BehaviorTreeFactory::createTree, instead"
307+ << std::endl;
308+ }
302309 XMLParser parser (*this );
303310 parser.loadFromText (text);
304311 auto tree = parser.instantiateTree (blackboard);
@@ -309,6 +316,14 @@ Tree BehaviorTreeFactory::createTreeFromText(const std::string& text,
309316Tree BehaviorTreeFactory::createTreeFromFile (const std::string& file_path,
310317 Blackboard::Ptr blackboard)
311318{
319+ if (!parser_->registeredBehaviorTrees ().empty ()) {
320+ std::cout << " WARNING: You executed BehaviorTreeFactory::createTreeFromFile "
321+ " after registerBehaviorTreeFrom[File/Text].\n "
322+ " This is NOTm probably, what you want to do.\n "
323+ " You should probably use BehaviorTreeFactory::createTree, instead"
324+ << std::endl;
325+ }
326+
312327 XMLParser parser (*this );
313328 parser.loadFromFile (file_path);
314329 auto tree = parser.instantiateTree (blackboard);
0 commit comments