diff --git a/demos/hello_wolf/hello_wolf_autoconf.cpp b/demos/hello_wolf/hello_wolf_autoconf.cpp index db934ca13174443de5053e3a427206de41799c18..27214245096f91fefad1351f611613516010f40a 100644 --- a/demos/hello_wolf/hello_wolf_autoconf.cpp +++ b/demos/hello_wolf/hello_wolf_autoconf.cpp @@ -138,8 +138,8 @@ int main() SolverManagerPtr ceres = FactorySolver::create("SolverCeres", problem, server); // recover sensor pointers and other stuff for later use (access by sensor name) - SensorBasePtr sensor_odo = problem->getSensor("sen odom"); - SensorBasePtr sensor_rb = problem->getSensor("sen rb"); + SensorBasePtr sensor_odo = problem->findSensor("sen odom"); + SensorBasePtr sensor_rb = problem->findSensor("sen rb"); // APPLY PRIOR and SET PROCESSOR ODOM ORIGIN =================================================== TimeStamp t(0.0); diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h index 7405ae8320deb339ed6efdfe7319b4df8ec14cff..d85a6503b1a0e544c26d358d5444036b7980b612 100644 --- a/include/core/problem/problem.h +++ b/include/core/problem/problem.h @@ -151,7 +151,7 @@ class Problem : public std::enable_shared_from_this<Problem> /** \brief get a sensor pointer by its name * \param _sensor_name The sensor name, as it was installed with installSensor() */ - SensorBasePtr getSensor(const std::string& _sensor_name) const; + SensorBasePtr findSensor(const std::string& _sensor_name) const; /** \brief Factory method to install (create, and add to sensor) processors only from its properties * diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 1e5c88a2db6cf68a2032c8be1b50dbbe3c2206d9..3c731dc3ebab4c1c84ada15929a06166a77c9852 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -300,7 +300,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // const std::string& _corresponding_sensor_name, // const std::string& _params_filename) { - SensorBasePtr sen_ptr = getSensor(_corresponding_sensor_name); + SensorBasePtr sen_ptr = findSensor(_corresponding_sensor_name); if (sen_ptr == nullptr) throw std::runtime_error("Cannot bind processor. Reason: Sensor \"" + _corresponding_sensor_name + "\" not found. Check sensor name, it must match in sensor and processor!"); if (_params_filename == "") @@ -318,7 +318,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // const std::string& _corresponding_sensor_name, // const ParamsServer& _server) { - SensorBasePtr sen_ptr = getSensor(_corresponding_sensor_name); + SensorBasePtr sen_ptr = findSensor(_corresponding_sensor_name); if (sen_ptr == nullptr) throw std::runtime_error("Cannot bind processor. Reason: Sensor \"" + _corresponding_sensor_name + "\" not found. Check sensor name, it must match in sensor and processor!"); @@ -335,7 +335,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // return prc_ptr; } -SensorBasePtr Problem::getSensor(const std::string& _sensor_name) const +SensorBasePtr Problem::findSensor(const std::string& _sensor_name) const { auto sen_it = std::find_if(getHardware()->getSensorList().begin(), getHardware()->getSensorList().end(), diff --git a/test/gtest_tree_manager_sliding_window_dual_rate.cpp b/test/gtest_tree_manager_sliding_window_dual_rate.cpp index e394a7c59279bb4d0e52c94b7eef479406ce5797..448fc0d93d27e1db1ee76c6ae46223be81a3c505 100644 --- a/test/gtest_tree_manager_sliding_window_dual_rate.cpp +++ b/test/gtest_tree_manager_sliding_window_dual_rate.cpp @@ -1050,11 +1050,11 @@ TEST(TreeManagerSlidingWindowDualRate, slidingWindowWithProcessor) TimeStamp t(0.0); double dt = 1; CaptureMotionPtr capture = std::make_shared<CaptureOdom3d>(t, - problem->getSensor("odom"), + problem->findSensor("odom"), data, data_cov); CaptureMotionPtr capture_bl = std::make_shared<CaptureOdom3d>(t, - problem_bl->getSensor("odom"), + problem_bl->findSensor("odom"), data, data_cov);