Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mobile_robotics/wolf_projects/wolf_lib/wolf
1 result
Show changes
Commits on Source (4)
......@@ -88,8 +88,6 @@ license_header:
build_and_test:bionic:
stage: build_and_test
image: labrobotica/wolf_deps:18.04
except:
- master
script:
- *build_and_test_definition
......@@ -97,8 +95,6 @@ build_and_test:bionic:
build_and_test:focal:
stage: build_and_test
image: labrobotica/wolf_deps:20.04
except:
- master
script:
- *build_and_test_definition
......
......@@ -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);
......
......@@ -151,7 +151,11 @@ 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 get a processor pointer by its name
* \param _processor_name The processor name, as it was installed with installProcessor()
*/
ProcessorBasePtr findProcessor(const std::string& _processor_name) const;
/** \brief Factory method to install (create, and add to sensor) processors only from its properties
*
......
......@@ -119,6 +119,8 @@ class TrackMatrix
FeatureBasePtr feature (const SizeStd& _track_id, CaptureBasePtr _cap) const;
CaptureBasePtr firstCapture(const SizeStd& _track_id) const;
list<size_t> trackIds() const;
// tracks across captures that belong to keyframe
Track trackAtKeyframes(size_t _track_id) const;
......
......@@ -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(),
......@@ -350,6 +350,16 @@ SensorBasePtr Problem::getSensor(const std::string& _sensor_name) const
return (*sen_it);
}
ProcessorBasePtr Problem::findProcessor(const std::string& _processor_name) const
{
for (const auto& sensor : getHardware()->getSensorList())
for (const auto& processor : sensor->getProcessorList())
if (processor->getName() == _processor_name)
return processor;
return nullptr;
}
FrameBasePtr Problem::emplaceFrame(const TimeStamp& _time_stamp, //
const StateStructure& _frame_structure, //
const SizeEigen _dim, //
......
......@@ -244,4 +244,14 @@ Track TrackMatrix::trackAtKeyframes(size_t _track_id) const
return Track();
}
list<size_t> TrackMatrix::trackIds() const
{
list<size_t> track_ids;
for (auto track : tracks_)
{
track_ids.push_back(track.first);
}
return track_ids;
}
}
......@@ -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);
......