RTAB-Map 0.23.10
Loading...
Searching...
No Matches
util3d.h
1/*
2Copyright (c) 2010-2025, 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 UTIL3D_H_
29#define UTIL3D_H_
30
31#include "rtabmap/core/rtabmap_core_export.h"
32
33#include <pcl/point_cloud.h>
34#include <pcl/point_types.h>
35#include <pcl/pcl_base.h>
36#include <pcl/TextureMesh.h>
37#include <rtabmap/core/Transform.h>
38#include <rtabmap/core/SensorData.h>
39#include <rtabmap/core/Parameters.h>
40#include <opencv2/core/core.hpp>
41#include <rtabmap/core/ProgressState.h>
42#include <cstdint>
43#include <map>
44#include <list>
45
46namespace rtabmap
47{
48
53// Point type carrying xyz + intensity + ring (laser line index) + time
54// (per-point acquisition offset, seconds from the scan start). Matches the
55// layout expected by LIO-SAM's Velodyne feature extractor so it can be fed
56// directly via util3d::laserScanFromPointCloud().
57struct EIGEN_ALIGN16 PointXYZIRT
58{
59 PCL_ADD_POINT4D;
60 float intensity;
61 std::uint16_t ring;
62 float time;
63 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
64};
65
66namespace util3d
67{
68
85cv::Mat RTABMAP_CORE_EXPORT rgbFromCloud(
86 const pcl::PointCloud<pcl::PointXYZRGBA> & cloud,
87 bool bgrOrder = true);
88
103cv::Mat RTABMAP_CORE_EXPORT depthFromCloud(
104 const pcl::PointCloud<pcl::PointXYZRGBA> & cloud,
105 bool depth16U = true);
106
122void RTABMAP_CORE_EXPORT rgbdFromCloud(
123 const pcl::PointCloud<pcl::PointXYZRGBA> & cloud,
124 cv::Mat & rgb,
125 cv::Mat & depth,
126 bool bgrOrder = true,
127 bool depth16U = true);
128
147pcl::PointXYZ RTABMAP_CORE_EXPORT projectDepthTo3D(
148 const cv::Mat & depthImage,
149 float x, float y,
150 float cx, float cy,
151 float fx, float fy,
152 bool smoothing,
153 float depthErrorRatio = 0.02f);
154
171Eigen::Vector3f RTABMAP_CORE_EXPORT projectDepthTo3DRay(
172 const cv::Size & imageSize,
173 float x, float y,
174 float cx, float cy,
175 float fx, float fy);
176
199RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDepth(
200 const cv::Mat & imageDepth,
201 float cx, float cy,
202 float fx, float fy,
203 int decimation = 1,
204 float maxDepth = 0.0f,
205 float minDepth = 0.0f,
206 std::vector<int> * validIndices = 0);
222pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDepth(
223 const cv::Mat & imageDepth,
224 const CameraModel & model,
225 int decimation = 1,
226 float maxDepth = 0.0f,
227 float minDepth = 0.0f,
228 std::vector<int> * validIndices = 0);
229pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDepth(
230 const cv::Mat & imageDepth,
231 const cv::Mat & imageDepthConfidence,
232 const CameraModel & model,
233 int decimation = 1,
234 float maxDepth = 0.0f,
235 float minDepth = 0.0f,
236 unsigned char confidenceThr = 0,
237 std::vector<int> * validIndices = 0);
238
264RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB(
265 const cv::Mat & imageRgb,
266 const cv::Mat & imageDepth,
267 float cx, float cy,
268 float fx, float fy,
269 int decimation = 1,
270 float maxDepth = 0.0f,
271 float minDepth = 0.0f,
272 std::vector<int> * validIndices = 0);
273
295pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB(
296 const cv::Mat & imageRgb,
297 const cv::Mat & imageDepth,
298 const CameraModel & model,
299 int decimation = 1,
300 float maxDepth = 0.0f,
301 float minDepth = 0.0f,
302 std::vector<int> * validIndices = 0);
303pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB(
304 const cv::Mat & imageRgb,
305 const cv::Mat & imageDepth,
306 const cv::Mat & imageDepthConfidence,
307 const CameraModel & model,
308 int decimation = 1,
309 float maxDepth = 0.0f,
310 float minDepth = 0.0f,
311 unsigned char confidenceThr = 0, // 0=low, 100=high
312 std::vector<int> * validIndices = 0);
313
343pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDisparity(
344 const cv::Mat & imageDisparity,
345 const StereoCameraModel & model,
346 int decimation = 1,
347 float maxDepth = 0.0f,
348 float minDepth = 0.0f,
349 std::vector<int> * validIndices = 0);
350
384pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDisparityRGB(
385 const cv::Mat & imageRgb,
386 const cv::Mat & imageDisparity,
387 const StereoCameraModel & model,
388 int decimation = 1,
389 float maxDepth = 0.0f,
390 float minDepth = 0.0f,
391 std::vector<int> * validIndices = 0);
392
429pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromStereoImages(
430 const cv::Mat & imageLeft,
431 const cv::Mat & imageRight,
432 const StereoCameraModel & model,
433 int decimation = 1,
434 float maxDepth = 0.0f,
435 float minDepth = 0.0f,
436 std::vector<int> * validIndices = 0,
437 const ParametersMap & parameters = ParametersMap());
438
477std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> RTABMAP_CORE_EXPORT cloudsFromSensorData(
478 const SensorData & sensorData,
479 int decimation = 1,
480 float maxDepth = 0.0f,
481 float minDepth = 0.0f,
482 std::vector<pcl::IndicesPtr> * validIndices = 0,
483 const ParametersMap & stereoParameters = ParametersMap(),
484 const std::vector<float> & roiRatios = std::vector<float>(), // ignored for stereo
485 unsigned char confidenceThr = 0); // ignored for stereo
486
515pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromSensorData(
516 const SensorData & sensorData,
517 int decimation = 1,
518 float maxDepth = 0.0f,
519 float minDepth = 0.0f,
520 std::vector<int> * validIndices = 0,
521 const ParametersMap & stereoParameters = ParametersMap(),
522 const std::vector<float> & roiRatios = std::vector<float>(), // ignored for stereo
523 unsigned char confidenceThr = 0); // ignored for stereo
524
557std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> RTABMAP_CORE_EXPORT cloudsRGBFromSensorData(
558 const SensorData & sensorData,
559 int decimation = 1,
560 float maxDepth = 0.0f,
561 float minDepth = 0.0f,
562 std::vector<pcl::IndicesPtr > * validIndices = 0,
563 const ParametersMap & stereoParameters = ParametersMap(),
564 const std::vector<float> & roiRatios = std::vector<float>(), // ignored for stereo
565 unsigned char confidenceThr = 0); // ignored for stereo
566
593pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudRGBFromSensorData(
594 const SensorData & sensorData,
595 int decimation = 1,
596 float maxDepth = 0.0f,
597 float minDepth = 0.0f,
598 std::vector<int> * validIndices = 0,
599 const ParametersMap & stereoParameters = ParametersMap(),
600 const std::vector<float> & roiRatios = std::vector<float>(), // ignored for stereo
601 unsigned char confidenceThr = 0); // ignored for stereo
602
625pcl::PointCloud<pcl::PointXYZ> RTABMAP_CORE_EXPORT laserScanFromDepthImage(
626 const cv::Mat & depthImage,
627 float fx,
628 float fy,
629 float cx,
630 float cy,
631 float maxDepth = 0,
632 float minDepth = 0,
633 const Transform & localTransform = Transform::getIdentity());
653pcl::PointCloud<pcl::PointXYZ> RTABMAP_CORE_EXPORT laserScanFromDepthImages(
654 const cv::Mat & depthImages,
655 const std::vector<CameraModel> & cameraModels,
656 float maxDepth,
657 float minDepth);
658
689LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
694LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
699LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
704LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
709LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
714LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
719LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
724LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
729LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
734LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<rtabmap::PointXYZIRT> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
739LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<rtabmap::PointXYZIRT> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
744LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
749LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
754LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
759LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
764LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZINormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
769LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZINormal> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
770
775template<typename PointCloud2T>
776LaserScan laserScanFromPointCloud(const PointCloud2T & cloud, bool filterNaNs = true, bool is2D = false, const Transform & transform = Transform());
777
802LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
807LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
812LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
817LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
822LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZINormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
827LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
828
845pcl::PCLPointCloud2::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud2(const LaserScan & laserScan, const Transform & transform = Transform());
846pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud(const LaserScan & laserScan, const Transform & transform = Transform());
847pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudNormal(const LaserScan & laserScan, const Transform & transform = Transform());
848pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudRGB(const LaserScan & laserScan, const Transform & transform = Transform(), unsigned char r = 100, unsigned char g = 100, unsigned char b = 100);
849pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudI(const LaserScan & laserScan, const Transform & transform = Transform(), float intensity = 0.0f);
850pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudRGBNormal(const LaserScan & laserScan, const Transform & transform = Transform(), unsigned char r = 100, unsigned char g = 100, unsigned char b = 100);
851pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudINormal(const LaserScan & laserScan, const Transform & transform = Transform(), float intensity = 0.0f);
852
853
854pcl::PointXYZ RTABMAP_CORE_EXPORT laserScanToPoint(const LaserScan & laserScan, int index);
855pcl::PointNormal RTABMAP_CORE_EXPORT laserScanToPointNormal(const LaserScan & laserScan, int index);
856pcl::PointXYZRGB RTABMAP_CORE_EXPORT laserScanToPointRGB(const LaserScan & laserScan, int index, unsigned char r = 100, unsigned char g = 100, unsigned char b = 100);
857pcl::PointXYZI RTABMAP_CORE_EXPORT laserScanToPointI(const LaserScan & laserScan, int index, float intensity);
858pcl::PointXYZRGBNormal RTABMAP_CORE_EXPORT laserScanToPointRGBNormal(const LaserScan & laserScan, int index, unsigned char r, unsigned char g, unsigned char b);
859pcl::PointXYZINormal RTABMAP_CORE_EXPORT laserScanToPointINormal(const LaserScan & laserScan, int index, float intensity);
860
882void RTABMAP_CORE_EXPORT getMinMax3D(const cv::Mat & laserScan, cv::Point3f & min, cv::Point3f & max);
883
897void RTABMAP_CORE_EXPORT getMinMax3D(const cv::Mat & laserScan, pcl::PointXYZ & min, pcl::PointXYZ & max);
898
921cv::Point3f RTABMAP_CORE_EXPORT projectDisparityTo3D(
922 const cv::Point2f & pt,
923 float disparity,
924 const StereoCameraModel & model);
925
944cv::Point3f RTABMAP_CORE_EXPORT projectDisparityTo3D(
945 const cv::Point2f & pt,
946 const cv::Mat & disparity,
947 const StereoCameraModel & model);
948
969cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera(
970 const cv::Size & imageSize,
971 const cv::Mat & cameraMatrixK,
972 const cv::Mat & laserScan,
973 const rtabmap::Transform & cameraTransform);
974
995cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera(
996 const cv::Size & imageSize,
997 const cv::Mat & cameraMatrixK,
998 const pcl::PointCloud<pcl::PointXYZ>::Ptr laserScan,
999 const rtabmap::Transform & cameraTransform);
1000
1021cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera(
1022 const cv::Size & imageSize,
1023 const cv::Mat & cameraMatrixK,
1024 const pcl::PCLPointCloud2::Ptr laserScan,
1025 const rtabmap::Transform & cameraTransform);
1026
1046void RTABMAP_CORE_EXPORT fillProjectedCloudHoles(
1047 cv::Mat & depthRegistered,
1048 bool verticalDirection,
1049 bool fillToBorder);
1050
1079cv::Mat RTABMAP_CORE_EXPORT filterFloor(
1080 const cv::Mat & depth,
1081 const std::vector<CameraModel> & cameraModels,
1082 float threshold,
1083 cv::Mat * depthBelow = 0);
1084
1105std::vector<std::pair< std::pair<int, int>, pcl::PointXY> > RTABMAP_CORE_EXPORT projectCloudToCameras (
1106 const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud,
1107 const std::map<int, Transform> & cameraPoses,
1108 const std::map<int, std::vector<CameraModel> > & cameraModels,
1109 float maxDistance = 0.0f,
1110 float maxAngle = 0.0f,
1111 float maxDepthError = 0.0f,
1112 const std::vector<float> & roiRatios = std::vector<float>(),
1113 const cv::Mat & projMask = cv::Mat(),
1114 bool distanceToCamPolicy = false,
1115 const ProgressState * state = 0);
1136std::vector<std::pair< std::pair<int, int>, pcl::PointXY> > RTABMAP_CORE_EXPORT projectCloudToCameras (
1137 const pcl::PointCloud<pcl::PointXYZINormal> & cloud,
1138 const std::map<int, Transform> & cameraPoses,
1139 const std::map<int, std::vector<CameraModel> > & cameraModels,
1140 float maxDistance = 0.0f,
1141 float maxAngle = 0.0f,
1142 float maxDepthError = 0.0f,
1143 const std::vector<float> & roiRatios = std::vector<float>(),
1144 const cv::Mat & projMask = cv::Mat(),
1145 bool distanceToCamPolicy = false,
1146 const ProgressState * state = 0);
1147
1157bool RTABMAP_CORE_EXPORT isFinite(const cv::Point3f & pt);
1158
1168pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT concatenateClouds(
1169 const std::list<pcl::PointCloud<pcl::PointXYZ>::Ptr> & clouds);
1179pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT concatenateClouds(
1180 const std::list<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds);
1181
1196pcl::IndicesPtr RTABMAP_CORE_EXPORT concatenate(
1197 const std::vector<pcl::IndicesPtr> & indices);
1198
1213pcl::IndicesPtr RTABMAP_CORE_EXPORT concatenate(
1214 const pcl::IndicesPtr & indicesA,
1215 const pcl::IndicesPtr & indicesB);
1216
1228void RTABMAP_CORE_EXPORT savePCDWords(
1229 const std::string & fileName,
1230 const std::multimap<int, pcl::PointXYZ> & words,
1231 const Transform & transform = Transform::getIdentity());
1232
1244void RTABMAP_CORE_EXPORT savePCDWords(
1245 const std::string & fileName,
1246 const std::multimap<int, cv::Point3f> & words,
1247 const Transform & transform = Transform::getIdentity());
1248
1259cv::Mat RTABMAP_CORE_EXPORT loadBINScan(const std::string & fileName);
1268pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT loadBINCloud(const std::string & fileName);
1277RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT loadBINCloud(const std::string & fileName, int dim);
1278
1289LaserScan RTABMAP_CORE_EXPORT loadScan(const std::string & path);
1290
1304RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT loadCloud(
1305 const std::string & path,
1306 const Transform & transform = Transform::getIdentity(),
1307 int downsampleStep = 1,
1308 float voxelSize = 0.0f);
1309
1341LaserScan RTABMAP_CORE_EXPORT deskew(
1342 const LaserScan & input,
1343 double inputStamp,
1344 const rtabmap::Transform & velocity);
1345
1346} // namespace util3d
1347} // namespace rtabmap
1348
1349POINT_CLOUD_REGISTER_POINT_STRUCT(rtabmap::PointXYZIRT,
1350 (float, x, x)
1351 (float, y, y)
1352 (float, z, z)
1353 (float, intensity, intensity)
1354 (std::uint16_t, ring, ring)
1355 (float, time, time)
1356)
1357
1358#include "rtabmap/core/impl/util3d.hpp"
1359
1360#endif /* UTIL3D_H_ */
Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...
Definition CameraModel.h:53
Represents 2D or 3D laser scan data with support for multiple point data formats.
Definition LaserScan.h:46
Container class for all sensor data captured at a specific time.
Definition SensorData.h:97
A class representing a calibrated stereo camera system.
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53
static Transform getIdentity()
Returns identity transform.
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud< pcl::PointXYZ > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
PointXYZ → LaserScan::kXY
LaserScan laserScanFromPointCloud(const PointCloud2T &cloud, bool filterNaNs, bool is2D, const Transform &transform)
Convert pcl::PCLPointCloud2 to rtabmap::LaserScan with all supported fields (see rtabmap::LaserScan::...
Definition util3d.hpp:37
pcl::PCLPointCloud2::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud2(const LaserScan &laserScan, const Transform &transform=Transform())
Convert rtabmap::LaserScan to pcl::PCLPointCloud2 with all supported fields (see rtabmap::LaserScan::...
This namespace contains 3D point cloud processing utilities.
Definition util3d.h:58