RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
LocalGridMaker.h
1/*
2Copyright (c) 2010-2023, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the Universite de Sherbrooke nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef SRC_LOCAL_MAP_H_
29#define SRC_LOCAL_MAP_H_
30
31#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
32
33#include <pcl/pcl_base.h>
34#include <pcl/point_types.h>
35
36#include <rtabmap/core/Transform.h>
37#include <rtabmap/core/Parameters.h>
38#include <rtabmap/core/Signature.h>
39
40namespace rtabmap {
41
64class RTABMAP_CORE_EXPORT LocalGridMaker
65{
66public:
69 virtual ~LocalGridMaker();
70
72 virtual void parseParameters(const ParametersMap & parameters);
73
75 float getCellSize() const {return cellSize_;}
77 bool isGridFromDepth() const {return occupancySensor_;}
79 bool isMapFrameProjection() const {return projMapFrame_;}
80
97 template<typename PointT>
98 typename pcl::PointCloud<PointT>::Ptr segmentCloud(
99 const typename pcl::PointCloud<PointT>::Ptr & cloud,
100 const pcl::IndicesPtr & indices,
101 const Transform & pose,
102 const cv::Point3f & viewPoint,
103 pcl::IndicesPtr & groundIndices, // output cloud indices
104 pcl::IndicesPtr & obstaclesIndices, // output cloud indices
105 pcl::IndicesPtr * flatObstacles = 0) const; // output cloud indices
106
124 const Signature & node,
125 cv::Mat & groundCells,
126 cv::Mat & obstacleCells,
127 cv::Mat & emptyCells,
128 cv::Point3f & viewPoint);
129
144 const LaserScan & cloud,
145 const Transform & pose,
146 cv::Mat & groundCells,
147 cv::Mat & obstacleCells,
148 cv::Mat & emptyCells,
149 cv::Point3f & viewPointInOut) const;
150
151protected:
152 ParametersMap parameters_;
153
154 unsigned int cloudDecimation_;
155 float rangeMax_;
156 float rangeMin_;
157 std::vector<float> roiRatios_;
158 float footprintLength_;
159 float footprintWidth_;
160 float footprintHeight_;
161 int scanDecimation_;
162 float cellSize_;
163 bool preVoxelFiltering_;
164 int occupancySensor_;
165 bool projMapFrame_;
166 float maxObstacleHeight_;
167 int normalKSearch_;
168 float groundNormalsUp_;
169 float maxGroundAngle_;
170 float clusterRadius_;
171 int minClusterSize_;
172 bool flatObstaclesDetected_;
173 float minGroundHeight_;
174 float maxGroundHeight_;
175 bool normalsSegmentation_;
176 bool grid3D_;
177 bool groundIsObstacle_;
178 float noiseFilteringRadius_;
179 int noiseFilteringMinNeighbors_;
180 bool scan2dUnknownSpaceFilled_;
181 bool rayTracing_;
182};
183
184} /* namespace rtabmap */
185
186#include <rtabmap/core/impl/LocalMapMaker.hpp>
187
188#endif /* SRC_LOCAL_MAP_H_ */
Represents 2D or 3D laser scan data with support for multiple point data formats.
Definition LaserScan.h:46
Builds per-node local occupancy grids from laser scans or depth clouds.
void createLocalMap(const LaserScan &cloud, const Transform &pose, cv::Mat &groundCells, cv::Mat &obstacleCells, cv::Mat &emptyCells, cv::Point3f &viewPointInOut) const
Creates a local grid from a 3D (or organized) LaserScan.
virtual void parseParameters(const ParametersMap &parameters)
Updates grid settings from Grid/ entries in parameters.
LocalGridMaker(const ParametersMap &parameters=ParametersMap())
Constructs with parseParameters() on parameters (or defaults).
void createLocalMap(const Signature &node, cv::Mat &groundCells, cv::Mat &obstacleCells, cv::Mat &emptyCells, cv::Point3f &viewPoint)
Creates a local grid from a Signature's laser scan or depth data.
bool isMapFrameProjection() const
Represents a node in RTAB-Map's pose graph.
Definition Signature.h:84
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53
std::map< std::string, std::string > ParametersMap
Parameter keys mapped to their values, as used by every configurable class (see Parameters).
Definition Parameters.h:44