Rename 'tranform' to 'landmark_to_tracking_transform'. (#836)

master
Alexander Belyaev 2018-01-22 18:30:14 +01:00 committed by GitHub
parent 6d4649857a
commit 986ac28ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

View File

@ -27,7 +27,8 @@ proto::LandmarkData ToProto(const LandmarkData& landmark_data) {
for (const Landmark& landmark : landmark_data.landmarks) { for (const Landmark& landmark : landmark_data.landmarks) {
auto* item = proto.add_landmarks(); auto* item = proto.add_landmarks();
item->set_id(landmark.id); item->set_id(landmark.id);
*item->mutable_transform() = transform::ToProto(landmark.transform); *item->mutable_landmark_to_tracking_transform() =
transform::ToProto(landmark.landmark_to_tracking_transform);
item->set_translation_weight(landmark.translation_weight); item->set_translation_weight(landmark.translation_weight);
item->set_rotation_weight(landmark.rotation_weight); item->set_rotation_weight(landmark.rotation_weight);
} }
@ -40,7 +41,7 @@ LandmarkData FromProto(const proto::LandmarkData& proto) {
for (const auto& item : proto.landmarks()) { for (const auto& item : proto.landmarks()) {
landmark_data.landmarks.push_back({ landmark_data.landmarks.push_back({
item.id(), item.id(),
transform::ToRigid3(item.transform()), transform::ToRigid3(item.landmark_to_tracking_transform()),
item.translation_weight(), item.translation_weight(),
item.rotation_weight(), item.rotation_weight(),
}); });

View File

@ -31,7 +31,7 @@ namespace sensor {
struct Landmark { struct Landmark {
std::string id; std::string id;
transform::Rigid3d transform; transform::Rigid3d landmark_to_tracking_transform;
double translation_weight; double translation_weight;
double rotation_weight; double rotation_weight;
}; };

View File

@ -31,13 +31,14 @@ using ::testing::DoubleNear;
using ::testing::Field; using ::testing::Field;
::testing::Matcher<const Landmark&> EqualsLandmark(const Landmark& expected) { ::testing::Matcher<const Landmark&> EqualsLandmark(const Landmark& expected) {
return ::testing::AllOf(Field(&Landmark::id, expected.id), return ::testing::AllOf(
Field(&Landmark::transform, Field(&Landmark::id, expected.id),
transform::IsNearly(expected.transform, 1e-2)), Field(&Landmark::landmark_to_tracking_transform,
Field(&Landmark::translation_weight, transform::IsNearly(expected.landmark_to_tracking_transform, 1e-2)),
DoubleNear(expected.translation_weight, 0.01)), Field(&Landmark::translation_weight,
Field(&Landmark::rotation_weight, DoubleNear(expected.translation_weight, 0.01)),
DoubleNear(expected.rotation_weight, 0.01))); Field(&Landmark::rotation_weight,
DoubleNear(expected.rotation_weight, 0.01)));
} }
class LandmarkDataTest : public ::testing::Test { class LandmarkDataTest : public ::testing::Test {

View File

@ -63,7 +63,7 @@ message FixedFramePoseData {
message LandmarkData { message LandmarkData {
message Landmark { message Landmark {
bytes id = 1; bytes id = 1;
transform.proto.Rigid3d transform = 2; transform.proto.Rigid3d landmark_to_tracking_transform = 2;
double translation_weight = 3; double translation_weight = 3;
double rotation_weight = 4; double rotation_weight = 4;
} }