MainWindow: Fixed seg fault on scan rgb without normals

This commit is contained in:
matlabbe
2017-09-18 15:52:39 -04:00
parent b2fb7d5d5b
commit 2aa56c8d49

View File

@@ -3042,10 +3042,10 @@ void MainWindow::createAndAddScanToMap(int nodeId, const Transform & pose, int m
} }
else if(cloudRGB.get()) else if(cloudRGB.get())
{ {
added = _cloudViewer->addCloud(scanName, cloudWithNormals, pose, color); added = _cloudViewer->addCloud(scanName, cloudRGB, pose, color);
if(added && nodeId > 0) if(added && nodeId > 0)
{ {
scan = util3d::laserScanFromPointCloud(*cloudWithNormals); scan = util3d::laserScanFromPointCloud(*cloudRGB);
} }
} }
else else
@@ -3064,7 +3064,6 @@ void MainWindow::createAndAddScanToMap(int nodeId, const Transform & pose, int m
} }
} }
} }
if(!added) if(!added)
{ {
UERROR("Adding cloud %d to viewer failed!", nodeId); UERROR("Adding cloud %d to viewer failed!", nodeId);