Fixed holes in 2d occupancy grids created from scans. Fixed grid map in 3D view not updated.

This commit is contained in:
matlabbe
2016-08-31 12:43:54 -04:00
parent e93ef025a1
commit 5542918b04
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -88,10 +88,10 @@ void occupancy2DFromLaserScan(
int i=0;
for(std::list<int>::iterator iter=groundIndices.begin();iter!=groundIndices.end(); ++iter)
{
int x = *iter / map8S.cols;
int y = *iter - x*map8S.cols;
ground.at<cv::Vec2f>(i)[0] = (float(y)+0.5)*cellSize + xMin;
ground.at<cv::Vec2f>(i)[1] = (float(x)+0.5)*cellSize + yMin;
int y = *iter / map8S.cols;
int x = *iter - y*map8S.cols;
ground.at<cv::Vec2f>(i)[0] = (float(x))*cellSize + xMin;
ground.at<cv::Vec2f>(i)[1] = (float(y))*cellSize + yMin;
++i;
}
}
+2 -2
View File
@@ -1148,9 +1148,9 @@ bool CloudViewer::addOccupancyGridMap(
float ySize = float(map8U.rows) * resolution;
UDEBUG("resolution=%f, xSize=%f, ySize=%f, xMin=%f, yMin=%f", resolution, xSize, ySize, xMin, yMin);
if(_visualizer->getCloudActorMap()->find("map") == _visualizer->getCloudActorMap()->end())
if(_visualizer->getCloudActorMap()->find("map") != _visualizer->getCloudActorMap()->end())
{
_visualizer->removeShape("map");
_visualizer->removePointCloud("map");
}
if(xSize > 0.0f && ySize > 0.0f)