Generic container of pointcloud(s), extracted features and other maps. More...
#include <metricmap.h>
Classes | |
struct | Georeferencing |
Public Attributes | |
Data fields | |
std::map< layer_name_t, mrpt::maps::CMetricMap::Ptr > | layers |
std::vector< mrpt::math::TLine3D > | lines |
std::vector< plane_patch_t > | planes |
std::optional< uint64_t > | id |
std::optional< std::string > | label |
std::optional< Georeferencing > | georeferencing |
Static Public Attributes | |
Reserved point-cloud layer names (for use in <tt>point_layers</tt>) | |
constexpr static const char * | PT_LAYER_RAW = "raw" |
constexpr static const char * | PT_LAYER_PLANE_CENTROIDS = "plane_centroids" |
Protected Member Functions | |
virtual void | derivedSerializeFrom ([[maybe_unused]] mrpt::serialization::CArchive &in) |
virtual void | derivedSerializeTo ([[maybe_unused]] mrpt::serialization::CArchive &out) const |
Methods | |
virtual bool | empty () const |
virtual size_t | size () const |
virtual size_t | size_points_only () const |
virtual std::string | contents_summary () const |
virtual void | clear () |
bool | save_to_file (const std::string &fileName) const |
bool | load_from_file (const std::string &fileName) |
mrpt::maps::CPointsMap::Ptr | point_layer (const layer_name_t &name) const |
virtual auto | get_visualization (const render_params_t &p=render_params_t()) const -> std::shared_ptr< mrpt::opengl::CSetOfObjects > |
virtual void | merge_with (const metric_map_t &otherPc, const std::optional< mrpt::math::TPose3D > &otherRelativePose=std::nullopt) |
void | get_visualization_planes (mrpt::opengl::CSetOfObjects &o, const render_params_planes_t &p) const |
void | get_visualization_lines (mrpt::opengl::CSetOfObjects &o, const render_params_lines_t &p) const |
void | get_visualization_points (mrpt::opengl::CSetOfObjects &o, const render_params_points_t &p) const |
Ptr | get_shared_from_this () |
Ptr | get_shared_from_this_or_clone () |
ConstPtr | get_shared_from_this () const |
ConstPtr | get_shared_from_this_or_clone () const |
static void | get_visualization_map_layer (mrpt::opengl::CSetOfObjects &o, const render_params_point_layer_t &p, const mrpt::maps::CMetricMap::Ptr &map) |
Generic container of pointcloud(s), extracted features and other maps.
This class could be derived by users to define custom point cloud features, for use in custom alignment algorithms.
The class supports C++11/C++17 std::shared_from_this() via get_shared_from_this();
Definition at line 49 of file metricmap.h.
|
virtual |
clear all containers
Definition at line 366 of file metricmap.cpp.
|
virtual |
Returns a string summarizing all the elements in the container (points, lines, planes)
Definition at line 500 of file metricmap.cpp.
|
inlineprotectedvirtual |
Implement in derived classes if new data fields are required
Definition at line 228 of file metricmap.h.
|
inlineprotectedvirtual |
Implement in derived classes if new data fields are required
Definition at line 222 of file metricmap.h.
|
virtual |
return true if all point cloud layers, feature lists, etc. are empty
Definition at line 362 of file metricmap.cpp.
metric_map_t::Ptr metric_map_t::get_shared_from_this | ( | ) |
Returns a shared_ptr to this object, if it was already created initially as a shared_ptr, or an empty pointer otherwise.
Definition at line 589 of file metricmap.cpp.
metric_map_t::ConstPtr metric_map_t::get_shared_from_this | ( | ) | const |
Definition at line 609 of file metricmap.cpp.
metric_map_t::Ptr metric_map_t::get_shared_from_this_or_clone | ( | ) |
Like get_shared_from_this(), or makes a deep copy if the original object was allocated in the stack, etc.
Definition at line 602 of file metricmap.cpp.
metric_map_t::ConstPtr metric_map_t::get_shared_from_this_or_clone | ( | ) | const |
Definition at line 622 of file metricmap.cpp.
|
virtual |
Gets a renderizable view of all geometric entities.
See render_params_t for options to show/hide the different geometric entities and point layers.
Definition at line 121 of file metricmap.cpp.
void metric_map_t::get_visualization_lines | ( | mrpt::opengl::CSetOfObjects & | o, |
const render_params_lines_t & | p | ||
) | const |
Used inside get_visualization(), renders lines only.
Definition at line 157 of file metricmap.cpp.
|
static |
Used inside get_visualization_points(), renders points only.
Definition at line 211 of file metricmap.cpp.
void metric_map_t::get_visualization_planes | ( | mrpt::opengl::CSetOfObjects & | o, |
const render_params_planes_t & | p | ||
) | const |
Used inside get_visualization(), renders planes only.
Definition at line 135 of file metricmap.cpp.
void metric_map_t::get_visualization_points | ( | mrpt::opengl::CSetOfObjects & | o, |
const render_params_points_t & | p | ||
) | const |
Used inside get_visualization(), renders points only.
Definition at line 177 of file metricmap.cpp.
bool metric_map_t::load_from_file | ( | const std::string & | fileName | ) |
Loads the metric_map_t object from a file. See \save_to_file()
Definition at line 578 of file metricmap.cpp.
|
virtual |
Merges all geometric entities from another point cloud into this one, with an optional relative pose transformation.
this
. Definition at line 370 of file metricmap.cpp.
mrpt::maps::CPointsMap::Ptr metric_map_t::point_layer | ( | const layer_name_t & | name | ) | const |
Returns a shared_ptr to the given point cloud layer, or throws if the layer does not exist or it contains a different type of metric map (e.g. if it is a gridmap).
Note that this method is only provided by convenience and backwards-compatibility: users can always directly access layers
and perform a std::dynamic_pointer_cast<>
.
Definition at line 629 of file metricmap.cpp.
bool metric_map_t::save_to_file | ( | const std::string & | fileName | ) | const |
Saves the metric_map_t object to file, using MRPT serialization and using on-the-fly GZIP compression.
Definition at line 567 of file metricmap.cpp.
|
virtual |
Overall number of elements (points, lines, planes)
Definition at line 475 of file metricmap.cpp.
|
virtual |
Overall number of points, including all layers.
Definition at line 485 of file metricmap.cpp.
std::optional<Georeferencing> mp2p_icp::metric_map_t::georeferencing |
If provided, gives the placement of the map with respect to the Earth.
Definition at line 117 of file metricmap.h.
std::optional<uint64_t> mp2p_icp::metric_map_t::id |
An optional numerical ID to identify the pointcloud in some higher-level system. Used to build the names of ICP debug files, if so requested. It is not mandatory and even duplicates may exist without problems: just a placeholder for the user of this library to use it.
Definition at line 89 of file metricmap.h.
std::optional<std::string> mp2p_icp::metric_map_t::label |
An optional textual identification/description of the pointcloud in some higher-level system. Used to build the names of ICP debug files, if so requested. It is not mandatory and even duplicates may exist without problems: just a placeholder for the user of this library to use it.
Definition at line 97 of file metricmap.h.
std::map<layer_name_t, mrpt::maps::CMetricMap::Ptr> mp2p_icp::metric_map_t::layers |
Different layers indexed by a descriptive name, with point-clouds, 2D/3D gridmap, etc.
Standarized layer names: See section above.
planes
(same order).Definition at line 76 of file metricmap.h.
std::vector<mrpt::math::TLine3D> mp2p_icp::metric_map_t::lines |
3D lines (infinite lines, not segments)
Definition at line 79 of file metricmap.h.
std::vector<plane_patch_t> mp2p_icp::metric_map_t::planes |
Plane patches=centroid point + infinite plane
Definition at line 82 of file metricmap.h.
|
staticconstexpr |
Definition at line 59 of file metricmap.h.
|
staticconstexpr |
Definition at line 58 of file metricmap.h.