MRPT  2.0.3
CPointCloudFilterByDistance.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
14 #include <mrpt/poses/CPose3D.h>
15 #include <map>
16 
17 namespace mrpt::maps
18 {
19 /** Implementation of pointcloud filtering based on requisities for minimum
20  * neigbouring points in both,
21  * the current timestamp and a previous one.
22  *
23  * \sa CPointsMap
24  * \ingroup mrpt_maps_grp
25  */
27 {
28  public:
29  // See base docs
30  void filter(
31  /** [in,out] The input pointcloud, which will be modified upon
32  return after filtering. */
33  mrpt::maps::CPointsMap* inout_pointcloud,
34  /** [in] The timestamp of the input pointcloud */
35  const mrpt::system::TTimeStamp pc_timestamp,
36  /** [in] If nullptr, the PC is assumed to be given in global
37  coordinates. Otherwise, it will be transformed from local
38  coordinates to global using this transformation. */
39  const mrpt::poses::CPose3D& pc_reference_pose,
40  /** [in,out] additional in/out parameters */
41  TExtraFilterParams* params = nullptr) override;
42 
44  {
45  /** (Default: 0.05 m) */
46  double min_dist{0.10};
47  /** (Default: 2 deg) Stored in rad. */
49  /** (Default: 1 s) */
50  double too_old_seconds{1.0};
51  /** (Default: 1) How many previous keyframes will be compared with the
52  * latest pointcloud. */
54  /** (Default: 0.4) If the ratio [0,1] of points considered invalid
55  * ("deletion") is larger than this ratio, no point will be deleted
56  * since it'd be too suspicious and may indicate a failure of this
57  * filter. */
58  double max_deletion_ratio{.4};
59 
60  TOptions();
61  void loadFromConfigFile(
62  const mrpt::config::CConfigFileBase& source,
63  const std::string& section) override; // See base docs
64  void saveToConfigFile(
66  const std::string& section) const override;
67  };
68 
70 
71  private:
72  struct FrameInfo
73  {
76  };
77 
78  std::map<mrpt::system::TTimeStamp, FrameInfo> m_last_frames;
79 };
80 } // namespace mrpt::maps
mrpt::maps::CPointCloudFilterByDistance
Implementation of pointcloud filtering based on requisities for minimum neigbouring points in both,...
Definition: CPointCloudFilterByDistance.h:26
CPointCloudFilterBase.h
mrpt::maps::CPointCloudFilterByDistance::FrameInfo::pose
mrpt::poses::CPose3D pose
Definition: CPointCloudFilterByDistance.h:74
mrpt::maps::CPointCloudFilterByDistance::TOptions::TOptions
TOptions()
Definition: CPointCloudFilterByDistance.cpp:203
mrpt::maps::CPointsMap
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors.
Definition: CPointsMap.h:67
mrpt::maps::CPointCloudFilterBase::TExtraFilterParams
Definition: CPointCloudFilterBase.h:40
mrpt::maps::CPointCloudFilterByDistance::TOptions::loadFromConfigFile
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: CPointCloudFilterByDistance.cpp:209
mrpt::maps::CPointCloudFilterBase
Virtual base class for all point-cloud filtering algorithm.
Definition: CPointCloudFilterBase.h:33
mrpt::maps::CSimplePointsMap::Ptr
std::shared_ptr< mrpt::maps ::CSimplePointsMap > Ptr
Definition: CSimplePointsMap.h:32
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::maps::CPointCloudFilterByDistance::TOptions::too_old_seconds
double too_old_seconds
(Default: 1 s)
Definition: CPointCloudFilterByDistance.h:50
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
mrpt::maps::CPointCloudFilterByDistance::FrameInfo::pc
mrpt::maps::CSimplePointsMap::Ptr pc
Definition: CPointCloudFilterByDistance.h:75
mrpt::maps::CPointCloudFilterByDistance::TOptions
Definition: CPointCloudFilterByDistance.h:43
mrpt::config::CLoadableOptions
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Definition: config/CLoadableOptions.h:26
mrpt::system::TTimeStamp
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition: datetime.h:40
mrpt::maps::CPointCloudFilterByDistance::TOptions::min_dist
double min_dist
(Default: 0.05 m)
Definition: CPointCloudFilterByDistance.h:46
mrpt::maps::CPointCloudFilterByDistance::TOptions::angle_tolerance
double angle_tolerance
(Default: 2 deg) Stored in rad.
Definition: CPointCloudFilterByDistance.h:48
mrpt::maps::CPointCloudFilterByDistance::TOptions::previous_keyframes
int previous_keyframes
(Default: 1) How many previous keyframes will be compared with the latest pointcloud.
Definition: CPointCloudFilterByDistance.h:53
params
mrpt::vision::TStereoCalibParams params
Definition: chessboard_stereo_camera_calib_unittest.cpp:24
CPose3D.h
CLoadableOptions.h
mrpt::maps::CPointCloudFilterByDistance::m_last_frames
std::map< mrpt::system::TTimeStamp, FrameInfo > m_last_frames
Definition: CPointCloudFilterByDistance.h:78
mrpt::maps::CPointCloudFilterByDistance::filter
void filter(mrpt::maps::CPointsMap *inout_pointcloud, const mrpt::system::TTimeStamp pc_timestamp, const mrpt::poses::CPose3D &pc_reference_pose, TExtraFilterParams *params=nullptr) override
Apply the filtering algorithm to the pointcloud.
Definition: CPointCloudFilterByDistance.cpp:18
mrpt::maps::CPointCloudFilterByDistance::TOptions::saveToConfigFile
void saveToConfigFile(mrpt::config::CConfigFileBase &c, const std::string &section) const override
This method saves the options to a ".ini"-like file or memory-stored string list.
Definition: CPointCloudFilterByDistance.cpp:219
mrpt::maps::CPointCloudFilterByDistance::options
TOptions options
Definition: CPointCloudFilterByDistance.h:69
mrpt::maps
Definition: CBeacon.h:21
CSimplePointsMap.h
mrpt::maps::CPointCloudFilterByDistance::FrameInfo
Definition: CPointCloudFilterByDistance.h:72
mrpt::maps::CPointCloudFilterByDistance::TOptions::max_deletion_ratio
double max_deletion_ratio
(Default: 0.4) If the ratio [0,1] of points considered invalid ("deletion") is larger than this ratio...
Definition: CPointCloudFilterByDistance.h:58



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Thu May 21 21:53:32 UTC 2020