From 549fdb6dca58e924a0d8befb31227f59266749d5 Mon Sep 17 00:00:00 2001 From: Kartik Mohta Date: Tue, 9 Jan 2018 23:20:54 -0500 Subject: [PATCH] Fix FeatureInitializeTest --- test/feature_initialization_test.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/feature_initialization_test.cpp b/test/feature_initialization_test.cpp index d4b8817..a13fd4c 100644 --- a/test/feature_initialization_test.cpp +++ b/test/feature_initialization_test.cpp @@ -24,6 +24,12 @@ using namespace std; using namespace Eigen; using namespace msckf_vio; +// Static member variables in CAMState class +Isometry3d CAMState::T_cam0_cam1 = Isometry3d::Identity(); + +// Static member variables in Feature class +Feature::OptimizationConfig Feature::optimization_config; + TEST(FeatureInitializeTest, sphereDistribution) { // Set the real feature at the origin of the world frame. Vector3d feature(0.5, 0.0, 0.0); @@ -73,7 +79,7 @@ TEST(FeatureInitializeTest, sphereDistribution) { // Compute measurements. random_numbers::RandomNumberGenerator noise_generator; - vector > measurements(6); + vector > measurements(6); for (int i = 0; i < 6; ++i) { Isometry3d cam_pose_inv = cam_poses[i].inverse(); Vector3d p = cam_pose_inv.linear()*feature + cam_pose_inv.translation(); @@ -81,7 +87,7 @@ TEST(FeatureInitializeTest, sphereDistribution) { double v = p(1) / p(2) + noise_generator.gaussian(0.0, 0.01); //double u = p(0) / p(2); //double v = p(1) / p(2); - measurements[i] = Vector2d(u, v); + measurements[i] = Vector4d(u, v, u, v); } for (int i = 0; i < 6; ++i) {