mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Camera test view: show intensity/rgb/normals if input scans have them
This commit is contained in:
@@ -147,7 +147,33 @@ void CameraViewer::showImage(const rtabmap::SensorData & data)
|
||||
showScanCheckbox_->setEnabled(true);
|
||||
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