Skip to content
Snippets Groups Projects
Commit b37b0a96 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Rename getSensor(sensor name) --> findSensor(sensor name)

parent 29962e6d
No related branches found
No related tags found
1 merge request!447new tag
This commit is part of merge request !447. Comments created here will be created in the context of that merge request.
...@@ -138,8 +138,8 @@ int main() ...@@ -138,8 +138,8 @@ int main()
SolverManagerPtr ceres = FactorySolver::create("SolverCeres", problem, server); SolverManagerPtr ceres = FactorySolver::create("SolverCeres", problem, server);
// recover sensor pointers and other stuff for later use (access by sensor name) // recover sensor pointers and other stuff for later use (access by sensor name)
SensorBasePtr sensor_odo = problem->getSensor("sen odom"); SensorBasePtr sensor_odo = problem->findSensor("sen odom");
SensorBasePtr sensor_rb = problem->getSensor("sen rb"); SensorBasePtr sensor_rb = problem->findSensor("sen rb");
// APPLY PRIOR and SET PROCESSOR ODOM ORIGIN =================================================== // APPLY PRIOR and SET PROCESSOR ODOM ORIGIN ===================================================
TimeStamp t(0.0); TimeStamp t(0.0);
......
...@@ -151,7 +151,7 @@ class Problem : public std::enable_shared_from_this<Problem> ...@@ -151,7 +151,7 @@ class Problem : public std::enable_shared_from_this<Problem>
/** \brief get a sensor pointer by its name /** \brief get a sensor pointer by its name
* \param _sensor_name The sensor name, as it was installed with installSensor() * \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 /** \brief Factory method to install (create, and add to sensor) processors only from its properties
* *
......
...@@ -300,7 +300,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // ...@@ -300,7 +300,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, //
const std::string& _corresponding_sensor_name, // const std::string& _corresponding_sensor_name, //
const std::string& _params_filename) const std::string& _params_filename)
{ {
SensorBasePtr sen_ptr = getSensor(_corresponding_sensor_name); SensorBasePtr sen_ptr = findSensor(_corresponding_sensor_name);
if (sen_ptr == nullptr) 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!"); 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 == "") if (_params_filename == "")
...@@ -318,7 +318,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, // ...@@ -318,7 +318,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, //
const std::string& _corresponding_sensor_name, // const std::string& _corresponding_sensor_name, //
const ParamsServer& _server) const ParamsServer& _server)
{ {
SensorBasePtr sen_ptr = getSensor(_corresponding_sensor_name); SensorBasePtr sen_ptr = findSensor(_corresponding_sensor_name);
if (sen_ptr == nullptr) 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!"); 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, // ...@@ -335,7 +335,7 @@ ProcessorBasePtr Problem::installProcessor(const std::string& _prc_type, //
return prc_ptr; 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(), auto sen_it = std::find_if(getHardware()->getSensorList().begin(),
getHardware()->getSensorList().end(), getHardware()->getSensorList().end(),
......
...@@ -1050,11 +1050,11 @@ TEST(TreeManagerSlidingWindowDualRate, slidingWindowWithProcessor) ...@@ -1050,11 +1050,11 @@ TEST(TreeManagerSlidingWindowDualRate, slidingWindowWithProcessor)
TimeStamp t(0.0); TimeStamp t(0.0);
double dt = 1; double dt = 1;
CaptureMotionPtr capture = std::make_shared<CaptureOdom3d>(t, CaptureMotionPtr capture = std::make_shared<CaptureOdom3d>(t,
problem->getSensor("odom"), problem->findSensor("odom"),
data, data,
data_cov); data_cov);
CaptureMotionPtr capture_bl = std::make_shared<CaptureOdom3d>(t, CaptureMotionPtr capture_bl = std::make_shared<CaptureOdom3d>(t,
problem_bl->getSensor("odom"), problem_bl->findSensor("odom"),
data, data,
data_cov); data_cov);
......
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