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-26 16:32:09 -04:00
parent e93ef025a1
commit 5542918b04
2 changed files with 6 additions and 6 deletions

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;
}
}