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

Use Problem::findProcessor()

parent 389a3989
No related branches found
No related tags found
2 merge requests!3After cmake and const refactor,!1Resolve "Publisher for visual odometry"
......@@ -113,28 +113,15 @@ PublisherVisionDebug::PublisherVisionDebug(const std::string &_unique_name,
throw std::runtime_error(
"PublisherVisionDebug: name of processor of type ProcessorVisualOdometry not provided");
for (auto sen : _problem->getHardware()->getSensorList())
{
for (auto proc : sen->getProcessorList())
{
if (proc->getName() == processor_name)
{
processor_vision_ = std::dynamic_pointer_cast<ProcessorVisualOdometry>(proc);
if (processor_vision_)
break; //
else
{
throw std::runtime_error(
"PublisherVisionDebug: processor " + processor_name + " is not of type ProcessorVisualOdometry");
break;
}
}
}
}
if (not processor_vision_)
auto proc = problem_->findProcessor(processor_name);
if (not proc)
throw std::runtime_error(
"PublisherVisionDebug: processor " + processor_name + " not found.");
processor_vision_ = std::dynamic_pointer_cast<ProcessorVisualOdometry>(proc);
if (not processor_vision_)
throw std::runtime_error(
"PublisherVisionDebug: processor " + processor_name + " is not of type ProcessorVisualOdometry");
}
void PublisherVisionDebug::initialize(ros::NodeHandle &nh, const std::string &topic)
......
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