mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Fixed build with PCL < 1.7.2, fixed some warnings
This commit is contained in:
@@ -171,7 +171,7 @@ pcl::TextureMesh::Ptr createTextureMesh(
|
|||||||
|
|
||||||
// Create materials for each texture (and one extra for occluded faces)
|
// Create materials for each texture (and one extra for occluded faces)
|
||||||
textureMesh->tex_materials.resize (cameras.size () + 1);
|
textureMesh->tex_materials.resize (cameras.size () + 1);
|
||||||
for(int i = 0 ; i <= cameras.size() ; ++i)
|
for(unsigned int i = 0 ; i <= cameras.size() ; ++i)
|
||||||
{
|
{
|
||||||
pcl::TexMaterial mesh_material;
|
pcl::TexMaterial mesh_material;
|
||||||
mesh_material.tex_Ka.r = 0.2f;
|
mesh_material.tex_Ka.r = 0.2f;
|
||||||
|
|||||||
@@ -597,6 +597,7 @@ bool CloudViewer::addCloudTextureMesh(
|
|||||||
const pcl::TextureMesh::Ptr & textureMesh,
|
const pcl::TextureMesh::Ptr & textureMesh,
|
||||||
const Transform & pose)
|
const Transform & pose)
|
||||||
{
|
{
|
||||||
|
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
|
||||||
if(!_addedClouds.contains(id))
|
if(!_addedClouds.contains(id))
|
||||||
{
|
{
|
||||||
UDEBUG("Adding %s", id.c_str());
|
UDEBUG("Adding %s", id.c_str());
|
||||||
@@ -607,6 +608,8 @@ bool CloudViewer::addCloudTextureMesh(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
// not implemented on lower version of PCL
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4782,11 +4782,11 @@ bool MainWindow::getExportedClouds(
|
|||||||
std::map<int, Transform> cameraPoses;
|
std::map<int, Transform> cameraPoses;
|
||||||
std::map<int, CameraModel> cameraModels;
|
std::map<int, CameraModel> cameraModels;
|
||||||
std::map<int, cv::Mat> images;
|
std::map<int, cv::Mat> images;
|
||||||
for(std::map<int, Transform>::iterator iter=cameras.begin(); iter!=cameras.end(); ++iter)
|
for(std::map<int, Transform>::iterator jter=cameras.begin(); jter!=cameras.end(); ++jter)
|
||||||
{
|
{
|
||||||
if(_cachedSignatures.contains(iter->first))
|
if(_cachedSignatures.contains(jter->first))
|
||||||
{
|
{
|
||||||
const Signature & s = _cachedSignatures.value(iter->first);
|
const Signature & s = _cachedSignatures.value(jter->first);
|
||||||
CameraModel model;
|
CameraModel model;
|
||||||
if(s.sensorData().stereoCameraModel().isValid())
|
if(s.sensorData().stereoCameraModel().isValid())
|
||||||
{
|
{
|
||||||
@@ -4801,11 +4801,11 @@ bool MainWindow::getExportedClouds(
|
|||||||
{
|
{
|
||||||
s.sensorData().uncompressDataConst(&image, 0, 0, 0);
|
s.sensorData().uncompressDataConst(&image, 0, 0, 0);
|
||||||
}
|
}
|
||||||
if(!iter->second.isNull() && model.isValid() && !image.empty())
|
if(!jter->second.isNull() && model.isValid() && !image.empty())
|
||||||
{
|
{
|
||||||
cameraPoses.insert(std::make_pair(iter->first, iter->second));
|
cameraPoses.insert(std::make_pair(jter->first, jter->second));
|
||||||
cameraModels.insert(std::make_pair(iter->first, model));
|
cameraModels.insert(std::make_pair(jter->first, model));
|
||||||
images.insert(std::make_pair(iter->first, image));
|
images.insert(std::make_pair(jter->first, image));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user