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
e537afe2
Commit
e537afe2
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
less verbose Problem::autoSetup
parent
0d40266e
No related branches found
No related tags found
1 merge request
!448
Draft: Resolve "Implementation of new nodes creation"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/problem/problem.cpp
+10
-12
10 additions, 12 deletions
src/problem/problem.cpp
with
10 additions
and
12 deletions
src/problem/problem.cpp
+
10
−
12
View file @
e537afe2
...
@@ -115,7 +115,7 @@ ProblemPtr Problem::create(const std::string& _frame_structure, SizeEigen _dim,
...
@@ -115,7 +115,7 @@ ProblemPtr Problem::create(const std::string& _frame_structure, SizeEigen _dim,
ProblemPtr
Problem
::
autoSetup
(
const
std
::
string
&
_input_yaml_file
,
std
::
vector
<
std
::
string
>
_schema_folders
)
ProblemPtr
Problem
::
autoSetup
(
const
std
::
string
&
_input_yaml_file
,
std
::
vector
<
std
::
string
>
_schema_folders
)
{
{
// Create YAML server
// Create YAML server
WOLF_
INFO
(
"Loading YAML file..."
);
WOLF_
DEBUG
(
"Loading YAML file..."
);
auto
server
=
yaml_schema_cpp
::
YamlServer
({},
_input_yaml_file
);
auto
server
=
yaml_schema_cpp
::
YamlServer
({},
_input_yaml_file
);
auto
params_node
=
server
.
getNode
();
auto
params_node
=
server
.
getNode
();
WOLF_DEBUG
(
"Loaded node:
\n
"
,
params_node
);
WOLF_DEBUG
(
"Loaded node:
\n
"
,
params_node
);
...
@@ -132,7 +132,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, std::vector<s
...
@@ -132,7 +132,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, std::vector<s
server
.
addFolderSchema
(
_schema_folders
);
server
.
addFolderSchema
(
_schema_folders
);
// Validate against schema
// Validate against schema
WOLF_
INFO
(
"Validating YAML file..."
);
WOLF_
DEBUG
(
"Validating YAML file..."
);
if
(
not
server
.
applySchema
(
"Problem.schema"
))
if
(
not
server
.
applySchema
(
"Problem.schema"
))
{
{
WOLF_ERROR
(
server
.
getLog
());
WOLF_ERROR
(
server
.
getLog
());
...
@@ -145,7 +145,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, std::vector<s
...
@@ -145,7 +145,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, std::vector<s
WOLF_ERROR
(
server
.
getLog
());
WOLF_ERROR
(
server
.
getLog
());
return
nullptr
;
return
nullptr
;
}
}
WOLF_
INFO
(
"YAML file validated!"
);
WOLF_
DEBUG
(
"YAML file validated!"
);
WOLF_DEBUG
(
server
.
getLog
());
WOLF_DEBUG
(
server
.
getLog
());
// Get param node
// Get param node
...
@@ -156,13 +156,13 @@ ProblemPtr Problem::autoSetup(YAML::Node _param_node, LoaderPtr _loader)
...
@@ -156,13 +156,13 @@ ProblemPtr Problem::autoSetup(YAML::Node _param_node, LoaderPtr _loader)
{
{
// PROBLEM ===============================================================================
// PROBLEM ===============================================================================
// structure and dimension
// structure and dimension
WOLF_
INFO
(
"Loading problem parameters..."
);
WOLF_
DEBUG
(
"Loading problem parameters..."
);
YAML
::
Node
problem_node
=
_param_node
[
"problem"
];
YAML
::
Node
problem_node
=
_param_node
[
"problem"
];
int
dim
=
problem_node
[
"dimension"
].
as
<
int
>
();
int
dim
=
problem_node
[
"dimension"
].
as
<
int
>
();
auto
problem
=
Problem
::
create
(
""
,
dim
,
_loader
);
auto
problem
=
Problem
::
create
(
""
,
dim
,
_loader
);
// Tree manager
// Tree manager
WOLF_
INFO
(
"Loading tree manager parameters..."
);
WOLF_
DEBUG
(
"Loading tree manager parameters..."
);
YAML
::
Node
tree_manager_node
=
problem_node
[
"tree_manager"
];
YAML
::
Node
tree_manager_node
=
problem_node
[
"tree_manager"
];
std
::
string
tree_manager_type
=
tree_manager_node
[
"type"
].
as
<
std
::
string
>
();
std
::
string
tree_manager_type
=
tree_manager_node
[
"type"
].
as
<
std
::
string
>
();
if
(
tree_manager_type
!=
"none"
and
tree_manager_type
!=
"None"
and
tree_manager_type
!=
"NONE"
)
if
(
tree_manager_type
!=
"none"
and
tree_manager_type
!=
"None"
and
tree_manager_type
!=
"NONE"
)
...
@@ -173,25 +173,23 @@ ProblemPtr Problem::autoSetup(YAML::Node _param_node, LoaderPtr _loader)
...
@@ -173,25 +173,23 @@ ProblemPtr Problem::autoSetup(YAML::Node _param_node, LoaderPtr _loader)
}
}
// First frame
// First frame
WOLF_INFO
(
"Loading problem first frame parameters..."
);
WOLF_DEBUG
(
"Loading problem first frame parameters..."
);
WOLF_INFO
(
problem_node
[
"first_frame"
]);
SpecStateComposite
priors
(
problem_node
[
"first_frame"
]);
SpecStateComposite
priors
(
problem_node
[
"first_frame"
]);
WOLF_INFO
(
priors
);
problem
->
setPriorOptions
(
priors
);
problem
->
setPriorOptions
(
priors
);
// SENSORS ===============================================================================
// SENSORS ===============================================================================
// load plugin if sensor is not registered
// load plugin if sensor is not registered
WOLF_
INFO
(
"Installing sensors..."
);
WOLF_
DEBUG
(
"Installing sensors..."
);
for
(
auto
sensor_n
:
_param_node
[
"sensors"
])
problem
->
installSensor
(
sensor_n
);
for
(
auto
sensor_n
:
_param_node
[
"sensors"
])
problem
->
installSensor
(
sensor_n
);
// PROCESSORS ===============================================================================
// PROCESSORS ===============================================================================
// load plugin if processor is not registered
// load plugin if processor is not registered
WOLF_
INFO
(
"Installing processors..."
);
WOLF_
DEBUG
(
"Installing processors..."
);
for
(
auto
processor_n
:
_param_node
[
"processors"
])
problem
->
installProcessor
(
processor_n
);
for
(
auto
processor_n
:
_param_node
[
"processors"
])
problem
->
installProcessor
(
processor_n
);
// MAP (optional) ===============================================================================
// MAP (optional) ===============================================================================
// Default MapBase
// Default MapBase
WOLF_
INFO
(
"Creating map..."
);
WOLF_
DEBUG
(
"Creating map..."
);
if
(
not
_param_node
[
"map"
])
if
(
not
_param_node
[
"map"
])
{
{
_param_node
[
"map"
][
"type"
]
=
"MapBase"
;
_param_node
[
"map"
][
"type"
]
=
"MapBase"
;
...
@@ -277,7 +275,7 @@ void Problem::loadPlugin(LoaderPtr _loader, const std::string& plugin_name)
...
@@ -277,7 +275,7 @@ void Problem::loadPlugin(LoaderPtr _loader, const std::string& plugin_name)
}
}
std
::
string
plugin
=
plugins_path
+
"libwolf"
+
plugin_name
+
lib_extension
;
std
::
string
plugin
=
plugins_path
+
"libwolf"
+
plugin_name
+
lib_extension
;
WOLF_
TRACE
(
"Loading plugin "
+
plugin_name
+
" in "
+
plugins_path
);
WOLF_
DEBUG
(
"Loading plugin "
+
plugin_name
+
" in "
+
plugins_path
);
_loader
->
load
(
plugin
);
_loader
->
load
(
plugin
);
}
}
...
...
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