diff --git a/cartographer/ground_truth/autogenerate_ground_truth_main.cc b/cartographer/ground_truth/autogenerate_ground_truth_main.cc index eba70a5..620dba1 100644 --- a/cartographer/ground_truth/autogenerate_ground_truth_main.cc +++ b/cartographer/ground_truth/autogenerate_ground_truth_main.cc @@ -21,7 +21,7 @@ #include "cartographer/common/port.h" #include "cartographer/ground_truth/proto/relations.pb.h" #include "cartographer/io/proto_stream.h" -#include "cartographer/mapping/proto/sparse_pose_graph.pb.h" +#include "cartographer/mapping/proto/pose_graph.pb.h" #include "cartographer/transform/transform.h" #include "gflags/gflags.h" #include "glog/logging.h" @@ -66,11 +66,11 @@ std::vector ComputeCoveredDistance( // TODO(whess): Should we consider all nodes inserted into the submap and // exclude, e.g. based on large relative linear or angular distance? std::vector ComputeSubmapRepresentativeNode( - const mapping::proto::SparsePoseGraph& pose_graph) { + const mapping::proto::PoseGraph& pose_graph) { std::vector submap_to_node_index; for (const auto& constraint : pose_graph.constraint()) { if (constraint.tag() != - mapping::proto::SparsePoseGraph::Constraint::INTRA_SUBMAP) { + mapping::proto::PoseGraph::Constraint::INTRA_SUBMAP) { continue; } CHECK_EQ(constraint.submap_id().trajectory_id(), 0); @@ -89,7 +89,7 @@ std::vector ComputeSubmapRepresentativeNode( } proto::GroundTruth GenerateGroundTruth( - const mapping::proto::SparsePoseGraph& pose_graph, + const mapping::proto::PoseGraph& pose_graph, const double min_covered_distance, const double outlier_threshold_meters, const double outlier_threshold_radians) { const mapping::proto::Trajectory& trajectory = pose_graph.trajectory(0); @@ -104,7 +104,7 @@ proto::GroundTruth GenerateGroundTruth( for (const auto& constraint : pose_graph.constraint()) { // We're only interested in loop closure constraints. if (constraint.tag() == - mapping::proto::SparsePoseGraph::Constraint::INTRA_SUBMAP) { + mapping::proto::PoseGraph::Constraint::INTRA_SUBMAP) { continue; } @@ -168,7 +168,7 @@ void Run(const std::string& pose_graph_filename, const double outlier_threshold_meters, const double outlier_threshold_radians) { LOG(INFO) << "Reading pose graph from '" << pose_graph_filename << "'..."; - mapping::proto::SparsePoseGraph pose_graph; + mapping::proto::PoseGraph pose_graph; { io::ProtoStreamReader reader(pose_graph_filename); CHECK(reader.ReadProto(&pose_graph)); diff --git a/cartographer/ground_truth/compute_relations_metrics_main.cc b/cartographer/ground_truth/compute_relations_metrics_main.cc index d41d8bb..7b440da 100644 --- a/cartographer/ground_truth/compute_relations_metrics_main.cc +++ b/cartographer/ground_truth/compute_relations_metrics_main.cc @@ -28,7 +28,7 @@ #include "cartographer/ground_truth/proto/relations.pb.h" #include "cartographer/ground_truth/relations_text_file.h" #include "cartographer/io/proto_stream.h" -#include "cartographer/mapping/proto/sparse_pose_graph.pb.h" +#include "cartographer/mapping/proto/pose_graph.pb.h" #include "cartographer/transform/rigid_transform.h" #include "cartographer/transform/transform.h" #include "cartographer/transform/transform_interpolation_buffer.h" @@ -113,7 +113,7 @@ void Run(const std::string& pose_graph_filename, const std::string& relations_filename, const bool read_text_file_with_unix_timestamps) { LOG(INFO) << "Reading pose graph from '" << pose_graph_filename << "'..."; - mapping::proto::SparsePoseGraph pose_graph; + mapping::proto::PoseGraph pose_graph; { io::ProtoStreamReader reader(pose_graph_filename); CHECK(reader.ReadProto(&pose_graph)); diff --git a/cartographer/mapping/map_builder.cc b/cartographer/mapping/map_builder.cc index a57f6cb..074b6e1 100644 --- a/cartographer/mapping/map_builder.cc +++ b/cartographer/mapping/map_builder.cc @@ -219,7 +219,7 @@ void MapBuilder::SerializeState(io::ProtoStreamWriter* const writer) { } void MapBuilder::LoadMap(io::ProtoStreamReader* const reader) { - proto::SparsePoseGraph pose_graph; + proto::PoseGraph pose_graph; CHECK(reader->ReadProto(&pose_graph)); std::map trajectory_remapping; @@ -278,10 +278,10 @@ void MapBuilder::LoadMap(io::ProtoStreamReader* const reader) { } // Add information about which nodes belong to which submap. - for (const proto::SparsePoseGraph::Constraint& constraint_proto : + for (const proto::PoseGraph::Constraint& constraint_proto : pose_graph.constraint()) { if (constraint_proto.tag() != - mapping::proto::SparsePoseGraph::Constraint::INTRA_SUBMAP) { + mapping::proto::PoseGraph::Constraint::INTRA_SUBMAP) { continue; } const NodeId node_id{ diff --git a/cartographer/mapping/pose_graph.cc b/cartographer/mapping/pose_graph.cc index 1b08e5e..9c61271 100644 --- a/cartographer/mapping/pose_graph.cc +++ b/cartographer/mapping/pose_graph.cc @@ -24,23 +24,23 @@ namespace cartographer { namespace mapping { -proto::SparsePoseGraph::Constraint::Tag ToProto( +proto::PoseGraph::Constraint::Tag ToProto( const PoseGraph::Constraint::Tag& tag) { switch (tag) { case PoseGraph::Constraint::Tag::INTRA_SUBMAP: - return proto::SparsePoseGraph::Constraint::INTRA_SUBMAP; + return proto::PoseGraph::Constraint::INTRA_SUBMAP; case PoseGraph::Constraint::Tag::INTER_SUBMAP: - return proto::SparsePoseGraph::Constraint::INTER_SUBMAP; + return proto::PoseGraph::Constraint::INTER_SUBMAP; } LOG(FATAL) << "Unsupported tag."; } PoseGraph::Constraint::Tag FromProto( - const proto::SparsePoseGraph::Constraint::Tag& proto) { + const proto::PoseGraph::Constraint::Tag& proto) { switch (proto) { - case proto::SparsePoseGraph::Constraint::INTRA_SUBMAP: + case proto::PoseGraph::Constraint::INTRA_SUBMAP: return PoseGraph::Constraint::Tag::INTRA_SUBMAP; - case proto::SparsePoseGraph::Constraint::INTER_SUBMAP: + case proto::PoseGraph::Constraint::INTER_SUBMAP: return PoseGraph::Constraint::Tag::INTER_SUBMAP; case ::google::protobuf::kint32max: case ::google::protobuf::kint32min:; @@ -49,8 +49,8 @@ PoseGraph::Constraint::Tag FromProto( } std::vector FromProto( - const ::google::protobuf::RepeatedPtrField< - proto::SparsePoseGraph::Constraint>& constraint_protos) { + const ::google::protobuf::RepeatedPtrField& + constraint_protos) { std::vector constraints; for (const auto& constraint_proto : constraint_protos) { const mapping::SubmapId submap_id{ @@ -96,8 +96,8 @@ proto::SparsePoseGraphOptions CreateSparsePoseGraphOptions( return options; } -proto::SparsePoseGraph PoseGraph::ToProto() { - proto::SparsePoseGraph proto; +proto::PoseGraph PoseGraph::ToProto() { + proto::PoseGraph proto; std::map trajectory_protos; const auto trajectory = [&proto, &trajectory_protos]( diff --git a/cartographer/mapping/pose_graph.h b/cartographer/mapping/pose_graph.h index e8ba8d1..12ca4ed 100644 --- a/cartographer/mapping/pose_graph.h +++ b/cartographer/mapping/pose_graph.h @@ -26,8 +26,8 @@ #include "cartographer/common/lua_parameter_dictionary.h" #include "cartographer/mapping/id.h" #include "cartographer/mapping/pose_graph_trimmer.h" +#include "cartographer/mapping/proto/pose_graph.pb.h" #include "cartographer/mapping/proto/serialization.pb.h" -#include "cartographer/mapping/proto/sparse_pose_graph.pb.h" #include "cartographer/mapping/proto/sparse_pose_graph_options.pb.h" #include "cartographer/mapping/submaps.h" #include "cartographer/mapping/trajectory_node.h" @@ -144,7 +144,7 @@ class PoseGraph { virtual MapById GetTrajectoryNodes() = 0; // Serializes the constraints and trajectories. - proto::SparsePoseGraph ToProto(); + proto::PoseGraph ToProto(); // Returns the IMU data. virtual sensor::MapByTime GetImuData() = 0; @@ -165,7 +165,7 @@ class PoseGraph { std::vector FromProto( const ::google::protobuf::RepeatedPtrField< - ::cartographer::mapping::proto::SparsePoseGraph::Constraint>& + ::cartographer::mapping::proto::PoseGraph::Constraint>& constraint_protos); } // namespace mapping diff --git a/cartographer/mapping/proto/sparse_pose_graph.proto b/cartographer/mapping/proto/pose_graph.proto similarity index 98% rename from cartographer/mapping/proto/sparse_pose_graph.proto rename to cartographer/mapping/proto/pose_graph.proto index c98e958..4b4bd58 100644 --- a/cartographer/mapping/proto/sparse_pose_graph.proto +++ b/cartographer/mapping/proto/pose_graph.proto @@ -29,7 +29,7 @@ message NodeId { int32 node_index = 2; // Node index in the given trajectory. } -message SparsePoseGraph { +message PoseGraph { message Constraint { // Differentiates between intra-submap (where the range data was inserted // into the submap) and inter-submap constraints (where the range data was diff --git a/cartographer/mapping/proto/serialization.proto b/cartographer/mapping/proto/serialization.proto index fb5936f..dd1a796 100644 --- a/cartographer/mapping/proto/serialization.proto +++ b/cartographer/mapping/proto/serialization.proto @@ -16,7 +16,7 @@ syntax = "proto3"; package cartographer.mapping.proto; -import "cartographer/mapping/proto/sparse_pose_graph.proto"; +import "cartographer/mapping/proto/pose_graph.proto"; import "cartographer/mapping/proto/submap.proto"; import "cartographer/mapping/proto/trajectory_node_data.proto"; import "cartographer/sensor/proto/sensor.proto";