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
6b3fe415
Commit
6b3fe415
authored
5 years ago
by
Joaquim Casals Buñuel
Browse files
Options
Downloads
Patches
Plain Diff
Added support for loading arbitrary .so files from yaml. Improved error reporting of Loader
parent
7a5ac010
No related branches found
No related tags found
No related merge requests found
Pipeline
#4523
passed
5 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/core/utils/loader.hpp
+1
-1
1 addition, 1 deletion
include/core/utils/loader.hpp
include/core/yaml/parser_yaml.hpp
+11
-2
11 additions, 2 deletions
include/core/yaml/parser_yaml.hpp
src/problem/problem.cpp
+13
-0
13 additions, 0 deletions
src/problem/problem.cpp
with
25 additions
and
3 deletions
include/core/utils/loader.hpp
+
1
−
1
View file @
6b3fe415
...
...
@@ -27,7 +27,7 @@ public:
void
load
(){
this
->
resource_
=
dlopen
(
this
->
path_
.
c_str
(),
RTLD_LAZY
);
if
(
not
this
->
resource_
)
throw
std
::
runtime_error
(
"Couldn't load resource with path "
+
this
->
path_
);
throw
std
::
runtime_error
(
"Couldn't load resource with path "
+
this
->
path_
+
"
\n
"
+
"Error info: "
+
dlerror
()
);
}
void
close
(){
if
(
this
->
resource_
)
dlclose
(
this
->
resource_
);
...
...
This diff is collapsed.
Click to expand it.
include/core/yaml/parser_yaml.hpp
+
11
−
2
View file @
6b3fe415
...
...
@@ -182,6 +182,7 @@ class ParserYAML {
std
::
vector
<
ParamsInitProcessor
>
_paramsProc
;
std
::
vector
<
std
::
string
>
_plugins
;
std
::
vector
<
std
::
string
>
_subscribers
;
std
::
vector
<
std
::
string
>
_raw_libs
;
std
::
stack
<
std
::
string
>
_parsing_file
;
std
::
string
_file
;
bool
_relative_path
;
...
...
@@ -199,7 +200,8 @@ public:
_paramsProc
=
std
::
vector
<
ParamsInitProcessor
>
();
_file
=
""
;
_plugins
=
std
::
vector
<
std
::
string
>
();
_subscribers
=
std
::
vector
<
std
::
string
>
();
_subscribers
=
std
::
vector
<
std
::
string
>
();
_raw_libs
=
std
::
vector
<
std
::
string
>
();
_parsing_file
=
std
::
stack
<
std
::
string
>
();
_path_root
=
""
;
_relative_path
=
false
;
...
...
@@ -211,6 +213,7 @@ public:
_paramsSens
=
std
::
vector
<
ParamsInitSensor
>
();
_paramsProc
=
std
::
vector
<
ParamsInitProcessor
>
();
_plugins
=
std
::
vector
<
std
::
string
>
();
_raw_libs
=
std
::
vector
<
std
::
string
>
();
_subscribers
=
std
::
vector
<
std
::
string
>
();
_parsing_file
=
std
::
stack
<
std
::
string
>
();
_file
=
file
;
...
...
@@ -225,6 +228,7 @@ public:
_paramsProc
=
std
::
vector
<
ParamsInitProcessor
>
();
_plugins
=
std
::
vector
<
std
::
string
>
();
_subscribers
=
std
::
vector
<
std
::
string
>
();
_raw_libs
=
std
::
vector
<
std
::
string
>
();
_parsing_file
=
std
::
stack
<
std
::
string
>
();
_file
=
file
;
if
(
path_root
!=
""
){
...
...
@@ -423,11 +427,16 @@ void ParserYAML::parseFirstLevel(std::string file){
_plugins
.
push_back
(
kv
.
Scalar
());
}
insert_register
(
"plugins"
,
wolf
::
converter
<
std
::
string
>::
convert
(
_plugins
));
YAML
::
Node
n_subscribers
=
n
[
"subscribers"
];
YAML
::
Node
n_subscribers
=
n
[
"subscribers"
];
for
(
const
auto
&
kv
:
n_subscribers
)
{
_subscribers
.
push_back
(
kv
.
Scalar
());
}
insert_register
(
"subscribers"
,
wolf
::
converter
<
std
::
string
>::
convert
(
_subscribers
));
YAML
::
Node
n_raw_libs
=
n
[
"raw_libs"
];
for
(
const
auto
&
kv
:
n_raw_libs
)
{
_raw_libs
.
push_back
(
kv
.
Scalar
());
}
insert_register
(
"raw_libs"
,
wolf
::
converter
<
std
::
string
>::
convert
(
_raw_libs
));
// _params.insert(std::pair<std::string,std::string>);
}
std
::
vector
<
std
::
array
<
std
::
string
,
2
>>
ParserYAML
::
sensorsSerialization
(){
...
...
This diff is collapsed.
Click to expand it.
src/problem/problem.cpp
+
13
−
0
View file @
6b3fe415
...
...
@@ -121,6 +121,19 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server)
l
->
load
();
loaders
.
push_back
(
l
);
}
std
::
vector
<
std
::
string
>
raw_libs
;
try
{
raw_libs
=
_server
.
getParam
<
std
::
vector
<
std
::
string
>>
(
"raw_libs"
);
}
catch
(
MissingValueException
&
e
)
{
WOLF_TRACE
(
"No raw libraries to load..."
);
raw_libs
=
std
::
vector
<
std
::
string
>
();
}
for
(
auto
lib
:
raw_libs
)
{
WOLF_TRACE
(
"Loading raw lib "
+
lib
);
auto
l
=
new
LoaderRaw
(
lib
);
l
->
load
();
loaders
.
push_back
(
l
);
}
// Install sensors and processors
auto
sensorMap
=
std
::
map
<
std
::
string
,
SensorBasePtr
>
();
...
...
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