From f32968cc037acbcaa8a7640e5de98187faa30e04 Mon Sep 17 00:00:00 2001 From: dellaert Date: Sat, 31 May 2014 21:57:36 -0400 Subject: [PATCH] Added extra test case --- gtsam/slam/tests/testDataset.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gtsam/slam/tests/testDataset.cpp b/gtsam/slam/tests/testDataset.cpp index 89c9cd5eb..9335372c8 100644 --- a/gtsam/slam/tests/testDataset.cpp +++ b/gtsam/slam/tests/testDataset.cpp @@ -50,6 +50,11 @@ TEST( dataSet, load2D) load2D(filename, SharedNoiseModel(), 10000, false, false); EXPECT_LONGS_EQUAL(300,graph->size()); EXPECT_LONGS_EQUAL(100,initial->size()); + noiseModel::Unit::shared_ptr model = noiseModel::Unit::Create(3); + BetweenFactor expected(1, 0, Pose2(-0.99879,0.0417574,-0.00818381), model); + BetweenFactor::shared_ptr actual = boost::dynamic_pointer_cast< + BetweenFactor >(graph->at(0)); + EXPECT(assert_equal(expected, *actual)); } /* ************************************************************************* */ @@ -118,7 +123,7 @@ TEST( dataSet, readG2oHuber) const string g2oFile = findExampleDataFile("pose2example"); NonlinearFactorGraph actualGraph; Values actualValues; - readG2o(g2oFile, actualGraph, actualValues, HUBER); + readG2o(g2oFile, actualGraph, actualValues, KernelFunctionTypeHUBER); noiseModel::Diagonal::shared_ptr baseModel = noiseModel::Diagonal::Precisions((Vector(3) << 44.721360, 44.721360, 30.901699)); SharedNoiseModel model = noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(1.345), baseModel); @@ -145,7 +150,7 @@ TEST( dataSet, readG2oTukey) const string g2oFile = findExampleDataFile("pose2example"); NonlinearFactorGraph actualGraph; Values actualValues; - readG2o(g2oFile, actualGraph, actualValues, TUKEY); + readG2o(g2oFile, actualGraph, actualValues, KernelFunctionTypeTUKEY); noiseModel::Diagonal::shared_ptr baseModel = noiseModel::Diagonal::Precisions((Vector(3) << 44.721360, 44.721360, 30.901699)); SharedNoiseModel model = noiseModel::Robust::Create(noiseModel::mEstimator::Tukey::Create(4.6851), baseModel);