namespace mp2p_icp_filters¶

Overview¶

namespace mp2p_icp_filters {

// namespaces

namespace mp2p_icp_filters::internal;

// typedefs

typedef std::vector<FilterBase::Ptr> FilterPipeline;
typedef std::vector<Generator::Ptr> GeneratorSet;
typedef std::vector<uint64_t> KeyframeSignature;

// enums

enum DecimateMethod;
enum MotionCompensationMethod;
enum TimestampAdjustMethod;

// structs

struct EstimateUpParams;
struct EstimateUpResult;
struct GraphPartInfo;
struct GraphPartitionParams;
struct GraphPartitionStats;
struct GraphPartitionWarmStart;
struct KeyframePlace;
struct KeyframeSignatureParams;
struct NotImplementedError;
struct PlaceLevelingParams;
struct PlaceLevelingResult;
struct PlanarNormalsParams;
struct PlaneSegmentationParams;
struct PlaneSegmentationResult;
struct SegmentedPlane;
struct SimplemapPartition;
struct SimplemapPartitionParams;
struct SimplemapPartitionStats;
struct SubmapUp;
struct UpFieldParams;
struct UpSample;
struct WeightedEdge;
struct sm2mm_options_t;

// classes

class FilterAbsoluteTimestamp;
class FilterAdjustTimestamps;
class FilterBase;
class FilterBeamCorrection;
class FilterBoundingBox;
class FilterByExpression;
class FilterByIntensity;
class FilterByRange;
class FilterByRing;
class FilterClear;
class FilterCurvature;
class FilterDecimate;
class FilterDecimateAdaptive;
class FilterDecimateRangeAdaptive;
class FilterDecimateVoxels;
class FilterDeleteLayer;
class FilterDeskew;
class FilterEdgesPlanes;
class FilterFartherPointSampling;
class FilterInsertPoint;
class FilterMLS;
class FilterMerge;
class FilterNormalizeIntensity;
class FilterNormals;
class FilterPlanePatches;
class FilterPlaneSegmentation;
class FilterPoleDetector;
class FilterPolygon2D;
class FilterRangeBiasCorrection;
class FilterRemoveByVoxelOccupancy;
class FilterRemovePointCloudField;
class FilterRenameLayer;
class FilterSOR;
class FilterTransformPointCloud;
class FilterTraversability;
class FilterVoxelSOR;
class FilterVoxelSlice;
class Generator;
class GeneratorEdgesFromCurvature;
class GeneratorEdgesFromRangeImage;
class KeyframeOverlapGraph;
class PointCloudToVoxelGrid;
class PointCloudToVoxelGridAverage;
class PointCloudToVoxelGridSingle;

// global variables

constexpr auto POINT_FIELD_INTENSITY = mrpt::maps::CPointsMap::POINT_FIELD_INTENSITY;
constexpr auto POINT_FIELD_RING_ID = mrpt::maps::CPointsMap::POINT_FIELD_RING_ID;
constexpr auto POINT_FIELD_TIMESTAMP = mrpt::maps::CPointsMap::POINT_FIELD_TIMESTAMP;
constexpr const char* KEYFRAME_PLACE_KEY = "place";

// global functions

mrpt::maps::CMetricMap::Ptr CreateMetricMapFromDefinition(
    const mrpt::containers::yaml& metricMapDefinition,
    const std::string& metricMapDefinitionIniFile = std::string(),
    const mrpt::system::COutputLogger* logger = nullptr
    );

std::vector<mrpt::math::TVector3D> estimate_planar_normals(
    const mrpt::maps::CPointsMap& pc,
    const PlanarNormalsParams& params = {},
    std::vector<mrpt::math::TPoint3Df>* outPoints = nullptr
    );

EstimateUpResult estimate_up_from_normals(
    const std::vector<mrpt::math::TVector3D>& normals,
    const EstimateUpParams& params = {},
    const std::vector<mrpt::math::TPoint3Df>* points = nullptr
    );

double wall_deviation_deg(
    const std::vector<mrpt::math::TVector3D>& normals,
    const mrpt::math::TVector3D& up,
    const EstimateUpParams& params = {}
    );

mrpt::poses::CPose3D rotation_aligning_up_to_z(const mrpt::math::TVector3D& up);
mrpt::math::TVector3D interpolate_up(const std::vector<UpSample>& samples, double t);

std::vector<mrpt::poses::CPose3D> level_poses_from_up(
    const std::vector<double>& times,
    const std::vector<mrpt::poses::CPose3D>& poses,
    const std::vector<UpSample>& samples
    );

void apply_filter_pipeline(
    const FilterPipeline& filters,
    mp2p_icp::metric_map_t& inOut,
    const mrpt::optional_ref<mrpt::system::CTimeLogger>& profiler = std::nullopt
    );

FilterPipeline filter_pipeline_from_yaml(
    const mrpt::containers::yaml& c,
    const mrpt::system::VerbosityLevel& vLevel = mrpt::system::LVL_INFO
    );

FilterPipeline filter_pipeline_from_yaml_file(
    const std::string& filename,
    const mrpt::system::VerbosityLevel& vLevel = mrpt::system::LVL_INFO
    );

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,
    const mrpt::optional_ref<mrpt::system::CTimeLogger>& profiler = std::nullopt
    );

