Go to the documentation of this file.
17 #include <mrpt/core/Clock.h>
18 #include <mrpt/system/progress.h>
19 #include <mrpt/version.h>
31 if (yamlData.has(
"generators"))
34 yamlData[
"generators"], options.
verbosity);
38 std::cout <<
"[sm2mm] Warning: no generators defined in the pipeline, "
39 "using default generator."
42 auto defaultGen = mp2p_icp_filters::Generator::Create();
43 defaultGen->setMinLoggingLevel(options.
verbosity);
44 defaultGen->initialize({});
50 if (yamlData.has(
"filters"))
57 std::cout <<
"[sm2mm] Warning: no filters defined in the pipeline."
63 if (yamlData.has(
"final_filters"))
66 yamlData[
"final_filters"], options.
verbosity);
98 const double tStart = mrpt::Clock::nowDouble();
100 size_t nKFs = sm.size();
102 mrpt::keep_min(nKFs, *options.
end_index + 1);
108 for (; curKF < nKFs; curKF++)
110 #if MRPT_VERSION >= 0x020b05
111 const auto& [pose, sf, twist] = sm.get(curKF);
112 if (twist.has_value())
123 const auto& [pose, sf] = sm.get(curKF);
127 const mrpt::poses::CPose3D robotPose = pose->getMeanVal();
131 {{
"robot_x", robotPose.x()},
132 {
"robot_y", robotPose.y()},
133 {
"robot_z", robotPose.z()},
134 {
"robot_yaw", robotPose.yaw()},
135 {
"robot_pitch", robotPose.pitch()},
136 {
"robot_roll", robotPose.roll()}});
139 for (
const auto& obs : *sf)
147 if (!handled)
continue;
156 for (
const auto& [name, map] : mm.
layers)
164 "Sanity check did not pass for layer: '%s'", name.c_str()));
171 const size_t N = nKFs;
172 const double pc = (1.0 * curKF) / N;
174 const double tNow = mrpt::Clock::nowDouble();
175 const double ETA = pc > 0 ? (tNow - tStart) * (1.0 / pc - 1) : .0;
176 const double totalTime = ETA + (tNow - tStart);
181 << mrpt::system::progress(pc, 30)
183 " %6zu/%6zu (%.02f%%) ETA=%s / T=%s\n", curKF, N,
184 100 * pc, mrpt::system::formatTimeInterval(ETA).c_str(),
185 mrpt::system::formatTimeInterval(totalTime).c_str());
191 if (!finalFilters.empty())
193 std::cout <<
"Applying 'final_filters'..." << std::endl;
197 std::cout <<
"Done with 'final_filters'." << std::endl;
static mp2p_icp_filters::GeneratorSet generators
std::vector< std::pair< std::string, double > > customVariables
void apply_filter_pipeline(const FilterPipeline &filters, mp2p_icp::metric_map_t &inOut, const mrpt::optional_ref< mrpt::system::CTimeLogger > &profiler=std::nullopt)
void simplemap_to_metricmap(const mrpt::maps::CSimpleMap &sm, mp2p_icp::metric_map_t &outMap, const mrpt::containers::yaml &pipeline, const sm2mm_options_t &options={})
bool pointcloud_sanity_check(const mrpt::maps::CPointsMap &pc, bool printWarnings=true)
Checks for consistent length of field vectors.
Base virtual class for point cloud filters.
mrpt::system::VerbosityLevel verbosity
FilterPipeline filter_pipeline_from_yaml(const mrpt::containers::yaml &c, const mrpt::system::VerbosityLevel &vLevel=mrpt::system::LVL_INFO)
const mrpt::maps::CPointsMap * MapToPointsMap(const mrpt::maps::CMetricMap &map)
Options for simplemap_to_metricmap()
std::vector< FilterBase::Ptr > FilterPipeline
std::vector< Generator::Ptr > GeneratorSet
simplemap-to-metricmap utility function
Base virtual class for point cloud filters.
void updateVariables(const std::vector< std::pair< std::string, double >> &nameValuePairs)
std::optional< size_t > start_index
Generic container of pointcloud(s), extracted features and other maps.
bool apply_generators(const GeneratorSet &generators, const mrpt::obs::CObservation &obs, mp2p_icp::metric_map_t &output, const std::optional< mrpt::poses::CPose3D > &robotPose=std::nullopt)
void AttachToParameterSource(std::vector< std::shared_ptr< T >> &setObjects, ParameterSource &source)
std::map< layer_name_t, mrpt::maps::CMetricMap::Ptr > layers
std::optional< size_t > end_index
GeneratorSet generators_from_yaml(const mrpt::containers::yaml &c, const mrpt::system::VerbosityLevel &vLevel=mrpt::system::LVL_INFO)
mp2p_icp
Author(s):
autogenerated on Thu Dec 26 2024 03:48:12