Hunted down deprecated use of parse3DLandmarks
parent
97537f2a36
commit
fc08562641
|
@ -907,7 +907,7 @@ GraphAndValues load3D(const string &filename) {
|
||||||
initial->insert(key_pose.first, key_pose.second);
|
initial->insert(key_pose.first, key_pose.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto landmarks = parse3DLandmarks(filename);
|
const auto landmarks = parseVariables<Point3>(filename);
|
||||||
for (const auto &key_landmark : landmarks) {
|
for (const auto &key_landmark : landmarks) {
|
||||||
initial->insert(key_landmark.first, key_landmark.second);
|
initial->insert(key_landmark.first, key_landmark.second);
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ TEST(dataSet, readG2o3D) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check landmark parsing
|
// Check landmark parsing
|
||||||
const auto actualLandmarks = parse3DLandmarks(g2oFile);
|
const auto actualLandmarks = parseVariables<Point3>(g2oFile);
|
||||||
for (size_t j : {0, 1, 2, 3, 4}) {
|
for (size_t j : {0, 1, 2, 3, 4}) {
|
||||||
EXPECT(assert_equal(poses[j], actualPoses.at(j), 1e-5));
|
EXPECT(assert_equal(poses[j], actualPoses.at(j), 1e-5));
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ TEST(dataSet, readG2oCheckDeterminants) {
|
||||||
const Rot3 R = key_value.second.rotation();
|
const Rot3 R = key_value.second.rotation();
|
||||||
EXPECT_DOUBLES_EQUAL(1.0, R.matrix().determinant(), 1e-9);
|
EXPECT_DOUBLES_EQUAL(1.0, R.matrix().determinant(), 1e-9);
|
||||||
}
|
}
|
||||||
const map<Key, Point3> landmarks = parse3DLandmarks(g2oFile);
|
const map<Key, Point3> landmarks = parseVariables<Point3>(g2oFile);
|
||||||
EXPECT_LONGS_EQUAL(0, landmarks.size());
|
EXPECT_LONGS_EQUAL(0, landmarks.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ TEST(dataSet, readG2oLandmarks) {
|
||||||
// Check number of poses and landmarks. Should be 8 each.
|
// Check number of poses and landmarks. Should be 8 each.
|
||||||
const map<Key, Pose3> poses = parseVariables<Pose3>(g2oFile);
|
const map<Key, Pose3> poses = parseVariables<Pose3>(g2oFile);
|
||||||
EXPECT_LONGS_EQUAL(8, poses.size());
|
EXPECT_LONGS_EQUAL(8, poses.size());
|
||||||
const map<Key, Point3> landmarks = parse3DLandmarks(g2oFile);
|
const map<Key, Point3> landmarks = parseVariables<Point3>(g2oFile);
|
||||||
EXPECT_LONGS_EQUAL(8, landmarks.size());
|
EXPECT_LONGS_EQUAL(8, landmarks.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read G2O file
|
// Read G2O file
|
||||||
const auto factors = parse3DFactors(g2oFile);
|
const auto measurements = parseMeasurements<Rot3>(g2oFile);
|
||||||
const auto poses = parseVariables<Pose3>(g2oFile);
|
const auto poses = parseVariables<Pose3>(g2oFile);
|
||||||
|
|
||||||
// Build graph
|
// Build graph
|
||||||
|
@ -66,12 +66,12 @@ int main(int argc, char* argv[]) {
|
||||||
auto priorModel = noiseModel::Isotropic::Sigma(6, 10000);
|
auto priorModel = noiseModel::Isotropic::Sigma(6, 10000);
|
||||||
graph.add(PriorFactor<SOn>(0, SOn::identity(4), priorModel));
|
graph.add(PriorFactor<SOn>(0, SOn::identity(4), priorModel));
|
||||||
auto G = boost::make_shared<Matrix>(SOn::VectorizedGenerators(4));
|
auto G = boost::make_shared<Matrix>(SOn::VectorizedGenerators(4));
|
||||||
for (const auto& factor : factors) {
|
for (const auto &m : measurements) {
|
||||||
const auto& keys = factor->keys();
|
const auto &keys = m.keys();
|
||||||
const auto& Tij = factor->measured();
|
const Rot3 &Tij = m.measured();
|
||||||
const auto& model = factor->noiseModel();
|
const auto &model = m.noiseModel();
|
||||||
graph.emplace_shared<FrobeniusWormholeFactor>(
|
graph.emplace_shared<FrobeniusWormholeFactor>(
|
||||||
keys[0], keys[1], Rot3(Tij.rotation().matrix()), 4, model, G);
|
keys[0], keys[1], Tij, 4, model, G);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::mt19937 rng(42);
|
std::mt19937 rng(42);
|
||||||
|
|
Loading…
Reference in New Issue