mp2p_icp::metric_map_t apply_generators(
    const GeneratorSet& generators,
    const mrpt::obs::CObservation& obs,
    const std::optional<mrpt::poses::CPose3D>& robotPose = std::nullopt
    );

bool apply_generators(
    const GeneratorSet& generators,
    const mrpt::obs::CSensoryFrame& sf,
    mp2p_icp::metric_map_t& output,
    const std::optional<mrpt::poses::CPose3D>& robotPose = std::nullopt
    );

mp2p_icp::metric_map_t apply_generators(
    const GeneratorSet& generators,
    const mrpt::obs::CSensoryFrame& sf,
    const std::optional<mrpt::poses::CPose3D>& robotPose = std::nullopt
    );

GeneratorSet generators_from_yaml(
    const mrpt::containers::yaml& c,
    const mrpt::system::VerbosityLevel& vLevel = mrpt::system::LVL_INFO
    );

GeneratorSet generators_from_yaml_file(
    const std::string& filename,
    const mrpt::system::VerbosityLevel& vLevel = mrpt::system::LVL_INFO
    );

mrpt::maps::CPointsMap::Ptr GetOrCreatePointLayer(
    mp2p_icp::metric_map_t& m,
    const std::string& layerName,
    bool allowEmptyName = true,
    const std::string& classForLayerCreation = "mrpt::maps::CSimplePointsMap"
    );

double normalized_cut(
    std::size_t nodeCount,
    const std::vector<WeightedEdge>& edges,
    const std::vector<bool>& inA
    );

std::vector<double> fiedler_vector(
    std::size_t nodeCount,
    const std::vector<WeightedEdge>& edges,
    const GraphPartitionParams& params = {},
    double* lambda2 = nullptr,
    bool* converged = nullptr
    );

std::vector<uint32_t> spectral_partition(
    std::size_t nodeCount,
    const std::vector<WeightedEdge>& edges,
    const GraphPartitionParams& params = {},
    GraphPartitionStats* stats = nullptr,
    std::vector<GraphPartInfo>* parts = nullptr,
    GraphPartitionWarmStart* warmStart = nullptr
    );

KeyframeSignature keyframe_signature(
    const mrpt::maps::CPointsMap& pointsInMap,
    const mrpt::math::TPoint3D& sensorInMap,
    const KeyframeSignatureParams& params = {}
    );

double signature_similarity(const KeyframeSignature& a, const KeyframeSignature& b);
mrpt::math::TPoint3D signature_voxel_center(uint64_t key, double voxelSize);

PlaceLevelingResult level_poses_by_place(
    const std::vector<mrpt::poses::CPose3D>& poses,
    const std::vector<mrpt::math::TVector3D>& ups,
    const std::vector<WeightedEdge>& links,
    const PlaceLevelingParams& params = {}
    );

std::vector<mrpt::poses::CPose3D> level_path_by_place(
    const std::vector<double>& pathTimes,
    const std::vector<mrpt::poses::CPose3D>& pathPoses,
    const std::vector<double>& kfTimes,
    const std::vector<mrpt::poses::CPose3D>& kfBefore,
    const std::vector<mrpt::poses::CPose3D>& kfAfter,
    const std::vector<mrpt::math::TVector3D>& kfUps
    );

PlaneSegmentationResult segment_planes(const mrpt::maps::CPointsMap& pc, const PlaneSegmentationParams& params = {});

double robust_max_range(
    const mrpt::maps::CPointsMap& pc,
    double percentile = 0.95,
    const mrpt::math::TPoint3Df& center = {0, 0, 0}
    );

mrpt::containers::yaml decimated_keyframes_pipeline(double voxel);

bool keyframe_is_node(
    const mrpt::poses::CPose3D& previousNode,
    const mrpt::poses::CPose3D& pose,
    const SimplemapPartitionParams& params
    );

KeyframeSignature keyframe_signature_from_observations(
    const mrpt::obs::CSensoryFrame& observations,
    const mrpt::poses::CPose3D& robotPose,
    const mrpt::containers::yaml& pipeline,
    const KeyframeSignatureParams& params,
    const std::optional<mrpt::math::TTwist3D>& twist = std::nullopt
    );

SimplemapPartition partition_simplemap(const mrpt::maps::CSimpleMap& sm, const SimplemapPartitionParams& params = {}, SimplemapPartitionStats* stats = nullptr);
uint32_t partition_params_hash(const SimplemapPartitionParams& params);
void write_keyframe_places(mrpt::maps::CSimpleMap& sm, const SimplemapPartition& partition, uint32_t paramsHash);
SimplemapPartition simplemap_partition_from_places(const mrpt::maps::CSimpleMap& sm, const SimplemapPartitionParams& params = {}, SimplemapPartitionStats* stats = nullptr);

std::vector<mrpt::math::TVector3D> keyframe_ups_from_submaps(
    const SimplemapPartition& partition,
    const std::vector<std::optional<SubmapUp>>& submapUp,
    const UpFieldParams& params = {}
    );

std::vector<WeightedEdge> keyframe_place_links(
    const SimplemapPartition& partition,
    const std::vector<mrpt::math::TPoint3D>& kfPositions,
    double maxLength,
    double weight
    );

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 = {}
    );

} // namespace mp2p_icp_filters