Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
ee9efbb3
Commit
ee9efbb3
authored
6 years ago
by
Joaquim Casals Buñuel
Browse files
Options
Downloads
Patches
Plain Diff
("sensorname", value) -> ("sensor name", value) YAML config
parent
8ca60ebb
No related branches found
No related tags found
1 merge request
!260
WIP: params autoconf
Pipeline
#2804
failed
6 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hello_plugin/params.yaml
+4
-4
4 additions, 4 deletions
hello_plugin/params.yaml
include/base/yaml/parser_yaml.hpp
+3
-3
3 additions, 3 deletions
include/base/yaml/parser_yaml.hpp
with
7 additions
and
7 deletions
hello_plugin/params.yaml
+
4
−
4
View file @
ee9efbb3
...
@@ -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
This diff is collapsed.
Click to expand it.
include/base/yaml/parser_yaml.hpp
+
3
−
3
View file @
ee9efbb3
...
@@ -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"
]){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment