28 #ifndef UTIL3D_MAPPING_H_ 29 #define UTIL3D_MAPPING_H_ 33 #include <opencv2/core/core.hpp> 36 #include <pcl/pcl_base.h> 37 #include <pcl/point_cloud.h> 38 #include <pcl/point_types.h> 51 bool unknownSpaceFilled =
false,
52 float scanMaxRange = 0.0f),
"Use interface with \"viewpoint\" parameter to make sure the ray tracing origin is from the sensor and not the base.");
56 const cv::Point3f & viewpoint,
60 bool unknownSpaceFilled =
false,
61 float scanMaxRange = 0.0f),
"Use interface with scanHit/scanNoHit parameters: scanNoHit set to null matrix has the same functionality than this method.");
64 const cv::Mat & scanHit,
65 const cv::Mat & scanNoHit,
66 const cv::Point3f & viewpoint,
70 bool unknownSpaceFilled =
false,
71 float scanMaxRange = 0.0f);
74 const std::map<int, Transform> & poses,
75 const std::map<
int, std::pair<cv::Mat, cv::Mat> > & occupancy,
79 float minMapSize = 0.0f,
81 float footprintRadius = 0.0f);
84 const std::map<
int, pcl::PointCloud<pcl::PointXYZ>::Ptr > & scans,
86 bool unknownSpaceFilled,
89 float minMapSize = 0.0f,
90 float scanMaxRange = 0.0f),
"Use interface with \"viewpoints\" parameter to make sure the ray tracing origin is from the sensor and not the base.");
93 const std::map<
int, pcl::PointCloud<pcl::PointXYZ>::Ptr > & scans,
94 const std::map<int, cv::Point3f > & viewpoints,
96 bool unknownSpaceFilled,
99 float minMapSize = 0.0f,
100 float scanMaxRange = 0.0f),
"Use interface with cv::Mat scans.");
118 const std::map<
int, std::pair<cv::Mat, cv::Mat> > & scans,
119 const std::map<int, cv::Point3f > & viewpoints,
121 bool unknownSpaceFilled,
124 float minMapSize = 0.0f,
125 float scanMaxRange = 0.0f);
128 const cv::Point2i & end,
130 bool stopOnObstacle);
137 template<
typename Po
intT>
139 const typename pcl::PointCloud<PointT> & cloud);
142 template<
typename Po
intT>
144 const typename pcl::PointCloud<PointT>::Ptr & cloud,
145 const pcl::IndicesPtr & indices,
146 pcl::IndicesPtr & ground,
147 pcl::IndicesPtr & obstacles,
149 float groundNormalAngle,
152 bool segmentFlatObstacles =
false,
153 float maxGroundHeight = 0.0f,
154 pcl::IndicesPtr * flatObstacles = 0,
155 const Eigen::Vector4f & viewPoint = Eigen::Vector4f(0,0,100,0),
156 float groundNormalsUp = 0);
157 template<
typename Po
intT>
159 const typename pcl::PointCloud<PointT>::Ptr & cloud,
160 pcl::IndicesPtr & ground,
161 pcl::IndicesPtr & obstacles,
163 float groundNormalAngle,
166 bool segmentFlatObstacles =
false,
167 float maxGroundHeight = 0.0f,
168 pcl::IndicesPtr * flatObstacles = 0,
169 const Eigen::Vector4f & viewPoint = Eigen::Vector4f(0,0,100,0),
170 float groundNormalsUp = 0);
172 template<
typename Po
intT>
174 const typename pcl::PointCloud<PointT>::Ptr & cloud,
175 const pcl::IndicesPtr & groundIndices,
176 const pcl::IndicesPtr & obstaclesIndices,
181 template<
typename Po
intT>
183 const typename pcl::PointCloud<PointT>::Ptr & groundCloud,
184 const typename pcl::PointCloud<PointT>::Ptr & obstaclesCloud,
189 template<
typename Po
intT>
191 const typename pcl::PointCloud<PointT>::Ptr & cloud,
194 float cellSize = 0.05f,
195 float groundNormalAngle = M_PI_4,
196 int minClusterSize = 20,
197 bool segmentFlatObstacles =
false,
198 float maxGroundHeight = 0.0f);
199 template<
typename Po
intT>
201 const typename pcl::PointCloud<PointT>::Ptr & cloud,
202 const pcl::IndicesPtr & indices,
205 float cellSize = 0.05f,
206 float groundNormalAngle = M_PI_4,
207 int minClusterSize = 20,
208 bool segmentFlatObstacles =
false,
209 float maxGroundHeight = 0.0f);
cv::Mat RTABMAP_EXP erodeMap(const cv::Mat &map)
cv::Mat RTABMAP_EXP create2DMapFromOccupancyLocalMaps(const std::map< int, Transform > &poses, const std::map< int, std::pair< cv::Mat, cv::Mat > > &occupancy, float cellSize, float &xMin, float &yMin, float minMapSize=0.0f, bool erode=false, float footprintRadius=0.0f)
cv::Mat RTABMAP_EXP create2DMap(const std::map< int, Transform > &poses, const std::map< int, std::pair< cv::Mat, cv::Mat > > &scans, const std::map< int, cv::Point3f > &viewpoints, float cellSize, bool unknownSpaceFilled, float &xMin, float &yMin, float minMapSize=0.0f, float scanMaxRange=0.0f)
void RTABMAP_EXP occupancy2DFromLaserScan(const cv::Mat &scanHit, const cv::Mat &scanNoHit, const cv::Point3f &viewpoint, cv::Mat &empty, cv::Mat &occupied, float cellSize, bool unknownSpaceFilled=false, float scanMaxRange=0.0f)
RTABMAP_DEPRECATED(pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP cloudFromDepth(const cv::Mat &imageDepth, float cx, float cy, float fx, float fy, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0), "Use cloudFromDepth with CameraModel interface.")
cv::Mat RTABMAP_EXP convertImage8U2Map(const cv::Mat &map8U, bool pgmFormat=false)
cv::Mat RTABMAP_EXP convertMap2Image8U(const cv::Mat &map8S, bool pgmFormat=false)
void occupancy2DFromCloud3D(const typename pcl::PointCloud< PointT >::Ptr &cloud, const pcl::IndicesPtr &indices, cv::Mat &ground, cv::Mat &obstacles, float cellSize, float groundNormalAngle, int minClusterSize, bool segmentFlatObstacles, float maxGroundHeight)
void segmentObstaclesFromGround(const typename pcl::PointCloud< PointT >::Ptr &cloud, const typename pcl::IndicesPtr &indices, pcl::IndicesPtr &ground, pcl::IndicesPtr &obstacles, int normalKSearch, float groundNormalAngle, float clusterRadius, int minClusterSize, bool segmentFlatObstacles, float maxGroundHeight, pcl::IndicesPtr *flatObstacles, const Eigen::Vector4f &viewPoint, float groundNormalsUp)
void RTABMAP_EXP rayTrace(const cv::Point2i &start, const cv::Point2i &end, cv::Mat &grid, bool stopOnObstacle)
pcl::PointCloud< PointT >::Ptr projectCloudOnXYPlane(const typename pcl::PointCloud< PointT > &cloud)
void occupancy2DFromGroundObstacles(const typename pcl::PointCloud< PointT >::Ptr &cloud, const pcl::IndicesPtr &groundIndices, const pcl::IndicesPtr &obstaclesIndices, cv::Mat &ground, cv::Mat &obstacles, float cellSize)