diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h index 6b2e32db108077716f372deb7fc4b2fc4438a6c6..fdfb8a1052e4dabda74f7060c4e6c0128d6c29cd 100644 --- a/include/core/problem/problem.h +++ b/include/core/problem/problem.h @@ -61,7 +61,7 @@ class Problem : public std::enable_shared_from_this<Problem> public: static ProblemPtr create(const std::string& _frame_structure, SizeEigen _dim); // USE THIS AS A CONSTRUCTOR! - static ProblemPtr autoSetup(const std::string& _frame_structure, SizeEigen _dim, const std::string& _yaml_file); + static ProblemPtr autoSetup(const std::string& _yaml_file); virtual ~Problem(); // Properties ----------------------------------------- diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index e2275154806978e8d8850d4f658eebc0f6e0d84e..fa78a9e38aea5c2ba26cbd4ee3f5a54531dd6685 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -72,13 +72,15 @@ ProblemPtr Problem::create(const std::string& _frame_structure, SizeEigen _dim) p->setup(); return p->shared_from_this(); } -ProblemPtr Problem::autoSetup(const std::string& _frame_structure, SizeEigen _dim, const std::string& _yaml_file) +ProblemPtr Problem::autoSetup(const std::string& _yaml_file) { - auto p = Problem::create(_frame_structure, _dim); // string file = "/home/jcasals/catkin_ws/src/wolf_ros_wrapper/src/params.yaml"; parserYAML parser = parserYAML(_yaml_file); parser.parse(); paramsServer server = paramsServer(parser.getParams(), parser.sensorsSerialization(), parser.processorsSerialization()); + std::string frame_structure = server.getParam<std::string>("problem/frame structure", "PO"); + int dim = server.getParam<int>("problem/dimension", "2"); + auto p = Problem::create(frame_structure, dim); // cout << "PRINTING SERVER MAP" << endl; // server.print(); // cout << "-----------------------------------" << endl;