mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
export tool: use pcl's PLY writer instead of pdal if camera ids are not exported (ply compatibility issue when reading back using pcl)
This commit is contained in:
@@ -1091,11 +1091,16 @@ int main(int argc, char * argv[])
|
|||||||
std::string outputPath=outputDirectory+"/"+baseName+"_cloud."+ext;
|
std::string outputPath=outputDirectory+"/"+baseName+"_cloud."+ext;
|
||||||
printf("Saving %s... (%d points)\n", outputPath.c_str(), !cloudToExport->empty()?(int)cloudToExport->size():(int)cloudIToExport->size());
|
printf("Saving %s... (%d points)\n", outputPath.c_str(), !cloudToExport->empty()?(int)cloudToExport->size():(int)cloudIToExport->size());
|
||||||
#ifdef RTABMAP_PDAL
|
#ifdef RTABMAP_PDAL
|
||||||
|
if(las || !pointToCamId.empty())
|
||||||
|
{
|
||||||
if(!cloudToExport->empty())
|
if(!cloudToExport->empty())
|
||||||
savePDALFile(outputPath, *cloudToExport, pointToCamId, binary);
|
savePDALFile(outputPath, *cloudToExport, pointToCamId, binary);
|
||||||
else if(!cloudIToExport->empty())
|
else if(!cloudIToExport->empty())
|
||||||
savePDALFile(outputPath, *cloudIToExport, pointToCamId, binary);
|
savePDALFile(outputPath, *cloudIToExport, pointToCamId, binary);
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
if(!pointToCamId.empty())
|
if(!pointToCamId.empty())
|
||||||
{
|
{
|
||||||
printf("Option --cam_projection is enabled but rtabmap is not built "
|
printf("Option --cam_projection is enabled but rtabmap is not built "
|
||||||
@@ -1105,7 +1110,7 @@ int main(int argc, char * argv[])
|
|||||||
pcl::io::savePLYFile(outputPath, *cloudToExport, binary);
|
pcl::io::savePLYFile(outputPath, *cloudToExport, binary);
|
||||||
else if(!cloudIToExport->empty())
|
else if(!cloudIToExport->empty())
|
||||||
pcl::io::savePLYFile(outputPath, *cloudIToExport, binary);
|
pcl::io::savePLYFile(outputPath, *cloudIToExport, binary);
|
||||||
#endif
|
}
|
||||||
printf("Saving %s... done!\n", outputPath.c_str());
|
printf("Saving %s... done!\n", outputPath.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user