From 395dac577732536184ec1b13776c78a11ed48837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Labb=C3=A9?= Date: Sat, 28 Feb 2015 15:46:04 -0500 Subject: [PATCH] fixed windows compilation --- corelib/include/rtabmap/core/impl/util3d.hpp | 6 +++--- corelib/src/DBDriver.cpp | 4 ++-- corelib/src/Graph.cpp | 4 ++-- corelib/src/util3d.cpp | 14 +++++++------- guilib/src/MainWindow.cpp | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/corelib/include/rtabmap/core/impl/util3d.hpp b/corelib/include/rtabmap/core/impl/util3d.hpp index 3c67733a..2a26ffc3 100644 --- a/corelib/include/rtabmap/core/impl/util3d.hpp +++ b/corelib/include/rtabmap/core/impl/util3d.hpp @@ -405,7 +405,7 @@ std::vector extractClusters( if(maxSize < cluster_indices[i].indices.size()) { - maxSize = cluster_indices[i].indices.size(); + maxSize = (unsigned int)cluster_indices[i].indices.size(); maxIndex = i; } } @@ -477,7 +477,7 @@ void occupancy2DFromCloud3D( ground = cv::Mat(); if(groundCloud->size()) { - ground = cv::Mat(groundCloud->size(), 1, CV_32FC2); + ground = cv::Mat((int)groundCloud->size(), 1, CV_32FC2); for(unsigned int i=0;isize(); ++i) { ground.at(i)[0] = groundCloud->at(i).x; @@ -488,7 +488,7 @@ void occupancy2DFromCloud3D( obstacles = cv::Mat(); if(obstaclesCloud->size()) { - obstacles = cv::Mat(obstaclesCloud->size(), 1, CV_32FC2); + obstacles = cv::Mat((int)obstaclesCloud->size(), 1, CV_32FC2); for(unsigned int i=0;isize(); ++i) { obstacles.at(i)[0] = obstaclesCloud->at(i).x; diff --git a/corelib/src/DBDriver.cpp b/corelib/src/DBDriver.cpp index f5d9d40b..12631c77 100644 --- a/corelib/src/DBDriver.cpp +++ b/corelib/src/DBDriver.cpp @@ -504,7 +504,7 @@ void DBDriver::loadLinks(int signatureId, std::map & links, Link::Typ { const Signature * s = _trashSignatures.at(signatureId); UASSERT(s != 0); - for(std::multimap::const_iterator nIter = s->getLinks().begin(); + for(std::map::const_iterator nIter = s->getLinks().begin(); nIter!=s->getLinks().end(); ++nIter) { @@ -556,7 +556,7 @@ void DBDriver::getAllNodeIds(std::set & ids, bool ignoreChildren) const bool hasNeighbors = !ignoreChildren; if(ignoreChildren) { - for(std::multimap::const_iterator nIter = sIter->second->getLinks().begin(); + for(std::map::const_iterator nIter = sIter->second->getLinks().begin(); nIter!=sIter->second->getLinks().end(); ++nIter) { diff --git a/corelib/src/Graph.cpp b/corelib/src/Graph.cpp index bcb75de2..cc8585db 100644 --- a/corelib/src/Graph.cpp +++ b/corelib/src/Graph.cpp @@ -804,7 +804,7 @@ std::list > computePath( if(nodeIter->second.costSoFar() > newCostSoFar) { // update the cost in the priority queue - for(std::map::iterator mapIter=pqmap.begin(); mapIter!=pqmap.end(); ++mapIter) + for(std::multimap::iterator mapIter=pqmap.begin(); mapIter!=pqmap.end(); ++mapIter) { if(mapIter->second == nodeIter->first) { @@ -911,7 +911,7 @@ float computePathLength( UASSERT(fromIndex < path.size() && toIndex < path.size() && fromIndex <= toIndex); if(fromIndex >= toIndex) { - toIndex = path.size()-1; + toIndex = (unsigned int)path.size()-1; } float x=0, y=0, z=0; for(unsigned int i=fromIndex; i::ConstPtr & cloud_source, if(inliers) { - *inliers = correspondences.size(); + *inliers = (int)correspondences.size(); } } else @@ -1615,7 +1615,7 @@ Transform icpPointToPlane( if(inliers) { - *inliers = correspondences.size(); + *inliers = (int)correspondences.size(); } } else @@ -1704,7 +1704,7 @@ Transform icp2D(const pcl::PointCloud::ConstPtr & cloud_source, if(inliers) { - *inliers = correspondences.size(); + *inliers = (int)correspondences.size(); } } else @@ -2054,7 +2054,7 @@ void occupancy2DFromLaserScan( ground = cv::Mat(); if(groundIndices.size()) { - ground = cv::Mat(groundIndices.size(), 1, CV_32FC2); + ground = cv::Mat((int)groundIndices.size(), 1, CV_32FC2); int i=0; for(std::list::iterator iter=groundIndices.begin();iter!=groundIndices.end(); ++iter) { @@ -2070,7 +2070,7 @@ void occupancy2DFromLaserScan( obstacles = cv::Mat(); if(obstaclesCloud->size()) { - obstacles = cv::Mat(obstaclesCloud->size(), 1, CV_32FC2); + obstacles = cv::Mat((int)obstaclesCloud->size(), 1, CV_32FC2); for(unsigned int i=0;isize(); ++i) { obstacles.at(i)[0] = obstaclesCloud->at(i).x; @@ -2549,7 +2549,7 @@ pcl::IndicesPtr concatenate(const std::vector & indices) unsigned int totalSize = 0; for(unsigned int i=0; isize(); + totalSize += (unsigned int)indices[i]->size(); } pcl::IndicesPtr ind(new std::vector(totalSize)); unsigned int io = 0; @@ -2567,7 +2567,7 @@ pcl::IndicesPtr concatenate(const pcl::IndicesPtr & indicesA, const pcl::Indices { pcl::IndicesPtr ind(new std::vector(*indicesA)); ind->resize(ind->size()+indicesB->size()); - unsigned int oi = indicesA->size(); + unsigned int oi = (unsigned int)indicesA->size(); for(unsigned int i=0; isize(); ++i) { ind->at(oi++) = indicesB->at(i); diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index eb6bd94d..505a2a1d 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -3086,11 +3086,11 @@ void MainWindow::postProcessing() int totalSteps = 0; if(refineNeighborLinks) { - totalSteps+=odomPoses.size(); + totalSteps+=(int)odomPoses.size(); } if(refineLoopClosureLinks) { - totalSteps+=_currentLinksMap.size() - odomPoses.size(); + totalSteps+=(int)_currentLinksMap.size() - (int)odomPoses.size(); } _initProgressDialog->setMaximumSteps(totalSteps); _initProgressDialog->show(); @@ -3134,7 +3134,7 @@ void MainWindow::postProcessing() clusterRadius, clusterAngle*CV_PI/180.0); - _initProgressDialog->setMaximumSteps(_initProgressDialog->maximumSteps()+clusters.size()); + _initProgressDialog->setMaximumSteps(_initProgressDialog->maximumSteps()+(int)clusters.size()); _initProgressDialog->appendText(tr("Looking for more loop closures, clustering poses... found %1 clusters.").arg(clusters.size())); int i=0;