mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-10 11:59:50 +08:00
Camera test view: show intensity/rgb/normals if input scans have them
This commit is contained in:
@@ -3262,6 +3262,7 @@ LaserScan loadScan(const std::string & path)
|
|||||||
if(cloud->fields[i].name.compare("z") == 0)
|
if(cloud->fields[i].name.compare("z") == 0)
|
||||||
{
|
{
|
||||||
zOffset = cloud->fields[i].offset;
|
zOffset = cloud->fields[i].offset;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(zOffset>=0)
|
if(zOffset>=0)
|
||||||
@@ -3283,7 +3284,6 @@ LaserScan loadScan(const std::string & path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return laserScanFromPointCloud(*cloud, true, is2D);
|
return laserScanFromPointCloud(*cloud, true, is2D);
|
||||||
}
|
}
|
||||||
return LaserScan();
|
return LaserScan();
|
||||||
|
|||||||
@@ -147,7 +147,33 @@ void CameraViewer::showImage(const rtabmap::SensorData & data)
|
|||||||
showScanCheckbox_->setEnabled(true);
|
showScanCheckbox_->setEnabled(true);
|
||||||
if(showScanCheckbox_->isChecked())
|
if(showScanCheckbox_->isChecked())
|
||||||
{
|
{
|
||||||
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloud(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
if(data.laserScanRaw().hasNormals())
|
||||||
|
{
|
||||||
|
if(data.laserScanRaw().hasIntensity())
|
||||||
|
{
|
||||||
|
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloudINormal(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
||||||
|
}
|
||||||
|
else if(data.laserScanRaw().hasRGB())
|
||||||
|
{
|
||||||
|
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloudRGBNormal(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloudNormal(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(data.laserScanRaw().hasIntensity())
|
||||||
|
{
|
||||||
|
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloudI(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
||||||
|
}
|
||||||
|
else if(data.laserScanRaw().hasRGB())
|
||||||
|
{
|
||||||
|
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloudRGB(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cloudView_->addCloud("scan", util3d::downsample(util3d::laserScanToPointCloud(data.laserScanRaw()), decimationSpin_->value()!=0?fabs(decimationSpin_->value()):1), data.laserScanRaw().localTransform(), Qt::yellow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user