Protected Member Functions | List of all members
mp2p_icp::metric_map_t Class Reference

Generic container of pointcloud(s), extracted features and other maps. More...

#include <metricmap.h>

Inheritance diagram for mp2p_icp::metric_map_t:
Inheritance graph
[legend]

Public Attributes

Data fields
std::map< layer_name_t, mrpt::maps::CMetricMap::Ptr > layers
 
std::vector< mrpt::math::TLine3D > lines
 
std::vector< plane_patch_tplanes
 
std::optional< uint64_t > id
 
std::optional< std::string > label
 

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_point_layer (mrpt::opengl::CSetOfObjects &o, const render_params_point_layer_t &p, const mrpt::maps::CPointsMap::Ptr &pts)
 

Detailed Description

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.

Member Function Documentation

◆ clear()

void metric_map_t::clear ( )
virtual

clear all containers

Definition at line 249 of file metricmap.cpp.

◆ contents_summary()

std::string metric_map_t::contents_summary ( ) const
virtual

Returns a string summarizing all the elements in the container (points, lines, planes)

Definition at line 375 of file metricmap.cpp.

◆ derivedSerializeFrom()

virtual void mp2p_icp::metric_map_t::derivedSerializeFrom ( [ [maybe_unused] ] mrpt::serialization::CArchive &  in)
inlineprotectedvirtual

Implement in derived classes if new data fields are required

Definition at line 206 of file metricmap.h.

◆ derivedSerializeTo()

virtual void mp2p_icp::metric_map_t::derivedSerializeTo ( [ [maybe_unused] ] mrpt::serialization::CArchive &  out) const
inlineprotectedvirtual

Implement in derived classes if new data fields are required

Definition at line 200 of file metricmap.h.

◆ empty()

bool metric_map_t::empty ( ) const
virtual

return true if all point cloud layers, feature lists, etc. are empty

Definition at line 245 of file metricmap.cpp.

◆ get_shared_from_this() [1/2]

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.

◆ get_shared_from_this() [2/2]

metric_map_t::ConstPtr metric_map_t::get_shared_from_this ( ) const

Definition at line 463 of file metricmap.cpp.

◆ get_shared_from_this_or_clone() [1/2]

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.

◆ get_shared_from_this_or_clone() [2/2]

metric_map_t::ConstPtr metric_map_t::get_shared_from_this_or_clone ( ) const

Definition at line 476 of file metricmap.cpp.

◆ get_visualization()

auto metric_map_t::get_visualization ( const render_params_t p = render_params_t()) const -> std::shared_ptr<mrpt::opengl::CSetOfObjects>
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.

Note
If deriving user classes inheriting from metric_map_t, remember to reimplement this method and call this base class method to render common elements.

Definition at line 96 of file metricmap.cpp.

◆ get_visualization_lines()

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.

◆ get_visualization_planes()

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.

◆ get_visualization_point_layer()

void metric_map_t::get_visualization_point_layer ( mrpt::opengl::CSetOfObjects &  o,
const render_params_point_layer_t p,
const mrpt::maps::CPointsMap::Ptr &  pts 
)
static

Used inside get_visualization_points(), renders points only.

Definition at line 193 of file metricmap.cpp.

◆ get_visualization_points()

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.

◆ load_from_file()

bool metric_map_t::load_from_file ( const std::string &  fileName)

Loads the metric_map_t object from a file. See \save_to_file()

Returns
true on success.

Definition at line 432 of file metricmap.cpp.

◆ merge_with()

void metric_map_t::merge_with ( const metric_map_t otherPc,
const std::optional< mrpt::math::TPose3D > &  otherRelativePose = std::nullopt 
)
virtual

Merges all geometric entities from another point cloud into this one, with an optional relative pose transformation.

Note
Point layers will be merged for coinciding names, or created if the layer did not exist in this.
This method is virtual for user-extended point clouds can handle other geometric primitives as needed.

Definition at line 252 of file metricmap.cpp.

◆ point_layer()

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.

◆ save_to_file()

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.

Returns
true on success.

Definition at line 421 of file metricmap.cpp.

◆ size()

size_t metric_map_t::size ( ) const
virtual

Overall number of elements (points, lines, planes)

Definition at line 352 of file metricmap.cpp.

◆ size_points_only()

size_t metric_map_t::size_points_only ( ) const
virtual

Overall number of points, including all layers.

Definition at line 362 of file metricmap.cpp.

Member Data Documentation

◆ id

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.

◆ label

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.

◆ layers

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.

  • PT_LAYER_RAW: reserved to the original, full point cloud (if kept)
  • PT_LAYER_PLANE_CENTROIDS: a point for each plane in planes (same order).
See also
point_layers()

Definition at line 74 of file metricmap.h.

◆ lines

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.

◆ planes

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.

◆ PT_LAYER_PLANE_CENTROIDS

constexpr static const char* mp2p_icp::metric_map_t::PT_LAYER_PLANE_CENTROIDS = "plane_centroids"
staticconstexpr

Definition at line 57 of file metricmap.h.

◆ PT_LAYER_RAW

constexpr static const char* mp2p_icp::metric_map_t::PT_LAYER_RAW = "raw"
staticconstexpr

Definition at line 56 of file metricmap.h.


The documentation for this class was generated from the following files:


mrpt_local_obstacles
Author(s): Jose-Luis Blanco-Claraco
autogenerated on Mon Aug 14 2023 02:09:05