fix tests
parent
799788672f
commit
7391c103ec
|
|
@ -343,8 +343,9 @@ static double Kappa(const BinaryMeasurement<T> &measurement) {
|
||||||
const auto &robust = boost::dynamic_pointer_cast<noiseModel::Robust>(
|
const auto &robust = boost::dynamic_pointer_cast<noiseModel::Robust>(
|
||||||
measurement.noiseModel());
|
measurement.noiseModel());
|
||||||
if (robust) {
|
if (robust) {
|
||||||
throw std::runtime_error(
|
std::cout << "Verification of optimality does not work with robust cost "
|
||||||
"Verification of optimality does not work with robust cost function");
|
"function"
|
||||||
|
<< std::endl;
|
||||||
} else {
|
} else {
|
||||||
throw std::invalid_argument(
|
throw std::invalid_argument(
|
||||||
"Shonan averaging noise models must be isotropic (but robust losses "
|
"Shonan averaging noise models must be isotropic (but robust losses "
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,10 @@ TEST(BinaryMeasurement, Rot3) {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST(BinaryMeasurement, Rot3MakeRobust) {
|
TEST(BinaryMeasurement, Rot3MakeRobust) {
|
||||||
|
auto huber_model = noiseModel::Robust::Create(
|
||||||
|
noiseModel::mEstimator::Huber::Create(1.345), rot3_model);
|
||||||
BinaryMeasurement<Rot3> rot3Measurement(kKey1, kKey2, rot3Measured,
|
BinaryMeasurement<Rot3> rot3Measurement(kKey1, kKey2, rot3Measured,
|
||||||
rot3_model, true);
|
huber_model);
|
||||||
|
|
||||||
EXPECT_LONGS_EQUAL(rot3Measurement.key1(), kKey1);
|
EXPECT_LONGS_EQUAL(rot3Measurement.key1(), kKey1);
|
||||||
EXPECT_LONGS_EQUAL(rot3Measurement.key2(), kKey2);
|
EXPECT_LONGS_EQUAL(rot3Measurement.key2(), kKey2);
|
||||||
|
|
@ -75,12 +77,6 @@ TEST(BinaryMeasurement, Rot3MakeRobust) {
|
||||||
const auto &robust = boost::dynamic_pointer_cast<noiseModel::Robust>(
|
const auto &robust = boost::dynamic_pointer_cast<noiseModel::Robust>(
|
||||||
rot3Measurement.noiseModel());
|
rot3Measurement.noiseModel());
|
||||||
EXPECT(robust);
|
EXPECT(robust);
|
||||||
|
|
||||||
// test that if we call it again nothing changes:
|
|
||||||
rot3Measurement = BinaryMeasurement<Rot3>(rot3Measurement, true);
|
|
||||||
const auto &robust2 = boost::dynamic_pointer_cast<noiseModel::Robust>(
|
|
||||||
rot3Measurement.noiseModel());
|
|
||||||
EXPECT(robust2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue