Skip to content
Snippets Groups Projects
Commit 01b388c7 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

plugin also for tree_manager

parent 33525d57
No related branches found
No related tags found
1 merge request!418Resolve "Map factory"
Pipeline #6659 failed
...@@ -186,6 +186,7 @@ SET(HDRS_TRAJECTORY ...@@ -186,6 +186,7 @@ SET(HDRS_TRAJECTORY
include/core/trajectory/trajectory_base.h include/core/trajectory/trajectory_base.h
) )
SET(HDRS_MAP SET(HDRS_MAP
include/core/map/factory_map.h
include/core/map/map_base.h include/core/map/map_base.h
) )
SET(HDRS_FRAME SET(HDRS_FRAME
......
...@@ -170,11 +170,38 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server) ...@@ -170,11 +170,38 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server)
procesorMap.insert(std::pair<std::string, ProcessorBasePtr>(prc["name"], problem->installProcessor(prc["type"], prc["name"], prc["sensor_name"], _server))); procesorMap.insert(std::pair<std::string, ProcessorBasePtr>(prc["name"], problem->installProcessor(prc["type"], prc["name"], prc["sensor_name"], _server)));
} }
// Map
std::string map_type = _server.getParam<std::string>("map/type");
WOLF_TRACE("Map Type: ", map_type);
std::string map_plugin = _server.getParam<std::string>("map/plugin");
if (map_plugin != "core" and map_plugin != "wolf")
{
std::string plugin = plugins_path + "libwolf" + map_plugin + lib_extension;
WOLF_TRACE("Loading plugin " + plugin);
auto l = new LoaderRaw(plugin);
l->load();
loaders.push_back(l);
}
auto map = AutoConfFactoryMap::create(map_type, _server);
map->setProblem(problem);
problem->setMap(map);
// Tree manager // Tree manager
std::string tree_manager_type = _server.getParam<std::string>("problem/tree_manager/type"); std::string tree_manager_type = _server.getParam<std::string>("problem/tree_manager/type");
WOLF_TRACE("Tree Manager Type: ", tree_manager_type); WOLF_TRACE("Tree Manager Type: ", tree_manager_type);
if (tree_manager_type != "None" and tree_manager_type != "none") if (tree_manager_type != "None" and tree_manager_type != "none")
{
std::string tm_plugin = _server.getParam<std::string>("problem/tree_manager/plugin");
if (tm_plugin != "core" and tm_plugin != "wolf")
{
std::string plugin = plugins_path + "libwolf" + tm_plugin + lib_extension;
WOLF_TRACE("Loading plugin " + plugin);
auto l = new LoaderRaw(plugin);
l->load();
loaders.push_back(l);
}
problem->setTreeManager(AutoConfFactoryTreeManager::create(tree_manager_type, "tree manager", _server)); problem->setTreeManager(AutoConfFactoryTreeManager::create(tree_manager_type, "tree manager", _server));
}
// Prior // Prior
std::string prior_mode = _server.getParam<std::string>("problem/prior/mode"); std::string prior_mode = _server.getParam<std::string>("problem/prior/mode");
...@@ -199,18 +226,6 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server) ...@@ -199,18 +226,6 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server)
_server.getParam<VectorComposite>("problem/prior/state")); _server.getParam<VectorComposite>("problem/prior/state"));
} }
// Map
std::string map_type = _server.getParam<std::string>("map/type");
WOLF_TRACE("Map Type: ", map_type);
auto map = AutoConfFactoryMap::create(map_type, _server);
WOLF_INFO("Map created");
WOLF_INFO_COND(problem->getMap() == nullptr, "Problem map is nullptr");
WOLF_INFO_COND(problem->getMap() != nullptr, "Problem map is OK");
map->setProblem(problem);
WOLF_INFO("Map problem set");
problem->setMap(map);
WOLF_INFO("Problem map set");
// Done // Done
return problem; return problem;
} }
......
...@@ -14,7 +14,8 @@ config: ...@@ -14,7 +14,8 @@ config:
tree_manager: tree_manager:
type: "None" type: "None"
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
...@@ -17,9 +17,11 @@ config: ...@@ -17,9 +17,11 @@ config:
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "TreeManagerDummy" type: "TreeManagerDummy"
plugin: "core"
toy_param: 0 toy_param: 0
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
...@@ -15,10 +15,11 @@ config: ...@@ -15,10 +15,11 @@ config:
O: [0.31, 0.31, 0.31] O: [0.31, 0.31, 0.31]
V: [0.31, 0.31, 0.31] V: [0.31, 0.31, 0.31]
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "None" type: "None"
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
...@@ -13,11 +13,13 @@ config: ...@@ -13,11 +13,13 @@ config:
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "TreeManagerSlidingWindow" type: "TreeManagerSlidingWindow"
plugin: "core"
n_frames: 3 n_frames: 3
n_fix_first_frames: 2 n_fix_first_frames: 2
viral_remove_empty_parent: true viral_remove_empty_parent: true
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
...@@ -13,11 +13,13 @@ config: ...@@ -13,11 +13,13 @@ config:
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "TreeManagerSlidingWindow" type: "TreeManagerSlidingWindow"
plugin: "core"
n_frames: 3 n_frames: 3
n_fix_first_frames: 0 n_fix_first_frames: 0
viral_remove_empty_parent: false viral_remove_empty_parent: false
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
...@@ -13,6 +13,7 @@ config: ...@@ -13,6 +13,7 @@ config:
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "TreeManagerSlidingWindowDualRate" type: "TreeManagerSlidingWindowDualRate"
plugin: "core"
n_frames: 5 n_frames: 5
n_frames_recent: 3 n_frames_recent: 3
rate_old_frames: 2 rate_old_frames: 2
...@@ -20,3 +21,4 @@ config: ...@@ -20,3 +21,4 @@ config:
viral_remove_empty_parent: true viral_remove_empty_parent: true
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
...@@ -13,6 +13,7 @@ config: ...@@ -13,6 +13,7 @@ config:
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "TreeManagerSlidingWindowDualRate" type: "TreeManagerSlidingWindowDualRate"
plugin: "core"
n_frames: 5 n_frames: 5
n_frames_recent: 3 n_frames_recent: 3
rate_old_frames: 2 rate_old_frames: 2
...@@ -20,3 +21,4 @@ config: ...@@ -20,3 +21,4 @@ config:
viral_remove_empty_parent: false viral_remove_empty_parent: false
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
...@@ -19,6 +19,7 @@ config: ...@@ -19,6 +19,7 @@ config:
time_tolerance: 0.1 time_tolerance: 0.1
tree_manager: tree_manager:
type: "TreeManagerSlidingWindowDualRate" type: "TreeManagerSlidingWindowDualRate"
plugin: "core"
n_frames: 5 n_frames: 5
n_frames_recent: 3 n_frames_recent: 3
rate_old_frames: 2 rate_old_frames: 2
...@@ -26,6 +27,7 @@ config: ...@@ -26,6 +27,7 @@ config:
viral_remove_empty_parent: true viral_remove_empty_parent: true
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
...@@ -20,6 +20,7 @@ config: ...@@ -20,6 +20,7 @@ config:
type: "None" type: "None"
map: map:
type: "MapBase" type: "MapBase"
plugin: "core"
sensors: sensors:
- -
type: "SensorOdom3d" type: "SensorOdom3d"
......
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