From 8b16a69dfd2eb5daf0ec5bf8e4ed61f23f03e0f2 Mon Sep 17 00:00:00 2001
From: jcasals <jcasals@iri.upc.edu>
Date: Wed, 10 Jun 2020 15:03:10 +0200
Subject: [PATCH] [bug-fix] ParserYAML now correctly parses keyword "follow"
 under "config"

---
 src/yaml/parser_yaml.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/yaml/parser_yaml.cpp b/src/yaml/parser_yaml.cpp
index 2d1aa8200..d37d8c022 100644
--- a/src/yaml/parser_yaml.cpp
+++ b/src/yaml/parser_yaml.cpp
@@ -497,13 +497,11 @@ void ParserYAML::parse()
 
     YAML::Node n;
     n = loadYAML(generatePath(file_));
-
     if (n.Type() == YAML::NodeType::Map)
     {
         for (auto it : n)
         {
             auto node = it.second;
-            // WOLF_INFO("WUT ", it.first);
             std::vector<std::string> tags = std::vector<std::string>();
             if (it.first.as<std::string>() != "config")
                 walkTreeR(node, tags, it.first.as<std::string>());
@@ -515,7 +513,15 @@ void ParserYAML::parse()
                     if (node_key != "problem" and node_key != "sensors" and node_key != "processors" and
                         node_key != "ROS subscriber" and node_key != "ROS publisher")
                     {
-                        walkTreeR(itt.second, tags, node_key);
+                        std::regex rr("follow");
+                        if (not std::regex_match(node_key, rr))
+                        {
+                            walkTreeR(itt.second, tags, node_key);
+                        }
+                        else
+                        {
+                            walkTree(itt.second.as<std::string>(), tags, "");
+                        }
                     }
                 }
             }
-- 
GitLab