20 #include "gmock/gmock.h" 26 TEST(SubmapsTest, ToFromProto) {
27 const Submap3D expected(
30 Eigen::Quaterniond(0., 0., 0., 1.)));
32 expected.ToProto(&proto,
true );
33 EXPECT_FALSE(proto.has_submap_2d());
34 EXPECT_TRUE(proto.has_submap_3d());
35 const auto actual = Submap3D(proto.submap_3d());
36 EXPECT_TRUE(expected.local_pose().translation().isApprox(
37 actual.local_pose().translation(), 1e-6));
38 EXPECT_TRUE(expected.local_pose().rotation().isApprox(
39 actual.local_pose().rotation(), 1e-6));
40 EXPECT_EQ(expected.num_range_data(), actual.num_range_data());
41 EXPECT_EQ(expected.finished(), actual.finished());
42 EXPECT_NEAR(expected.high_resolution_hybrid_grid().resolution(), 0.05, 1e-6);
43 EXPECT_NEAR(expected.low_resolution_hybrid_grid().resolution(), 0.25, 1e-6);
TEST(TrajectoryConnectivityStateTest, UnknownTrajectory)