14 #include <mrpt/containers/yaml.h>
15 #include <mrpt/maps/CSimplePointsMap.h>
16 #include <mrpt/math/ops_containers.h>
17 #include <mrpt/obs/CObservation2DRangeScan.h>
18 #include <mrpt/random/RandomGenerators.h>
26 const mrpt::containers::yaml& c)
33 c.has(
"bounding_box_min") && c[
"bounding_box_min"].isSequence() &&
34 c[
"bounding_box_min"].asSequence().size() == 3);
36 c.has(
"bounding_box_max") && c[
"bounding_box_max"].isSequence() &&
37 c[
"bounding_box_max"].asSequence().size() == 3);
39 const auto bboxMin = c[
"bounding_box_min"].toStdVector<
double>();
40 const auto bboxMax = c[
"bounding_box_max"].toStdVector<
double>();
42 for (
int i = 0; i < 3; i++)
55 MRPT_LOG_DEBUG_STREAM(
"Loading these params:\n" << c);
69 "Input point cloud layer '%s' was not found.",
72 const auto& pc = *pcPtr;
78 mrpt::maps::CPointsMap::Ptr outPc;
80 itLy != inOut.
layers.end())
82 outPc = std::dynamic_pointer_cast<mrpt::maps::CPointsMap>(itLy->second);
85 "Layer '%s' must be of point cloud type.",
90 outPc = mrpt::maps::CSimplePointsMap::Create();
94 outPc->reserve(outPc->size() + pc.size() / 10);
96 const auto& xs = pc.getPointsBufferRef_x();
97 const auto& ys = pc.getPointsBufferRef_y();
98 const auto& zs = pc.getPointsBufferRef_z();
100 for (
size_t i = 0; i < xs.size(); i++)
102 const bool isInside =
110 outPc->insertPointFast(xs[i], ys[i], zs[i]);