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
6ca3e505
Commit
6ca3e505
authored
5 years ago
by
Joaquim Casals Buñuel
Browse files
Options
Downloads
Patches
Plain Diff
Add package to publishers @problem::autosetup
parent
1d295f68
No related branches found
No related tags found
No related merge requests found
Pipeline
#5243
failed
5 years ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/core/yaml/parser_yaml.h
+1
-0
1 addition, 0 deletions
include/core/yaml/parser_yaml.h
src/problem/problem.cpp
+7
-0
7 additions, 0 deletions
src/problem/problem.cpp
src/yaml/parser_yaml.cpp
+6
-4
6 additions, 4 deletions
src/yaml/parser_yaml.cpp
with
14 additions
and
4 deletions
include/core/yaml/parser_yaml.h
+
1
−
0
View file @
6ca3e505
...
@@ -30,6 +30,7 @@ class ParserYAML {
...
@@ -30,6 +30,7 @@ class ParserYAML {
YAML
::
Node
n_
;
YAML
::
Node
n_
;
};
};
struct
PublisherManager
{
struct
PublisherManager
{
std
::
string
package_
;
std
::
string
subscriber_
;
std
::
string
subscriber_
;
std
::
string
topic_
;
std
::
string
topic_
;
std
::
string
period_
;
std
::
string
period_
;
...
...
This diff is collapsed.
Click to expand it.
src/problem/problem.cpp
+
7
−
0
View file @
6ca3e505
...
@@ -129,6 +129,13 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server)
...
@@ -129,6 +129,13 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server)
l
->
load
();
l
->
load
();
loaders
.
push_back
(
l
);
loaders
.
push_back
(
l
);
}
}
for
(
auto
it
:
_server
.
getParam
<
std
::
vector
<
std
::
string
>>
(
"packages"
))
{
std
::
string
subscriber
=
packages_path
+
"/libpublisher_"
+
it
+
lib_extension
;
WOLF_TRACE
(
"Loading publisher "
+
subscriber
);
auto
l
=
new
LoaderRaw
(
subscriber
);
l
->
load
();
loaders
.
push_back
(
l
);
}
std
::
vector
<
std
::
string
>
raw_libs
;
std
::
vector
<
std
::
string
>
raw_libs
;
try
{
try
{
raw_libs
=
_server
.
getParam
<
std
::
vector
<
std
::
string
>>
(
"raw_libs"
);
raw_libs
=
_server
.
getParam
<
std
::
vector
<
std
::
string
>>
(
"raw_libs"
);
...
...
This diff is collapsed.
Click to expand it.
src/yaml/parser_yaml.cpp
+
6
−
4
View file @
6ca3e505
...
@@ -430,12 +430,12 @@ void ParserYAML::parseFirstLevel(std::string _file)
...
@@ -430,12 +430,12 @@ void ParserYAML::parseFirstLevel(std::string _file)
{
{
for
(
const
auto
&
kv
:
n_config
[
"ROS publisher"
])
for
(
const
auto
&
kv
:
n_config
[
"ROS publisher"
])
{
{
WOLF_DEBUG
(
"WHAT"
);
PublisherManager
pPublisherManager
=
{
PublisherManager
pPublisherManager
=
{
kv
[
"type"
].
Scalar
(),
kv
[
"topic"
].
Scalar
(),
kv
[
"period"
].
Scalar
(),
kv
kv
[
"package"
].
Scalar
(),
kv
[
"type"
].
Scalar
(),
kv
[
"topic"
].
Scalar
(),
kv
[
"period"
].
Scalar
(),
kv
};
};
publisher_managers_
.
push_back
(
pPublisherManager
);
publisher_managers_
.
push_back
(
pPublisherManager
);
map_container
.
push_back
(
std
::
map
<
std
::
string
,
std
::
string
>
({
{
"type"
,
kv
[
"type"
].
Scalar
()
},
map_container
.
push_back
(
std
::
map
<
std
::
string
,
std
::
string
>
({
{
"package"
,
kv
[
"package"
].
Scalar
()
},
{
"type"
,
kv
[
"type"
].
Scalar
()
},
{
"topic"
,
kv
[
"topic"
].
Scalar
()
},
{
"topic"
,
kv
[
"topic"
].
Scalar
()
},
{
"period"
,
kv
[
"period"
].
Scalar
()
}
}));
{
"period"
,
kv
[
"period"
].
Scalar
()
}
}));
}
}
...
@@ -445,7 +445,7 @@ void ParserYAML::parseFirstLevel(std::string _file)
...
@@ -445,7 +445,7 @@ void ParserYAML::parseFirstLevel(std::string _file)
catch
(
YAML
::
InvalidNode
&
e
)
catch
(
YAML
::
InvalidNode
&
e
)
{
{
throw
std
::
runtime_error
(
"Error parsing publisher @"
+
generatePath
(
_file
)
+
throw
std
::
runtime_error
(
"Error parsing publisher @"
+
generatePath
(
_file
)
+
". Please make sure that each manager has 'type', 'topic' and 'period' entries."
);
". Please make sure that each manager has
'package',
'type', 'topic' and 'period' entries."
);
}
}
}
}
std
::
map
<
std
::
string
,
std
::
string
>
ParserYAML
::
getParams
()
std
::
map
<
std
::
string
,
std
::
string
>
ParserYAML
::
getParams
()
...
@@ -482,6 +482,8 @@ void ParserYAML::parse()
...
@@ -482,6 +482,8 @@ void ParserYAML::parse()
plugins
.
push_back
(
it
.
plugin_
);
plugins
.
push_back
(
it
.
plugin_
);
for
(
const
auto
&
it
:
subscriber_managers_
)
for
(
const
auto
&
it
:
subscriber_managers_
)
packages
.
push_back
(
it
.
package_
);
packages
.
push_back
(
it
.
package_
);
for
(
const
auto
&
it
:
publisher_managers_
)
packages
.
push_back
(
it
.
package_
);
plugins
.
sort
();
plugins
.
sort
();
plugins
.
unique
();
plugins
.
unique
();
packages
.
sort
();
packages
.
sort
();
...
...
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