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) {
auto* item = proto.add_landmarks();
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_rotation_weight(landmark.rotation_weight);
}
@ -40,7 +41,7 @@ LandmarkData FromProto(const proto::LandmarkData& proto) {
for (const auto& item : proto.landmarks()) {
landmark_data.landmarks.push_back({
item.id(),
transform::ToRigid3(item.transform()),
transform::ToRigid3(item.landmark_to_tracking_transform()),
item.translation_weight(),
item.rotation_weight(),
});

View File

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

View File

@ -31,9 +31,10 @@ using ::testing::DoubleNear;
using ::testing::Field;
::testing::Matcher<const Landmark&> EqualsLandmark(const Landmark& expected) {
return ::testing::AllOf(Field(&Landmark::id, expected.id),
Field(&Landmark::transform,
transform::IsNearly(expected.transform, 1e-2)),
return ::testing::AllOf(
Field(&Landmark::id, expected.id),
Field(&Landmark::landmark_to_tracking_transform,
transform::IsNearly(expected.landmark_to_tracking_transform, 1e-2)),
Field(&Landmark::translation_weight,
DoubleNear(expected.translation_weight, 0.01)),
Field(&Landmark::rotation_weight,

View File

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