Skip to content

Commit 549fdb6

Browse files
committed
Fix FeatureInitializeTest
1 parent 0b486f1 commit 549fdb6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/feature_initialization_test.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ using namespace std;
2424
using namespace Eigen;
2525
using namespace msckf_vio;
2626

27+
// Static member variables in CAMState class
28+
Isometry3d CAMState::T_cam0_cam1 = Isometry3d::Identity();
29+
30+
// Static member variables in Feature class
31+
Feature::OptimizationConfig Feature::optimization_config;
32+
2733
TEST(FeatureInitializeTest, sphereDistribution) {
2834
// Set the real feature at the origin of the world frame.
2935
Vector3d feature(0.5, 0.0, 0.0);
@@ -73,15 +79,15 @@ TEST(FeatureInitializeTest, sphereDistribution) {
7379

7480
// Compute measurements.
7581
random_numbers::RandomNumberGenerator noise_generator;
76-
vector<Vector2d, aligned_allocator<Vector2d> > measurements(6);
82+
vector<Vector4d, aligned_allocator<Vector4d> > measurements(6);
7783
for (int i = 0; i < 6; ++i) {
7884
Isometry3d cam_pose_inv = cam_poses[i].inverse();
7985
Vector3d p = cam_pose_inv.linear()*feature + cam_pose_inv.translation();
8086
double u = p(0) / p(2) + noise_generator.gaussian(0.0, 0.01);
8187
double v = p(1) / p(2) + noise_generator.gaussian(0.0, 0.01);
8288
//double u = p(0) / p(2);
8389
//double v = p(1) / p(2);
84-
measurements[i] = Vector2d(u, v);
90+
measurements[i] = Vector4d(u, v, u, v);
8591
}
8692

8793
for (int i = 0; i < 6; ++i) {

0 commit comments

Comments
 (0)