@@ -44,14 +44,13 @@ TEST(ImageFeaturesWithKnownCorrespondencesAlignerDepthOdometryTester, RampedPoin
44
44
}
45
45
const auto pose_with_covariance = image_features_depth_odometry.DepthImageCallback (target_depth_image_measurement);
46
46
ASSERT_TRUE (pose_with_covariance != boost::none);
47
- EXPECT_PRED2 (lc::MatrixEquality<2 >, pose_with_covariance->pose_with_covariance .pose .matrix (),
48
- target_T_source.inverse ().matrix ());
47
+ EXPECT_MATRIX_NEAR (pose_with_covariance->pose_with_covariance .pose , target_T_source.inverse (), 1e-2 );
49
48
const auto & correspondences = pose_with_covariance->depth_correspondences ;
50
49
for (int i = 0 ; i < correspondences.source_image_points .size (); ++i) {
51
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, correspondences.source_image_points [i]. matrix () ,
52
- (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )). matrix () );
53
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, target_T_source * correspondences.source_3d_points [i]. matrix () ,
54
- correspondences. target_3d_points [i]. matrix () );
50
+ EXPECT_MATRIX_NEAR ( correspondences.source_image_points [i],
51
+ (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )), 1e-2 );
52
+ EXPECT_MATRIX_NEAR ( target_T_source * correspondences.source_3d_points [i], correspondences. target_3d_points [i] ,
53
+ 1e-2 );
55
54
}
56
55
}
57
56
@@ -76,14 +75,13 @@ TEST(ImageFeaturesWithKnownCorrespondencesAlignerDepthOdometryTester, PointToPla
76
75
}
77
76
const auto pose_with_covariance = image_features_depth_odometry.DepthImageCallback (target_depth_image_measurement);
78
77
ASSERT_TRUE (pose_with_covariance != boost::none);
79
- EXPECT_PRED2 (lc::MatrixEquality<2 >, pose_with_covariance->pose_with_covariance .pose .matrix (),
80
- target_T_source.inverse ().matrix ());
78
+ EXPECT_MATRIX_NEAR (pose_with_covariance->pose_with_covariance .pose , target_T_source.inverse (), 1e-2 );
81
79
const auto & correspondences = pose_with_covariance->depth_correspondences ;
82
80
for (int i = 0 ; i < correspondences.source_image_points .size (); ++i) {
83
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, correspondences.source_image_points [i]. matrix () ,
84
- (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )). matrix () );
85
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, target_T_source * correspondences.source_3d_points [i]. matrix () ,
86
- correspondences. target_3d_points [i]. matrix () );
81
+ EXPECT_MATRIX_NEAR ( correspondences.source_image_points [i],
82
+ (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )), 1e-2 );
83
+ EXPECT_MATRIX_NEAR ( target_T_source * correspondences.source_3d_points [i], correspondences. target_3d_points [i] ,
84
+ 1e-2 );
87
85
}
88
86
}
89
87
@@ -108,14 +106,13 @@ TEST(ImageFeaturesWithKnownCorrespondencesAlignerDepthOdometryTester, SymmetricP
108
106
}
109
107
const auto pose_with_covariance = image_features_depth_odometry.DepthImageCallback (target_depth_image_measurement);
110
108
ASSERT_TRUE (pose_with_covariance != boost::none);
111
- EXPECT_PRED2 (lc::MatrixEquality<2 >, pose_with_covariance->pose_with_covariance .pose .matrix (),
112
- target_T_source.inverse ().matrix ());
109
+ EXPECT_MATRIX_NEAR (pose_with_covariance->pose_with_covariance .pose , target_T_source.inverse (), 1e-2 );
113
110
const auto & correspondences = pose_with_covariance->depth_correspondences ;
114
111
for (int i = 0 ; i < correspondences.source_image_points .size (); ++i) {
115
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, correspondences.source_image_points [i]. matrix () ,
116
- (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )). matrix () );
117
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, target_T_source * correspondences.source_3d_points [i]. matrix () ,
118
- correspondences. target_3d_points [i]. matrix () );
112
+ EXPECT_MATRIX_NEAR ( correspondences.source_image_points [i],
113
+ (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )), 1e-2 );
114
+ EXPECT_MATRIX_NEAR ( target_T_source * correspondences.source_3d_points [i], correspondences. target_3d_points [i] ,
115
+ 1e-2 );
119
116
}
120
117
}
121
118
@@ -137,14 +134,13 @@ TEST(ImageFeaturesWithKnownCorrespondencesAlignerDepthOdometryTester, UmeyamaRam
137
134
}
138
135
const auto pose_with_covariance = image_features_depth_odometry.DepthImageCallback (target_depth_image_measurement);
139
136
ASSERT_TRUE (pose_with_covariance != boost::none);
140
- EXPECT_PRED2 (lc::MatrixEquality<2 >, pose_with_covariance->pose_with_covariance .pose .matrix (),
141
- target_T_source.inverse ().matrix ());
137
+ EXPECT_MATRIX_NEAR (pose_with_covariance->pose_with_covariance .pose , target_T_source.inverse (), 1e-2 );
142
138
const auto & correspondences = pose_with_covariance->depth_correspondences ;
143
139
for (int i = 0 ; i < correspondences.source_image_points .size (); ++i) {
144
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, correspondences.source_image_points [i]. matrix () ,
145
- (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )). matrix () );
146
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, target_T_source * correspondences.source_3d_points [i]. matrix () ,
147
- correspondences. target_3d_points [i]. matrix () );
140
+ EXPECT_MATRIX_NEAR ( correspondences.source_image_points [i],
141
+ (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )), 1e-2 );
142
+ EXPECT_MATRIX_NEAR ( target_T_source * correspondences.source_3d_points [i], correspondences. target_3d_points [i] ,
143
+ 1e-2 );
148
144
}
149
145
}
150
146
@@ -166,14 +162,13 @@ TEST(ImageFeaturesWithKnownCorrespondencesAlignerDepthOdometryTester, UmeyamaIni
166
162
}
167
163
const auto pose_with_covariance = image_features_depth_odometry.DepthImageCallback (target_depth_image_measurement);
168
164
ASSERT_TRUE (pose_with_covariance != boost::none);
169
- EXPECT_PRED2 (lc::MatrixEquality<2 >, pose_with_covariance->pose_with_covariance .pose .matrix (),
170
- target_T_source.inverse ().matrix ());
165
+ EXPECT_MATRIX_NEAR (pose_with_covariance->pose_with_covariance .pose , target_T_source.inverse (), 1e-2 );
171
166
const auto & correspondences = pose_with_covariance->depth_correspondences ;
172
167
for (int i = 0 ; i < correspondences.source_image_points .size (); ++i) {
173
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, correspondences.source_image_points [i]. matrix () ,
174
- (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )). matrix () );
175
- EXPECT_PRED2 (lc::MatrixEquality< 2 >, target_T_source * correspondences.source_3d_points [i]. matrix () ,
176
- correspondences. target_3d_points [i]. matrix () );
168
+ EXPECT_MATRIX_NEAR ( correspondences.source_image_points [i],
169
+ (correspondences.target_image_points [i] - Eigen::Vector2d (offset.x , offset.y )), 1e-2 );
170
+ EXPECT_MATRIX_NEAR ( target_T_source * correspondences.source_3d_points [i], correspondences. target_3d_points [i] ,
171
+ 1e-2 );
177
172
}
178
173
}
179
174
0 commit comments