diff --git a/gtsam/geometry/tests/testTriangulation.cpp b/gtsam/geometry/tests/testTriangulation.cpp index 89b320e94..56f8e3db8 100644 --- a/gtsam/geometry/tests/testTriangulation.cpp +++ b/gtsam/geometry/tests/testTriangulation.cpp @@ -824,7 +824,7 @@ TEST(triangulation, reprojectionError_cameraComparison) { Point3(0.0, 0.0, 0.0)); // with z pointing along x axis of global frame Point3 landmarkL(5.0, 0.0, 0.0); // 1m in front of poseA SphericalCamera sphericalCamera(poseA); - Unit3 u = sphericalCamera.project(landmarkL); + // TODO(dellaert): check Unit3 u = sphericalCamera.project(landmarkL); static Cal3_S2::shared_ptr sharedK(new Cal3_S2(60, 640, 480)); PinholePose pinholeCamera(poseA, sharedK); diff --git a/gtsam/nonlinear/tests/testValues.cpp b/gtsam/nonlinear/tests/testValues.cpp index 4f55027ba..a738ecc1d 100644 --- a/gtsam/nonlinear/tests/testValues.cpp +++ b/gtsam/nonlinear/tests/testValues.cpp @@ -188,15 +188,21 @@ TEST(Values, InsertOrAssign) { TEST(Values, basic_functions) { Values values; - const Values& values_c = values; Matrix23 M1 = Matrix23::Zero(), M2 = Matrix23::Zero(); values.insert(2, Vector3(0, 0, 0)); values.insert(4, Vector3(0, 0, 0)); values.insert(6, M1); values.insert(8, M2); + EXPECT(!values.exists(1)); + EXPECT(values.exists(2)); + EXPECT(values.exists(4)); + EXPECT(values.exists(6)); + EXPECT(values.exists(8)); + #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42 // find + const Values& values_c = values; EXPECT_LONGS_EQUAL(4, values.find(4)->key); EXPECT_LONGS_EQUAL(4, values_c.find(4)->key); diff --git a/gtsam/slam/InitializePose3.cpp b/gtsam/slam/InitializePose3.cpp index e8ec9181c..75c33efa6 100644 --- a/gtsam/slam/InitializePose3.cpp +++ b/gtsam/slam/InitializePose3.cpp @@ -206,12 +206,11 @@ Values InitializePose3::computeOrientationsGradient( // Return correct rotations const Rot3& Rref = inverseRot.at(initialize::kAnchorKey); // This will be set to the identity as so far we included no prior Values estimateRot; - for (const auto key_R : inverseRot) { + for (const auto& key_R : inverseRot) { const Key& key = key_R.first; - const Rot3& Ri = key_R.second; if (key != initialize::kAnchorKey) { - const Rot3& R = inverseRot.at(key); - if(setRefFrame) + const Rot3& R = key_R.second; + if (setRefFrame) estimateRot.insert(key, Rref.compose(R.inverse())); else estimateRot.insert(key, R.inverse()); diff --git a/gtsam/slam/tests/testLago.cpp b/gtsam/slam/tests/testLago.cpp index 5d429796d..fda39c169 100644 --- a/gtsam/slam/tests/testLago.cpp +++ b/gtsam/slam/tests/testLago.cpp @@ -283,7 +283,7 @@ TEST( Lago, largeGraphNoisy_orientations ) { Values::shared_ptr expected; boost::tie(gmatlab, expected) = readG2o(matlabFile); - for(const auto key_pose: expected->extract()){ + for(const auto& key_pose: expected->extract()){ const Key& k = key_pose.first; const Pose2& pose = key_pose.second; EXPECT(assert_equal(pose, actual.at(k), 1e-5)); @@ -310,7 +310,7 @@ TEST( Lago, largeGraphNoisy ) { Values::shared_ptr expected; boost::tie(gmatlab, expected) = readG2o(matlabFile); - for(const auto key_pose: expected->extract()){ + for(const auto& key_pose: expected->extract()){ const Key& k = key_pose.first; const Pose2& pose = key_pose.second; EXPECT(assert_equal(pose, actual.at(k), 1e-2)); diff --git a/timing/timeCameraExpression.cpp b/timing/timeCameraExpression.cpp index 509294999..7a492822d 100644 --- a/timing/timeCameraExpression.cpp +++ b/timing/timeCameraExpression.cpp @@ -34,7 +34,7 @@ boost::shared_ptr fixedK(new Cal3_S2()); Point2 myProject(const Pose3& pose, const Point3& point, OptionalJacobian<2,6> H1, OptionalJacobian<2,3> H2) { PinholeCamera camera(pose, *fixedK); - return camera.project(point, H1, H2, boost::none); + return camera.project(point, H1, H2, {}); } int main() { @@ -99,7 +99,6 @@ int main() { // ExpressionFactor, optimized // Oct 3, 2014, Macbook Air // 9.0 musecs/call - typedef PinholeCamera Camera; NonlinearFactor::shared_ptr g3 = boost::make_shared >(model, z, Point2_(myProject, x, p)); diff --git a/timing/timePinholeCamera.cpp b/timing/timePinholeCamera.cpp index 1578bb0a8..b865c82f7 100644 --- a/timing/timePinholeCamera.cpp +++ b/timing/timePinholeCamera.cpp @@ -84,7 +84,7 @@ int main() Matrix Dpose, Dpoint; long timeLog = clock(); for(int i = 0; i < n; i++) - camera.project(point1, Dpose, Dpoint, boost::none); + camera.project(point1, Dpose, Dpoint, {}); long timeLog2 = clock(); double seconds = (double)(timeLog2-timeLog)/CLOCKS_PER_SEC; cout << ((double)seconds*1e9/n) << " nanosecs/call" << endl;