From 9c2872dbf9b68ca5da0e566602aee7df08bfef64 Mon Sep 17 00:00:00 2001 From: jcasals <jcasals@iri.upc.edu> Date: Wed, 17 Jul 2019 12:46:00 +0200 Subject: [PATCH] Renamed paramsServer -> ParamsServer; parserYAML -> ParserYAML --- hello_wolf/processor_range_bearing.cpp | 2 +- hello_wolf/processor_range_bearing.h | 4 +- hello_wolf/sensor_range_bearing.cpp | 2 +- hello_wolf/sensor_range_bearing.h | 4 +- include/core/ceres_wrapper/ceres_manager.h | 2 +- include/core/common/params_base.h | 2 +- include/core/problem/problem.h | 6 +-- .../processor/autoconf_processor_factory.h | 2 +- include/core/processor/processor_base.h | 2 +- include/core/processor/processor_diff_drive.h | 2 +- include/core/processor/processor_motion.h | 2 +- include/core/processor/processor_odom_2D.h | 4 +- include/core/processor/processor_odom_3D.h | 2 +- include/core/processor/processor_tracker.h | 2 +- include/core/sensor/autoconf_sensor_factory.h | 2 +- include/core/sensor/sensor_diff_drive.h | 2 +- include/core/sensor/sensor_odom_2D.h | 4 +- include/core/sensor/sensor_odom_3D.h | 2 +- include/core/solver/solver_factory.h | 2 +- include/core/utils/params_server.hpp | 8 ++-- include/core/yaml/parser_yaml.hpp | 42 +++++++++---------- src/ceres_wrapper/ceres_manager.cpp | 2 +- src/problem/problem.cpp | 6 +-- src/processor/processor_odom_2D.cpp | 2 +- src/sensor/sensor_odom_2D.cpp | 2 +- test/dummy/processor_tracker_feature_dummy.h | 2 +- test/dummy/processor_tracker_landmark_dummy.h | 2 +- test/gtest_param_server.cpp | 6 +-- test/gtest_parser_yaml.cpp | 4 +- 29 files changed, 63 insertions(+), 63 deletions(-) diff --git a/hello_wolf/processor_range_bearing.cpp b/hello_wolf/processor_range_bearing.cpp index e63438750..7cf2c04fa 100644 --- a/hello_wolf/processor_range_bearing.cpp +++ b/hello_wolf/processor_range_bearing.cpp @@ -124,7 +124,7 @@ ProcessorBasePtr ProcessorRangeBearing::create(const std::string& _unique_name, } ProcessorBasePtr ProcessorRangeBearing::createAutoConf(const std::string& _unique_name, - const paramsServer& _server, + const ParamsServer& _server, const SensorBasePtr _sensor_ptr) { SensorRangeBearingPtr sensor_rb = std::static_pointer_cast<SensorRangeBearing>(_sensor_ptr); diff --git a/hello_wolf/processor_range_bearing.h b/hello_wolf/processor_range_bearing.h index be9159c30..ff99fddfb 100644 --- a/hello_wolf/processor_range_bearing.h +++ b/hello_wolf/processor_range_bearing.h @@ -26,7 +26,7 @@ struct ProcessorParamsRangeBearing : public ProcessorParamsBase { //DEFINED FOR COMPATIBILITY PURPOSES. TO BE REMOVED IN THE FUTURE. } - ProcessorParamsRangeBearing(std::string _unique_name, const paramsServer& _server): + ProcessorParamsRangeBearing(std::string _unique_name, const ParamsServer& _server): ProcessorParamsBase(_unique_name, _server) { // @@ -54,7 +54,7 @@ class ProcessorRangeBearing : public ProcessorBase const ProcessorParamsBasePtr _params, const SensorBasePtr sensor_ptr = nullptr); static ProcessorBasePtr createAutoConf(const std::string& _unique_name, - const paramsServer& _server, + const ParamsServer& _server, const SensorBasePtr _sensor_ptr = nullptr); protected: diff --git a/hello_wolf/sensor_range_bearing.cpp b/hello_wolf/sensor_range_bearing.cpp index 74f2c0e46..7be1171b9 100644 --- a/hello_wolf/sensor_range_bearing.cpp +++ b/hello_wolf/sensor_range_bearing.cpp @@ -43,7 +43,7 @@ SensorBasePtr SensorRangeBearing::create(const std::string& _unique_name, // } SensorBasePtr SensorRangeBearing::createAutoConf(const std::string& _unique_name, // - const paramsServer& _server) + const ParamsServer& _server) { Eigen::Vector2s noise_std(0.1,1.0); SensorRangeBearingPtr sensor = std::make_shared<SensorRangeBearing>(Eigen::Vector3s(1,1,0), noise_std); diff --git a/hello_wolf/sensor_range_bearing.h b/hello_wolf/sensor_range_bearing.h index 587259b40..f3ed332ff 100644 --- a/hello_wolf/sensor_range_bearing.h +++ b/hello_wolf/sensor_range_bearing.h @@ -23,7 +23,7 @@ struct IntrinsicsRangeBearing : public IntrinsicsBase { //DEFINED FOR COMPATIBILITY PURPOSES. TO BE REMOVED IN THE FUTURE. } - IntrinsicsRangeBearing(std::string _unique_name, const paramsServer& _server): + IntrinsicsRangeBearing(std::string _unique_name, const ParamsServer& _server): IntrinsicsBase(_unique_name, _server) { noise_range_metres_std = _server.getParam<Scalar>(_unique_name + "/noise_range_metres_std", "0.05"); @@ -49,7 +49,7 @@ class SensorRangeBearing : public SensorBase const Eigen::VectorXs& _extrinsics, // const IntrinsicsBasePtr _intrinsics); static SensorBasePtr createAutoConf(const std::string& _unique_name, // - const paramsServer& _server); + const ParamsServer& _server); }; } /* namespace wolf */ diff --git a/include/core/ceres_wrapper/ceres_manager.h b/include/core/ceres_wrapper/ceres_manager.h index 413ecce13..a31f5347c 100644 --- a/include/core/ceres_wrapper/ceres_manager.h +++ b/include/core/ceres_wrapper/ceres_manager.h @@ -46,7 +46,7 @@ class CeresManager : public SolverManager ~CeresManager(); - static SolverManagerPtr create(const ProblemPtr& wolf_problem, const paramsServer& _server); + static SolverManagerPtr create(const ProblemPtr& wolf_problem, const ParamsServer& _server); ceres::Solver::Summary getSummary(); diff --git a/include/core/common/params_base.h b/include/core/common/params_base.h index 66034e29f..ac9175668 100644 --- a/include/core/common/params_base.h +++ b/include/core/common/params_base.h @@ -7,7 +7,7 @@ namespace wolf { struct ParamsBase { ParamsBase() = default; - ParamsBase(std::string _unique_name, const paramsServer&) + ParamsBase(std::string _unique_name, const ParamsServer&) { // } diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h index 6aca54c5d..d1aaba40f 100644 --- a/include/core/problem/problem.h +++ b/include/core/problem/problem.h @@ -63,7 +63,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(paramsServer &_server); + static ProblemPtr autoSetup(ParamsServer &_server); virtual ~Problem(); // Properties ----------------------------------------- @@ -101,7 +101,7 @@ class Problem : public std::enable_shared_from_this<Problem> */ SensorBasePtr installSensor(const std::string& _sen_type, // const std::string& _unique_sensor_name, - const paramsServer& _server); + const ParamsServer& _server); /** \brief get a sensor pointer by its name * \param _sensor_name The sensor name, as it was installed with installSensor() */ @@ -141,7 +141,7 @@ class Problem : public std::enable_shared_from_this<Problem> ProcessorBasePtr installProcessor(const std::string& _prc_type, // const std::string& _unique_processor_name, // const std::string& _corresponding_sensor_name, // - const paramsServer& _server); + const ParamsServer& _server); protected: /** \brief Set the processor motion * diff --git a/include/core/processor/autoconf_processor_factory.h b/include/core/processor/autoconf_processor_factory.h index 0fc1b5de4..051b8d857 100644 --- a/include/core/processor/autoconf_processor_factory.h +++ b/include/core/processor/autoconf_processor_factory.h @@ -167,7 +167,7 @@ namespace wolf typedef Factory<ProcessorBase, const std::string&, - const paramsServer&, + const ParamsServer&, const SensorBasePtr> AutoConfProcessorFactory; template<> inline std::string AutoConfProcessorFactory::getClass() diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h index b2027b3d3..3e555eb2e 100644 --- a/include/core/processor/processor_base.h +++ b/include/core/processor/processor_base.h @@ -176,7 +176,7 @@ struct ProcessorParamsBase : public ParamsBase { // } - ProcessorParamsBase(std::string _unique_name, const paramsServer& _server): + ProcessorParamsBase(std::string _unique_name, const ParamsServer& _server): ParamsBase(_unique_name, _server) { voting_active = _server.getParam<bool>(_unique_name + "/voting_active", "false"); diff --git a/include/core/processor/processor_diff_drive.h b/include/core/processor/processor_diff_drive.h index 78ef6ca50..831fec136 100644 --- a/include/core/processor/processor_diff_drive.h +++ b/include/core/processor/processor_diff_drive.h @@ -20,7 +20,7 @@ struct ProcessorParamsDiffDrive : public ProcessorParamsMotion { Scalar unmeasured_perturbation_std = 0.0001; ProcessorParamsDiffDrive() = default; - ProcessorParamsDiffDrive(std::string _unique_name, const paramsServer& _server): + ProcessorParamsDiffDrive(std::string _unique_name, const ParamsServer& _server): ProcessorParamsMotion(_unique_name, _server) { unmeasured_perturbation_std = _server.getParam<Scalar>(_unique_name + "/unmeasured_perturbation_std", "0.0001"); diff --git a/include/core/processor/processor_motion.h b/include/core/processor/processor_motion.h index 15f0ca900..c7fc1771f 100644 --- a/include/core/processor/processor_motion.h +++ b/include/core/processor/processor_motion.h @@ -30,7 +30,7 @@ struct ProcessorParamsMotion : public ProcessorParamsBase Scalar angle_turned = 0.5; Scalar unmeasured_perturbation_std = 1e-4; ProcessorParamsMotion() = default; - ProcessorParamsMotion(std::string _unique_name, const paramsServer& _server): + ProcessorParamsMotion(std::string _unique_name, const ParamsServer& _server): ProcessorParamsBase(_unique_name, _server) { max_time_span = _server.getParam<Scalar>(_unique_name + "/max_time_span", "0.5"); diff --git a/include/core/processor/processor_odom_2D.h b/include/core/processor/processor_odom_2D.h index 37d6c9ee1..5bb0732f9 100644 --- a/include/core/processor/processor_odom_2D.h +++ b/include/core/processor/processor_odom_2D.h @@ -23,7 +23,7 @@ struct ProcessorParamsOdom2D : public ProcessorParamsMotion { Scalar cov_det = 1.0; // 1 rad^2 ProcessorParamsOdom2D() = default; - ProcessorParamsOdom2D(std::string _unique_name, const wolf::paramsServer & _server): + ProcessorParamsOdom2D(std::string _unique_name, const wolf::ParamsServer & _server): ProcessorParamsMotion(_unique_name, _server) { cov_det = _server.getParam<Scalar>(_unique_name + "/cov_det", "1.0"); @@ -91,7 +91,7 @@ class ProcessorOdom2D : public ProcessorMotion // Factory method public: static ProcessorBasePtr create(const std::string& _unique_name, const ProcessorParamsBasePtr _params, const SensorBasePtr sensor_ptr = nullptr); - static ProcessorBasePtr createAutoConf(const std::string& _unique_name, const paramsServer& _server, const SensorBasePtr sensor_ptr = nullptr); + static ProcessorBasePtr createAutoConf(const std::string& _unique_name, const ParamsServer& _server, const SensorBasePtr sensor_ptr = nullptr); }; inline Eigen::VectorXs ProcessorOdom2D::deltaZero() const diff --git a/include/core/processor/processor_odom_3D.h b/include/core/processor/processor_odom_3D.h index 1c70a3b33..759912f27 100644 --- a/include/core/processor/processor_odom_3D.h +++ b/include/core/processor/processor_odom_3D.h @@ -22,7 +22,7 @@ WOLF_STRUCT_PTR_TYPEDEFS(ProcessorParamsOdom3D); struct ProcessorParamsOdom3D : public ProcessorParamsMotion { ProcessorParamsOdom3D() = default; - ProcessorParamsOdom3D(std::string _unique_name, const paramsServer& _server): + ProcessorParamsOdom3D(std::string _unique_name, const ParamsServer& _server): ProcessorParamsMotion(_unique_name, _server) { // diff --git a/include/core/processor/processor_tracker.h b/include/core/processor/processor_tracker.h index bab37b3a2..3915ba33f 100644 --- a/include/core/processor/processor_tracker.h +++ b/include/core/processor/processor_tracker.h @@ -21,7 +21,7 @@ struct ProcessorParamsTracker : public ProcessorParamsBase int max_new_features; ///< maximum nbr. of new features to be processed when adding a keyframe (-1: unlimited. 0: none.) ProcessorParamsTracker() = default; - ProcessorParamsTracker(std::string _unique_name, const wolf::paramsServer & _server): + ProcessorParamsTracker(std::string _unique_name, const wolf::ParamsServer & _server): ProcessorParamsBase(_unique_name, _server) { min_features_for_keyframe = _server.getParam<unsigned int>(_unique_name + "/min_features_for_keyframe", "1"); diff --git a/include/core/sensor/autoconf_sensor_factory.h b/include/core/sensor/autoconf_sensor_factory.h index e52366e33..2d3630787 100644 --- a/include/core/sensor/autoconf_sensor_factory.h +++ b/include/core/sensor/autoconf_sensor_factory.h @@ -210,7 +210,7 @@ namespace wolf typedef Factory<SensorBase, const std::string&, - const paramsServer&> AutoConfSensorFactory; + const ParamsServer&> AutoConfSensorFactory; template<> inline std::string AutoConfSensorFactory::getClass() diff --git a/include/core/sensor/sensor_diff_drive.h b/include/core/sensor/sensor_diff_drive.h index 114be0e4d..e67374380 100644 --- a/include/core/sensor/sensor_diff_drive.h +++ b/include/core/sensor/sensor_diff_drive.h @@ -38,7 +38,7 @@ struct IntrinsicsDiffDrive : public IntrinsicsBase { //DEFINED FOR COMPATIBILITY PURPOSES. TO BE REMOVED IN THE FUTURE. } - IntrinsicsDiffDrive(std::string _unique_name, const paramsServer& _server): + IntrinsicsDiffDrive(std::string _unique_name, const ParamsServer& _server): IntrinsicsBase(_unique_name, _server) { diff --git a/include/core/sensor/sensor_odom_2D.h b/include/core/sensor/sensor_odom_2D.h index 94bbd03d3..efe8d7e4d 100644 --- a/include/core/sensor/sensor_odom_2D.h +++ b/include/core/sensor/sensor_odom_2D.h @@ -19,7 +19,7 @@ struct IntrinsicsOdom2D : public IntrinsicsBase { //DEFINED FOR COMPATIBILITY PURPOSES. TO BE REMOVED IN THE FUTURE. } - IntrinsicsOdom2D(std::string _unique_name, const paramsServer& _server): + IntrinsicsOdom2D(std::string _unique_name, const ParamsServer& _server): IntrinsicsBase(_unique_name, _server) { k_disp_to_disp = _server.getParam<Scalar>(_unique_name + "/k_disp_to_disp"); @@ -63,7 +63,7 @@ class SensorOdom2D : public SensorBase public: static SensorBasePtr create(const std::string& _unique_name, const Eigen::VectorXs& _extrinsics_pq, const IntrinsicsBasePtr _intrinsics); - static SensorBasePtr createAutoConf(const std::string& _unique_name, const paramsServer& _server); + static SensorBasePtr createAutoConf(const std::string& _unique_name, const ParamsServer& _server); }; diff --git a/include/core/sensor/sensor_odom_3D.h b/include/core/sensor/sensor_odom_3D.h index b5ec6717f..2fab5f065 100644 --- a/include/core/sensor/sensor_odom_3D.h +++ b/include/core/sensor/sensor_odom_3D.h @@ -27,7 +27,7 @@ struct IntrinsicsOdom3D : public IntrinsicsBase { //DEFINED FOR COMPATIBILITY PURPOSES. TO BE REMOVED IN THE FUTURE. } - IntrinsicsOdom3D(std::string _unique_name, const paramsServer& _server): + IntrinsicsOdom3D(std::string _unique_name, const ParamsServer& _server): IntrinsicsBase(_unique_name, _server) { k_disp_to_disp = _server.getParam<Scalar>(_unique_name + "/k_disp_to_disp"); diff --git a/include/core/solver/solver_factory.h b/include/core/solver/solver_factory.h index 36a551b66..5205ad5c9 100644 --- a/include/core/solver/solver_factory.h +++ b/include/core/solver/solver_factory.h @@ -211,7 +211,7 @@ namespace wolf typedef Factory<SolverManager, const ProblemPtr&, - const paramsServer&> SolverFactory; + const ParamsServer&> SolverFactory; template<> inline std::string SolverFactory::getClass() diff --git a/include/core/utils/params_server.hpp b/include/core/utils/params_server.hpp index 74fb8f3e7..34d2f8734 100644 --- a/include/core/utils/params_server.hpp +++ b/include/core/utils/params_server.hpp @@ -5,7 +5,7 @@ #include <map> #include "core/utils/converter.h" namespace wolf{ -class paramsServer{ +class ParamsServer{ struct ParamsInitSensor{ std::string _type; std::string _name; @@ -19,12 +19,12 @@ class paramsServer{ std::map<std::string,ParamsInitSensor> _paramsSens; std::map<std::string,ParamsInitProcessor> _paramsProc; public: - paramsServer(){ + ParamsServer(){ _params = std::map<std::string, std::string>(); _paramsSens = std::map<std::string,ParamsInitSensor>(); _paramsProc = std::map<std::string,ParamsInitProcessor>(); } - paramsServer(std::map<std::string, std::string> params, + ParamsServer(std::map<std::string, std::string> params, std::vector<std::array<std::string,2>> sensors, std::vector<std::array<std::string,3>> procs){ _params = params; @@ -39,7 +39,7 @@ public: _paramsProc.insert(std::pair<std::string,ParamsInitProcessor>(it.at(1), pProcs)); } } - ~paramsServer(){ + ~ParamsServer(){ // } void print(){ diff --git a/include/core/yaml/parser_yaml.hpp b/include/core/yaml/parser_yaml.hpp index dbbba4103..226d3cca1 100644 --- a/include/core/yaml/parser_yaml.hpp +++ b/include/core/yaml/parser_yaml.hpp @@ -75,7 +75,7 @@ namespace { return "[" + accumulated + "]"; } } -class parserYAML { +class ParserYAML { struct ParamsInitSensor{ std::string _type; std::string _name; @@ -99,7 +99,7 @@ class parserYAML { YAML::Node problem; std::string generatePath(std::string); public: - parserYAML(){ + ParserYAML(){ _params = std::map<std::string, std::string>(); _active_name = ""; _paramsSens = std::vector<ParamsInitSensor>(); @@ -110,7 +110,7 @@ public: _relative_path = false; _callbacks = std::vector<std::array<std::string, 3>>(); } - parserYAML(std::string file){ + ParserYAML(std::string file){ _params = std::map<std::string, std::string>(); _active_name = ""; _paramsSens = std::vector<ParamsInitSensor>(); @@ -121,7 +121,7 @@ public: _relative_path = false; _callbacks = std::vector<std::array<std::string, 3>>(); } - parserYAML(std::string file, std::string path_root){ + ParserYAML(std::string file, std::string path_root){ _params = std::map<std::string, std::string>(); _active_name = ""; _paramsSens = std::vector<ParamsInitSensor>(); @@ -138,7 +138,7 @@ public: } _callbacks = std::vector<std::array<std::string, 3>>(); } - ~parserYAML(){ + ~ParserYAML(){ // } void walkTree(std::string file); @@ -157,7 +157,7 @@ public: void parse(); std::map<std::string, std::string> fetchAsMap(YAML::Node); }; -std::string parserYAML::generatePath(std::string path){ +std::string ParserYAML::generatePath(std::string path){ std::regex r("^/.*"); if(std::regex_match(path, r)){ std::cout << "Generating " + path << std::endl; @@ -167,25 +167,25 @@ std::string parserYAML::generatePath(std::string path){ return _path_root + path; } } -std::string parserYAML::tagsToString(std::vector<std::string> &tags){ +std::string ParserYAML::tagsToString(std::vector<std::string> &tags){ std::string hdr = ""; for(auto it : tags){ hdr = hdr + "/" + it; } return hdr; } -void parserYAML::walkTree(std::string file){ +void ParserYAML::walkTree(std::string file){ YAML::Node n; n = YAML::LoadFile(generatePath(file)); std::vector<std::string> hdrs = std::vector<std::string>(); walkTreeR(n, hdrs, ""); } -void parserYAML::walkTree(std::string file, std::vector<std::string>& tags){ +void ParserYAML::walkTree(std::string file, std::vector<std::string>& tags){ YAML::Node n; n = YAML::LoadFile(generatePath(file)); walkTreeR(n, tags, ""); } -void parserYAML::walkTree(std::string file, std::vector<std::string>& tags, std::string hdr){ +void ParserYAML::walkTree(std::string file, std::vector<std::string>& tags, std::string hdr){ YAML::Node n; n = YAML::LoadFile(generatePath(file)); walkTreeR(n, tags, hdr); @@ -195,7 +195,7 @@ void parserYAML::walkTree(std::string file, std::vector<std::string>& tags, std: * @param tags represents the path from the root of the YAML tree to the current node * @param hdr is the name of the current YAML node */ -void parserYAML::walkTreeR(YAML::Node n, std::vector<std::string>& tags, std::string hdr){ +void ParserYAML::walkTreeR(YAML::Node n, std::vector<std::string>& tags, std::string hdr){ switch (n.Type()) { case YAML::NodeType::Scalar : { std::regex r("^@.*"); @@ -276,13 +276,13 @@ void parserYAML::walkTreeR(YAML::Node n, std::vector<std::string>& tags, std::st break; } } -void parserYAML::updateActiveName(std::string tag){ +void ParserYAML::updateActiveName(std::string tag){ this->_active_name = tag; } /** @Brief Parse the sensors, processors, callbacks and files elements of the YAML file. We assume that these elements are defined at the top level of the YAML file. * @param file is the path to the YAML file */ -void parserYAML::parseFirstLevel(std::string file){ +void ParserYAML::parseFirstLevel(std::string file){ YAML::Node n; n = YAML::LoadFile(generatePath(file)); @@ -306,32 +306,32 @@ void parserYAML::parseFirstLevel(std::string file){ } _params.insert(std::pair<std::string,std::string>("files", wolf::converter<std::string>::convert(_files))); } -std::vector<std::array<std::string, 2>> parserYAML::sensorsSerialization(){ +std::vector<std::array<std::string, 2>> ParserYAML::sensorsSerialization(){ std::vector<std::array<std::string, 2>> aux = std::vector<std::array<std::string, 2>>(); for(auto it : this->_paramsSens) aux.push_back({{it._type,it._name}}); return aux; } -std::vector<std::array<std::string, 3>> parserYAML::processorsSerialization(){ +std::vector<std::array<std::string, 3>> ParserYAML::processorsSerialization(){ std::vector<std::array<std::string, 3>> aux = std::vector<std::array<std::string, 3>>(); for(auto it : this->_paramsProc) aux.push_back({{it._type,it._name,it._name_assoc_sensor}}); return aux; } -std::vector<std::string> parserYAML::getFiles(){ +std::vector<std::string> ParserYAML::getFiles(){ return this->_files; } -std::vector<std::array<std::string, 3>> parserYAML::getCallbacks(){ +std::vector<std::array<std::string, 3>> ParserYAML::getCallbacks(){ return this->_callbacks; } -std::vector<std::array<std::string, 2>> parserYAML::getProblem(){ +std::vector<std::array<std::string, 2>> ParserYAML::getProblem(){ return std::vector<std::array<std::string, 2>>(); } -std::map<std::string,std::string> parserYAML::getParams(){ +std::map<std::string,std::string> ParserYAML::getParams(){ std::map<std::string,std::string> rtn = _params; return rtn; } -void parserYAML::parse(){ +void ParserYAML::parse(){ this->parseFirstLevel(this->_file); if(this->problem.Type() != YAML::NodeType::Undefined){ @@ -373,7 +373,7 @@ std::string fetchMapEntry(YAML::Node n){ * @param n the node representing a map * @return std::map<std::string, std::string> populated with the key,value pairs in n */ -std::map<std::string, std::string> parserYAML::fetchAsMap(YAML::Node n){ +std::map<std::string, std::string> ParserYAML::fetchAsMap(YAML::Node n){ assert(n.Type() == YAML::NodeType::Map && "trying to fetch as Map a non-Map node"); auto m = std::map<std::string, std::string>(); for(const auto& kv : n){ diff --git a/src/ceres_wrapper/ceres_manager.cpp b/src/ceres_wrapper/ceres_manager.cpp index 681f3d59e..1528c15e7 100644 --- a/src/ceres_wrapper/ceres_manager.cpp +++ b/src/ceres_wrapper/ceres_manager.cpp @@ -40,7 +40,7 @@ CeresManager::~CeresManager() removeFactor(fac_2_residual_idx_.begin()->first); } -SolverManagerPtr CeresManager::create(const ProblemPtr &wolf_problem, const paramsServer &_server) +SolverManagerPtr CeresManager::create(const ProblemPtr &wolf_problem, const ParamsServer &_server) { ceres::Solver::Options opt; opt.max_num_iterations = _server.getParam<int>("max_num_iterations","1000"); diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index daca9ba3a..4565bb622 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -73,7 +73,7 @@ ProblemPtr Problem::create(const std::string& _frame_structure, SizeEigen _dim) p->setup(); return p->shared_from_this(); } -ProblemPtr Problem::autoSetup(paramsServer &_server) +ProblemPtr Problem::autoSetup(ParamsServer &_server) { std::string frame_structure = _server.getParam<std::string>("problem/frame structure", "PO"); int dim = _server.getParam<int>("problem/dimension", "2"); @@ -143,7 +143,7 @@ SensorBasePtr Problem::installSensor(const std::string& _sen_type, // SensorBasePtr Problem::installSensor(const std::string& _sen_type, // const std::string& _unique_sensor_name, // - const paramsServer& _server) + const ParamsServer& _server) { SensorBasePtr sen_ptr = AutoConfSensorFactory::get().create(uppercase(_sen_type), _unique_sensor_name, _server); sen_ptr->link(getHardware()); @@ -198,7 +198,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // const std::string& _unique_processor_name, // const std::string& _corresponding_sensor_name, // - const paramsServer& _server) + const ParamsServer& _server) { SensorBasePtr sen_ptr = getSensor(_corresponding_sensor_name); if (sen_ptr == nullptr) diff --git a/src/processor/processor_odom_2D.cpp b/src/processor/processor_odom_2D.cpp index 38dccacd9..48a274778 100644 --- a/src/processor/processor_odom_2D.cpp +++ b/src/processor/processor_odom_2D.cpp @@ -195,7 +195,7 @@ ProcessorBasePtr ProcessorOdom2D::create(const std::string& _unique_name, const return prc_ptr; } -ProcessorBasePtr ProcessorOdom2D::createAutoConf(const std::string& _unique_name, const paramsServer& _server, const SensorBasePtr sensor_ptr) +ProcessorBasePtr ProcessorOdom2D::createAutoConf(const std::string& _unique_name, const ParamsServer& _server, const SensorBasePtr sensor_ptr) { ProcessorOdom2DPtr prc_ptr; diff --git a/src/sensor/sensor_odom_2D.cpp b/src/sensor/sensor_odom_2D.cpp index f6b408c7e..fd4427abe 100644 --- a/src/sensor/sensor_odom_2D.cpp +++ b/src/sensor/sensor_odom_2D.cpp @@ -58,7 +58,7 @@ SensorBasePtr SensorOdom2D::create(const std::string& _unique_name, const Eigen: return odo; } -SensorBasePtr SensorOdom2D::createAutoConf(const std::string& _unique_name, const paramsServer& _server) +SensorBasePtr SensorOdom2D::createAutoConf(const std::string& _unique_name, const ParamsServer& _server) { // Eigen::VectorXs _extrinsics_po = Eigen::Vector3s(0,0,0); Eigen::VectorXs _extrinsics_po = _server.getParam<Eigen::VectorXs>(_unique_name + "/extrinsic/pos", "[0,0,0]"); diff --git a/test/dummy/processor_tracker_feature_dummy.h b/test/dummy/processor_tracker_feature_dummy.h index 3621ce301..217196b7e 100644 --- a/test/dummy/processor_tracker_feature_dummy.h +++ b/test/dummy/processor_tracker_feature_dummy.h @@ -22,7 +22,7 @@ struct ProcessorParamsTrackerFeatureDummy : public ProcessorParamsTrackerFeature unsigned int n_tracks_lost; ///< number of tracks lost each time track is called (the first ones) ProcessorParamsTrackerFeatureDummy() = default; - ProcessorParamsTrackerFeatureDummy(std::string _unique_name, const wolf::paramsServer & _server): + ProcessorParamsTrackerFeatureDummy(std::string _unique_name, const wolf::ParamsServer & _server): ProcessorParamsTrackerFeature(_unique_name, _server) { n_tracks_lost = _server.getParam<unsigned int>(_unique_name + "/n_tracks_lost", "1"); diff --git a/test/dummy/processor_tracker_landmark_dummy.h b/test/dummy/processor_tracker_landmark_dummy.h index 7dce7d14e..f79b2da40 100644 --- a/test/dummy/processor_tracker_landmark_dummy.h +++ b/test/dummy/processor_tracker_landmark_dummy.h @@ -20,7 +20,7 @@ struct ProcessorParamsTrackerLandmarkDummy : public ProcessorParamsTrackerLandma unsigned int n_landmarks_lost; ///< number of landmarks lost each time findLandmarks is called (the last ones) ProcessorParamsTrackerLandmarkDummy() = default; - ProcessorParamsTrackerLandmarkDummy(std::string _unique_name, const wolf::paramsServer & _server): + ProcessorParamsTrackerLandmarkDummy(std::string _unique_name, const wolf::ParamsServer & _server): ProcessorParamsTrackerLandmark(_unique_name, _server) { n_landmarks_lost = _server.getParam<unsigned int>(_unique_name + "/n_landmarks_lost", "1"); diff --git a/test/gtest_param_server.cpp b/test/gtest_param_server.cpp index dc5f5a5aa..00c6c099f 100644 --- a/test/gtest_param_server.cpp +++ b/test/gtest_param_server.cpp @@ -9,9 +9,9 @@ using namespace wolf; std::string wolf_root = _WOLF_ROOT_DIR; -parserYAML parse(string _file, string _path_root) +ParserYAML parse(string _file, string _path_root) { - parserYAML parser = parserYAML(_file, _path_root); + ParserYAML parser = ParserYAML(_file, _path_root); parser.parse(); return parser; } @@ -20,7 +20,7 @@ TEST(ParamsServer, Default) { auto parser = parse("test/yaml/params1.yaml", wolf_root); auto params = parser.getParams(); - paramsServer server = paramsServer(params, parser.sensorsSerialization(), parser.processorsSerialization()); + ParamsServer server = ParamsServer(params, parser.sensorsSerialization(), parser.processorsSerialization()); EXPECT_EQ(server.getParam<double>("should_not_exist", "2.6"), 2.6); EXPECT_EQ(server.getParam<bool>("my_proc_test/voting_active", "true"), false); EXPECT_NE(server.getParam<unsigned int>("my_proc_test/time_tolerance", "23"), 23); diff --git a/test/gtest_parser_yaml.cpp b/test/gtest_parser_yaml.cpp index d3ba3a405..5102157d0 100644 --- a/test/gtest_parser_yaml.cpp +++ b/test/gtest_parser_yaml.cpp @@ -8,9 +8,9 @@ using namespace wolf; std::string wolf_root = _WOLF_ROOT_DIR; -parserYAML parse(string _file, string _path_root) +ParserYAML parse(string _file, string _path_root) { - parserYAML parser = parserYAML(_file, _path_root); + ParserYAML parser = ParserYAML(_file, _path_root); parser.parse(); return parser; } -- GitLab