24 #include "gtest/gtest.h" 30 using ::testing::DoubleNear;
31 using ::testing::Field;
33 ::testing::Matcher<const LandmarkObservation&> EqualsLandmark(
34 const LandmarkObservation& expected) {
35 return ::testing::AllOf(
38 transform::IsNearly(expected.landmark_to_tracking_transform, 1e-2)),
40 DoubleNear(expected.translation_weight, 0.01)),
42 DoubleNear(expected.rotation_weight, 0.01)));
45 class LandmarkDataTest :
public ::testing::Test {
52 Eigen::Quaterniond(1., 1., -1., -1.)),
59 Eigen::Quaterniond(2., 2., -2., -2.)),
66 TEST_F(LandmarkDataTest, LandmarkDataToAndFromProto) {
69 EXPECT_EQ(expected.time, actual.time);
70 EXPECT_THAT(actual.landmark_observations,
71 ElementsAre(EqualsLandmark(expected.landmark_observations[0]),
72 EqualsLandmark(expected.landmark_observations[1])));
std::vector< LandmarkObservation > observations_
proto::FixedFramePoseData ToProto(const FixedFramePoseData &pose_data)
transform::Rigid3d landmark_to_tracking_transform
FixedFramePoseData FromProto(const proto::FixedFramePoseData &proto)
Time FromUniversal(const int64 ticks)
double translation_weight