MRPT  2.0.4
CHeightGridMap2D_Base.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 
10 #pragma once
11 
12 #include <mrpt/math/TLine3D.h>
13 #include <mrpt/math/TObject3D.h>
14 #include <mrpt/obs/CObservation.h>
15 
16 namespace mrpt::maps
17 {
18 /** Virtual base class for Digital Elevation Model (DEM) maps. See derived
19  * classes for details.
20  * This class implements those operations which are especific to DEMs.
21  * \ingroup mrpt_maps_grp */
23 {
24  public:
26  virtual ~CHeightGridMap2D_Base();
27 
28  /** @name Specific API for Digital Elevation Model (DEM) maps
29  @{ */
30  /** Gets the intersection between a 3D line and a Height Grid map (taking
31  * into account the different heights of each individual cell) */
32  bool intersectLine3D(
33  const mrpt::math::TLine3D& r1, mrpt::math::TObject3D& obj) const;
34 
35  /** Computes the minimum and maximum height in the grid.
36  * \return False if there is no observed cell yet. */
37  bool getMinMaxHeight(float& z_min, float& z_max) const;
38 
39  /** Extra params for insertIndividualPoint() */
41  {
42  /** (Default:0.0) If !=0, use this value as the uncertainty (standard
43  * deviation) for the point "z" coordinate, instead of the map-wise
44  * default value. */
45  double pt_z_std{0.0};
46  /** (default: true) run any required operation to ensure the map
47  * reflects the changes caused by this point. Otherwise, calling
48  * dem_update_map() is required. */
50 
52  };
53  /** Update the DEM with one new point.
54  * \sa mrpt::maps::CMetricMap::insertObservation() for inserting
55  * higher-level objects like 2D/3D LIDAR scans
56  * \return true if updated OK, false if (x,y) is out of bounds */
57  virtual bool insertIndividualPoint(
58  const double x, const double y, const double z,
59  const TPointInsertParams& params = TPointInsertParams()) = 0;
60 
61  virtual double dem_get_resolution() const = 0;
62  virtual size_t dem_get_size_x() const = 0;
63  virtual size_t dem_get_size_y() const = 0;
64  /** Get cell 'z' by (cx,cy) cell indices. \return false if out of bounds or
65  * un-observed cell. */
66  virtual bool dem_get_z_by_cell(
67  const size_t cx, const size_t cy, double& z_out) const = 0;
68  /** Get cell 'z' (x,y) by metric coordinates. \return false if out of bounds
69  * or un-observed cell. */
70  virtual bool dem_get_z(
71  const double x, const double y, double& z_out) const = 0;
72  /** Ensure that all observations are reflected in the map estimate */
73  virtual void dem_update_map() = 0;
74  /** @} */
75 
76  /** Internal method called by internal_insertObservation() */
78  const mrpt::obs::CObservation& obs,
79  const mrpt::poses::CPose3D* robotPose = nullptr);
80 };
81 } // namespace mrpt::maps
mrpt::maps::CHeightGridMap2D_Base::~CHeightGridMap2D_Base
virtual ~CHeightGridMap2D_Base()
mrpt::maps::CHeightGridMap2D_Base::dem_get_size_x
virtual size_t dem_get_size_x() const =0
mrpt::maps::CHeightGridMap2D_Base::dem_update_map
virtual void dem_update_map()=0
Ensure that all observations are reflected in the map estimate.
TObject3D.h
mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams
Extra params for insertIndividualPoint()
Definition: CHeightGridMap2D_Base.h:40
mrpt::maps::CHeightGridMap2D_Base
Virtual base class for Digital Elevation Model (DEM) maps.
Definition: CHeightGridMap2D_Base.h:22
mrpt::math::TObject3D
Standard object for storing any 3D lightweight object.
Definition: TObject3D.h:25
mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams::update_map_after_insertion
bool update_map_after_insertion
(default: true) run any required operation to ensure the map reflects the changes caused by this poin...
Definition: CHeightGridMap2D_Base.h:49
mrpt::maps::CHeightGridMap2D_Base::CHeightGridMap2D_Base
CHeightGridMap2D_Base()
mrpt::maps::CHeightGridMap2D_Base::dem_get_resolution
virtual double dem_get_resolution() const =0
mrpt::maps::CHeightGridMap2D_Base::dem_get_size_y
virtual size_t dem_get_size_y() const =0
mrpt::maps::CHeightGridMap2D_Base::insertIndividualPoint
virtual bool insertIndividualPoint(const double x, const double y, const double z, const TPointInsertParams &params=TPointInsertParams())=0
Update the DEM with one new point.
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams::TPointInsertParams
TPointInsertParams()
params
mrpt::vision::TStereoCalibParams params
Definition: chessboard_stereo_camera_calib_unittest.cpp:24
TLine3D.h
mrpt::maps::CHeightGridMap2D_Base::getMinMaxHeight
bool getMinMaxHeight(float &z_min, float &z_max) const
Computes the minimum and maximum height in the grid.
Definition: CHeightGridMap2D_Base.cpp:28
mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams::pt_z_std
double pt_z_std
(Default:0.0) If !=0, use this value as the uncertainty (standard deviation) for the point "z" coordi...
Definition: CHeightGridMap2D_Base.h:45
mrpt::maps::CHeightGridMap2D_Base::dem_get_z_by_cell
virtual bool dem_get_z_by_cell(const size_t cx, const size_t cy, double &z_out) const =0
Get cell 'z' by (cx,cy) cell indices.
CObservation.h
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
mrpt::math::TLine3D
3D line, represented by a base point and a director vector.
Definition: TLine3D.h:19
mrpt::maps::CHeightGridMap2D_Base::dem_internal_insertObservation
bool dem_internal_insertObservation(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr)
Internal method called by internal_insertObservation()
Definition: CHeightGridMap2D_Base.cpp:128
mrpt::maps
Definition: CBeacon.h:21
mrpt::maps::CHeightGridMap2D_Base::dem_get_z
virtual bool dem_get_z(const double x, const double y, double &z_out) const =0
Get cell 'z' (x,y) by metric coordinates.
mrpt::maps::CHeightGridMap2D_Base::intersectLine3D
bool intersectLine3D(const mrpt::math::TLine3D &r1, mrpt::math::TObject3D &obj) const
Gets the intersection between a 3D line and a Height Grid map (taking into account the different heig...
Definition: CHeightGridMap2D_Base.cpp:57



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020