Serialize landmarks. (#889)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)master
parent
7762087edf
commit
95dbcfdf9e
|
@ -154,6 +154,13 @@ proto::PoseGraph PoseGraph::ToProto() {
|
|||
*proto.add_constraint() = cartographer::mapping::ToProto(constraint);
|
||||
}
|
||||
|
||||
auto landmarks_copy = GetLandmarkPoses();
|
||||
proto.mutable_landmarks()->Reserve(landmarks_copy.size());
|
||||
for (const auto& id_pose : landmarks_copy) {
|
||||
auto* landmark_proto = proto.add_landmarks();
|
||||
landmark_proto->set_landmark_id(id_pose.first);
|
||||
*landmark_proto->mutable_global_pose() = transform::ToProto(id_pose.second);
|
||||
}
|
||||
return proto;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,12 @@ message PoseGraph {
|
|||
Tag tag = 5;
|
||||
}
|
||||
|
||||
message Landmark {
|
||||
string landmark_id = 1;
|
||||
transform.proto.Rigid3d global_pose = 2;
|
||||
}
|
||||
|
||||
repeated Constraint constraint = 2;
|
||||
repeated Trajectory trajectory = 4;
|
||||
repeated Landmark landmarks = 5;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue