Skip to content
Snippets Groups Projects
Commit ee9efbb3 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

("sensorname", value) -> ("sensor name", value) YAML config

parent 8ca60ebb
No related branches found
No related tags found
1 merge request!260WIP: params autoconf
Pipeline #2804 failed
...@@ -15,16 +15,16 @@ config: ...@@ -15,16 +15,16 @@ config:
- -
type: "ODOM 2D" type: "ODOM 2D"
name: "processor1" name: "processor1"
sensorname: "odom" sensor name: "odom"
- -
type: "RANGE BEARING" type: "RANGE BEARING"
name: "rb_processor" name: "rb_processor"
sensorname: "rb" sensor name: "rb"
- -
type: "ODOM 2D" type: "ODOM 2D"
name: "my_proc_test" name: "my_proc_test"
sensorname: "odom" sensor name: "odom"
follow: "../hello_plugin/params_conf.yaml" follow: "../hello_plugin/params_conf.yaml" #Config continues in this file
files: files:
- "/home/jcasals/workspace/wip/wolf/lib/libsensor_odom.so" - "/home/jcasals/workspace/wip/wolf/lib/libsensor_odom.so"
- "/home/jcasals/workspace/wip/wolf/lib/librange_bearing.so" - "/home/jcasals/workspace/wip/wolf/lib/librange_bearing.so"
\ No newline at end of file
...@@ -171,12 +171,12 @@ void parserYAML::walkTreeR(YAML::Node n, vector<string>& tags, string hdr){ ...@@ -171,12 +171,12 @@ void parserYAML::walkTreeR(YAML::Node n, vector<string>& tags, string hdr){
case YAML::NodeType::Map : { case YAML::NodeType::Map : {
for(const auto& kv : n){ for(const auto& kv : n){
//If the key's value starts with a $ (i.e. $key) then its value is parsed as a literal map, //If the key's value starts with a $ (i.e. $key) then its value is parsed as a literal map,
//otherwise the parser recursively parses the map //otherwise the parser recursively parses the map.
regex r("^\\$.*"); regex r("^\\$.*");
if(not regex_match(kv.first.as<string>(), r)){ if(not regex_match(kv.first.as<string>(), r)){
/* /*
If key=="follow" then the parser will assume that the value is a path and will parse If key=="follow" then the parser will assume that the value is a path and will parse
the (expected) yaml file at the specified path. Note that this does not increase the header depth the (expected) yaml file at the specified path. Note that this does not increase the header depth.
The following example shows how the header remains unafected: The following example shows how the header remains unafected:
@my_main_config | @some_path @my_main_config | @some_path
- cov_det: 1 | - my_value : 23 - cov_det: 1 | - my_value : 23
...@@ -235,7 +235,7 @@ void parserYAML::parseFirstLevel(string file){ ...@@ -235,7 +235,7 @@ void parserYAML::parseFirstLevel(string file){
_paramsSens.push_back(pSensor); _paramsSens.push_back(pSensor);
} }
for(const auto& kv : n_config["processors"]){ for(const auto& kv : n_config["processors"]){
ParamsInitProcessor pProc = {kv["type"].Scalar(), kv["name"].Scalar(), kv["sensorname"].Scalar(), kv}; ParamsInitProcessor pProc = {kv["type"].Scalar(), kv["name"].Scalar(), kv["sensor name"].Scalar(), kv};
_paramsProc.push_back(pProc); _paramsProc.push_back(pProc);
} }
for(const auto& kv : n_config["callbacks"]){ for(const auto& kv : n_config["callbacks"]){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment