mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Fixed windows build
This commit is contained in:
@@ -228,7 +228,7 @@ float getDepth(
|
|||||||
int u_end = std::min(u+1, depthImage.cols-1);
|
int u_end = std::min(u+1, depthImage.cols-1);
|
||||||
int v_end = std::min(v+1, depthImage.rows-1);
|
int v_end = std::min(v+1, depthImage.rows-1);
|
||||||
|
|
||||||
float depth = isInMM?(float)depthImage.at<uint16_t>(v,u)*0.001f:depthImage.at<float>(v,u);
|
float depth = isInMM?(float)depthImage.at<unsigned short>(v,u)*0.001f:depthImage.at<float>(v,u);
|
||||||
if(depth!=0.0f && uIsFinite(depth))
|
if(depth!=0.0f && uIsFinite(depth))
|
||||||
{
|
{
|
||||||
if(smoothing)
|
if(smoothing)
|
||||||
@@ -241,7 +241,7 @@ float getDepth(
|
|||||||
{
|
{
|
||||||
if(!(uu == u && vv == v))
|
if(!(uu == u && vv == v))
|
||||||
{
|
{
|
||||||
float d = isInMM?(float)depthImage.at<uint16_t>(vv,uu)*0.001f:depthImage.at<float>(vv,uu);
|
float d = isInMM?(float)depthImage.at<unsigned short>(vv,uu)*0.001f:depthImage.at<float>(vv,uu);
|
||||||
// ignore if not valid or depth difference is too high
|
// ignore if not valid or depth difference is too high
|
||||||
if(d != 0.0f && uIsFinite(d) && fabs(d - depth) < maxZError)
|
if(d != 0.0f && uIsFinite(d) && fabs(d - depth) < maxZError)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,10 +52,8 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr voxelize(
|
|||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
float voxelSize)
|
float voxelSize)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
|
|
||||||
typedef typename PointCloud::Ptr PointCloudPtr;
|
|
||||||
UASSERT(voxelSize > 0.0f);
|
UASSERT(voxelSize > 0.0f);
|
||||||
PointCloudPtr output(new PointCloud);
|
pcl::PointCloud<pcl::PointXYZ>::Ptr output(new pcl::PointCloud<pcl::PointXYZ>);
|
||||||
pcl::VoxelGrid<pcl::PointXYZ> filter;
|
pcl::VoxelGrid<pcl::PointXYZ> filter;
|
||||||
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
||||||
filter.setInputCloud(cloud);
|
filter.setInputCloud(cloud);
|
||||||
@@ -66,10 +64,8 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr voxelize(
|
|||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
float voxelSize)
|
float voxelSize)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;
|
|
||||||
typedef typename PointCloud::Ptr PointCloudPtr;
|
|
||||||
UASSERT(voxelSize > 0.0f);
|
UASSERT(voxelSize > 0.0f);
|
||||||
PointCloudPtr output(new PointCloud);
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
pcl::VoxelGrid<pcl::PointXYZRGB> filter;
|
pcl::VoxelGrid<pcl::PointXYZRGB> filter;
|
||||||
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
||||||
filter.setInputCloud(cloud);
|
filter.setInputCloud(cloud);
|
||||||
@@ -81,10 +77,8 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr voxelize(
|
|||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr sampling(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr sampling(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud, int samples)
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud, int samples)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
|
|
||||||
typedef typename PointCloud::Ptr PointCloudPtr;
|
|
||||||
UASSERT(samples > 0);
|
UASSERT(samples > 0);
|
||||||
PointCloudPtr output(new PointCloud);
|
pcl::PointCloud<pcl::PointXYZ>::Ptr output(new pcl::PointCloud<pcl::PointXYZ>);
|
||||||
pcl::RandomSample<pcl::PointXYZ> filter;
|
pcl::RandomSample<pcl::PointXYZ> filter;
|
||||||
filter.setSample(samples);
|
filter.setSample(samples);
|
||||||
filter.setInputCloud(cloud);
|
filter.setInputCloud(cloud);
|
||||||
@@ -94,10 +88,8 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr sampling(
|
|||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr sampling(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr sampling(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud, int samples)
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud, int samples)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;
|
|
||||||
typedef typename PointCloud::Ptr PointCloudPtr;
|
|
||||||
UASSERT(samples > 0);
|
UASSERT(samples > 0);
|
||||||
PointCloudPtr output(new PointCloud);
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
pcl::RandomSample<pcl::PointXYZRGB> filter;
|
pcl::RandomSample<pcl::PointXYZRGB> filter;
|
||||||
filter.setSample(samples);
|
filter.setSample(samples);
|
||||||
filter.setInputCloud(cloud);
|
filter.setInputCloud(cloud);
|
||||||
@@ -112,12 +104,10 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr passThrough(
|
|||||||
float min,
|
float min,
|
||||||
float max)
|
float max)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
|
|
||||||
typedef typename PointCloud::Ptr PointCloudPtr;
|
|
||||||
UASSERT(max > min);
|
UASSERT(max > min);
|
||||||
UASSERT(axis.compare("x") == 0 || axis.compare("y") == 0 || axis.compare("z") == 0);
|
UASSERT(axis.compare("x") == 0 || axis.compare("y") == 0 || axis.compare("z") == 0);
|
||||||
|
|
||||||
PointCloudPtr output(new PointCloud);
|
pcl::PointCloud<pcl::PointXYZ>::Ptr output(new pcl::PointCloud<pcl::PointXYZ>);
|
||||||
pcl::PassThrough<pcl::PointXYZ> filter;
|
pcl::PassThrough<pcl::PointXYZ> filter;
|
||||||
filter.setFilterFieldName(axis);
|
filter.setFilterFieldName(axis);
|
||||||
filter.setFilterLimits(min, max);
|
filter.setFilterLimits(min, max);
|
||||||
@@ -132,12 +122,10 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr passThrough(
|
|||||||
float min,
|
float min,
|
||||||
float max)
|
float max)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;
|
|
||||||
typedef typename PointCloud::Ptr PointCloudPtr;
|
|
||||||
UASSERT(max > min);
|
UASSERT(max > min);
|
||||||
UASSERT(axis.compare("x") == 0 || axis.compare("y") == 0 || axis.compare("z") == 0);
|
UASSERT(axis.compare("x") == 0 || axis.compare("y") == 0 || axis.compare("z") == 0);
|
||||||
|
|
||||||
PointCloudPtr output(new PointCloud);
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
pcl::PassThrough<pcl::PointXYZRGB> filter;
|
pcl::PassThrough<pcl::PointXYZRGB> filter;
|
||||||
filter.setFilterFieldName(axis);
|
filter.setFilterFieldName(axis);
|
||||||
filter.setFilterLimits(min, max);
|
filter.setFilterLimits(min, max);
|
||||||
@@ -208,9 +196,7 @@ pcl::IndicesPtr radiusFiltering(
|
|||||||
float radiusSearch,
|
float radiusSearch,
|
||||||
int minNeighborsInRadius)
|
int minNeighborsInRadius)
|
||||||
{
|
{
|
||||||
typedef pcl::search::KdTree<pcl::PointXYZ> KdTree;
|
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>(false));
|
||||||
typedef typename KdTree::Ptr KdTreePtr;
|
|
||||||
KdTreePtr tree (new KdTree(false));
|
|
||||||
|
|
||||||
if(indices->size())
|
if(indices->size())
|
||||||
{
|
{
|
||||||
@@ -255,9 +241,7 @@ pcl::IndicesPtr radiusFiltering(
|
|||||||
float radiusSearch,
|
float radiusSearch,
|
||||||
int minNeighborsInRadius)
|
int minNeighborsInRadius)
|
||||||
{
|
{
|
||||||
typedef pcl::search::KdTree<pcl::PointXYZRGB> KdTree;
|
pcl::search::KdTree<pcl::PointXYZRGB>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZRGB>(false));
|
||||||
typedef typename KdTree::Ptr KdTreePtr;
|
|
||||||
KdTreePtr tree (new KdTree(false));
|
|
||||||
|
|
||||||
if(indices->size())
|
if(indices->size())
|
||||||
{
|
{
|
||||||
@@ -583,7 +567,7 @@ pcl::IndicesPtr extractNegativeIndices(
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
pcl::IndicesPtr extractNegativeIndices(
|
pcl::IndicesPtr extractNegativeIndices(
|
||||||
const typename pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices)
|
const pcl::IndicesPtr & indices)
|
||||||
{
|
{
|
||||||
pcl::IndicesPtr output(new std::vector<int>);
|
pcl::IndicesPtr output(new std::vector<int>);
|
||||||
|
|||||||
@@ -36,22 +36,18 @@ namespace util3d
|
|||||||
{
|
{
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr transformPointCloud(
|
||||||
const typename pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const Transform & transform)
|
const Transform & transform)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
|
pcl::PointCloud<pcl::PointXYZ>::Ptr output(new pcl::PointCloud<pcl::PointXYZ>);
|
||||||
typedef PointCloud::Ptr PointCloudPtr;
|
|
||||||
PointCloudPtr output(new PointCloud);
|
|
||||||
pcl::transformPointCloud(*cloud, *output, transform.toEigen4f());
|
pcl::transformPointCloud(*cloud, *output, transform.toEigen4f());
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr transformPointCloud(
|
||||||
const typename pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const Transform & transform)
|
const Transform & transform)
|
||||||
{
|
{
|
||||||
typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
typedef PointCloud::Ptr PointCloudPtr;
|
|
||||||
PointCloudPtr output(new PointCloud);
|
|
||||||
pcl::transformPointCloud(*cloud, *output, transform.toEigen4f());
|
pcl::transformPointCloud(*cloud, *output, transform.toEigen4f());
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user