From 1062e41de38db89317660e1ad2fb8ccce8b54869 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Tue, 6 May 2014 22:57:26 -0400 Subject: [PATCH] shut up some warnings on Windows --- gtsam_unstable/slam/SmartFactorBase.h | 8 ++++---- gtsam_unstable/slam/SmartProjectionFactor.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gtsam_unstable/slam/SmartFactorBase.h b/gtsam_unstable/slam/SmartFactorBase.h index ebef221bb..d24a878bb 100644 --- a/gtsam_unstable/slam/SmartFactorBase.h +++ b/gtsam_unstable/slam/SmartFactorBase.h @@ -220,7 +220,7 @@ public: Point2 reprojectionError(camera.project(point) - zi); overallError += 0.5 * this->noise_.at(i)->distance(reprojectionError.vector()); - } catch (CheiralityException& e) { + } catch (CheiralityException&) { std::cout << "Cheirality exception " << std::endl; exit (EXIT_FAILURE); } @@ -260,7 +260,7 @@ public: double computeJacobians(std::vector& Fblocks, Matrix& E, Vector& b, const Cameras& cameras, const Point3& point) const { - int numKeys = this->keys_.size(); + size_t numKeys = this->keys_.size(); E = zeros(2 * numKeys, 3); b = zero(2 * numKeys); double f = 0; @@ -272,7 +272,7 @@ public: try { bi = -(cameras[i].project(point, Fi, Ei, Hcali) - this->measured_.at(i)).vector(); - } catch (CheiralityException& e) { + } catch (CheiralityException&) { std::cout << "Cheirality exception " << std::endl; exit (EXIT_FAILURE); } @@ -321,7 +321,7 @@ public: const Cameras& cameras, const Point3& point, const double lambda = 0.0) const { - int numKeys = this->keys_.size(); + size_t numKeys = this->keys_.size(); std::vector < KeyMatrix2D > Fblocks; double f = computeJacobians(Fblocks, E, PointCov, b, cameras, point, lambda); diff --git a/gtsam_unstable/slam/SmartProjectionFactor.h b/gtsam_unstable/slam/SmartProjectionFactor.h index a1b85e2c3..59a841813 100644 --- a/gtsam_unstable/slam/SmartProjectionFactor.h +++ b/gtsam_unstable/slam/SmartProjectionFactor.h @@ -234,14 +234,14 @@ public: rankTolerance_, enableEPI_); degenerate_ = false; cheiralityException_ = false; - } catch (TriangulationUnderconstrainedException& e) { + } catch (TriangulationUnderconstrainedException&) { // if TriangulationUnderconstrainedException can be // 1) There is a single pose for triangulation - this should not happen because we checked the number of poses before // 2) The rank of the matrix used for triangulation is < 3: rotation-only, parallel cameras (or motion towards the landmark) // in the second case we want to use a rotation-only smart factor degenerate_ = true; cheiralityException_ = false; - } catch (TriangulationCheiralityException& e) { + } catch (TriangulationCheiralityException&) { // point is behind one of the cameras: can be the case of close-to-parallel cameras or may depend on outliers // we manage this case by either discarding the smart factor, or imposing a rotation-only constraint cheiralityException_ = true; @@ -279,7 +279,7 @@ public: const Cameras& cameras, const double lambda = 0.0) const { bool isDebug = false; - int numKeys = this->keys_.size(); + size_t numKeys = this->keys_.size(); // Create structures for Hessian Factors std::vector < Key > js; std::vector < Matrix > Gs(numKeys * (numKeys + 1) / 2); @@ -351,10 +351,10 @@ public: // Populate Gs and gs int GsCount2 = 0; - for (DenseIndex i1 = 0; i1 < numKeys; i1++) { // for each camera + for (DenseIndex i1 = 0; i1 < (DenseIndex)numKeys; i1++) { // for each camera DenseIndex i1D = i1 * D; gs.at(i1) = gs_vector.segment < D > (i1D); - for (DenseIndex i2 = 0; i2 < numKeys; i2++) { + for (DenseIndex i2 = 0; i2 < (DenseIndex)numKeys; i2++) { if (i2 >= i1) { Gs.at(GsCount2) = H.block < D, D > (i1D, i2 * D); GsCount2++;