Generic container of pointcloud(s), extracted features and other maps. More...
#include <metricmap.h>
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 |
Static Public Attributes | |
Reserved point-cloud layer names (for use in `point_layers`) | |
static constexpr const char * | PT_LAYER_RAW = "raw" |
static constexpr 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_point_layer (mrpt::opengl::CSetOfObjects &o, const render_params_point_layer_t &p, const mrpt::maps::CPointsMap::Ptr &pts) |
Generic container of pointcloud(s), extracted features and other maps.
Refer to
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 47 of file metricmap.h.
|
virtual |
clear all containers
Definition at line 249 of file metricmap.cpp.
|
virtual |
Returns a string summarizing all the elements in the container (points, lines, planes)
Definition at line 375 of file metricmap.cpp.
|
inlineprotectedvirtual |
Implement in derived classes if new data fields are required
Definition at line 206 of file metricmap.h.
|
inlineprotectedvirtual |
Implement in derived classes if new data fields are required
Definition at line 200 of file metricmap.h.
|
virtual |
return true if all point cloud layers, feature lists, etc. are empty
Definition at line 245 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 443 of file metricmap.cpp.
metric_map_t::ConstPtr metric_map_t::get_shared_from_this | ( | ) | const |
Definition at line 463 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 456 of file metricmap.cpp.
metric_map_t::ConstPtr metric_map_t::get_shared_from_this_or_clone | ( | ) | const |
Definition at line 476 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 96 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 132 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 110 of file metricmap.cpp.
|
static |
Used inside get_visualization_points(), renders points only.
Definition at line 193 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 152 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 ()
Definition at line 432 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 252 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 483 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 421 of file metricmap.cpp.
|
virtual |
Overall number of elements (points, lines, planes)
Definition at line 352 of file metricmap.cpp.
|
virtual |
Overall number of points, including all layers.
Definition at line 362 of file metricmap.cpp.
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 87 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 95 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 74 of file metricmap.h.
std::vector<mrpt::math::TLine3D> mp2p_icp::metric_map_t::lines |
3D lines (infinite lines, not segments)
Definition at line 77 of file metricmap.h.
std::vector<plane_patch_t> mp2p_icp::metric_map_t::planes |
Plane patches=centroid point + infinite plane
Definition at line 80 of file metricmap.h.
|
static |
Definition at line 57 of file metricmap.h.
|
static |
Definition at line 56 of file metricmap.h.