diff --git a/gtsam/sfm/ShonanAveraging.cpp b/gtsam/sfm/ShonanAveraging.cpp index 1d3166a89..e08bc4dd6 100644 --- a/gtsam/sfm/ShonanAveraging.cpp +++ b/gtsam/sfm/ShonanAveraging.cpp @@ -343,8 +343,9 @@ static double Kappa(const BinaryMeasurement &measurement) { const auto &robust = boost::dynamic_pointer_cast( measurement.noiseModel()); if (robust) { - throw std::runtime_error( - "Verification of optimality does not work with robust cost function"); + std::cout << "Verification of optimality does not work with robust cost " + "function" + << std::endl; } else { throw std::invalid_argument( "Shonan averaging noise models must be isotropic (but robust losses " diff --git a/gtsam/sfm/tests/testBinaryMeasurement.cpp b/gtsam/sfm/tests/testBinaryMeasurement.cpp index a079f7e04..ae13e54c4 100644 --- a/gtsam/sfm/tests/testBinaryMeasurement.cpp +++ b/gtsam/sfm/tests/testBinaryMeasurement.cpp @@ -66,8 +66,10 @@ TEST(BinaryMeasurement, Rot3) { /* ************************************************************************* */ TEST(BinaryMeasurement, Rot3MakeRobust) { + auto huber_model = noiseModel::Robust::Create( + noiseModel::mEstimator::Huber::Create(1.345), rot3_model); BinaryMeasurement rot3Measurement(kKey1, kKey2, rot3Measured, - rot3_model, true); + huber_model); EXPECT_LONGS_EQUAL(rot3Measurement.key1(), kKey1); EXPECT_LONGS_EQUAL(rot3Measurement.key2(), kKey2); @@ -75,12 +77,6 @@ TEST(BinaryMeasurement, Rot3MakeRobust) { const auto &robust = boost::dynamic_pointer_cast( rot3Measurement.noiseModel()); EXPECT(robust); - - // test that if we call it again nothing changes: - rot3Measurement = BinaryMeasurement(rot3Measurement, true); - const auto &robust2 = boost::dynamic_pointer_cast( - rot3Measurement.noiseModel()); - EXPECT(robust2); } /* ************************************************************************* */