Wolfgang Hess 2017-11-15 14:58:49 +01:00 committed by Wally B. Feed
parent c866707013
commit bdca2095c0
7 changed files with 26 additions and 26 deletions

View File

@ -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<double> 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<int> ComputeSubmapRepresentativeNode(
const mapping::proto::SparsePoseGraph& pose_graph) {
const mapping::proto::PoseGraph& pose_graph) {
std::vector<int> 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<int> 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));

View File

@ -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));

View File

@ -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<int, int> 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{

View File

@ -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<PoseGraph::Constraint> FromProto(
const ::google::protobuf::RepeatedPtrField<
proto::SparsePoseGraph::Constraint>& constraint_protos) {
const ::google::protobuf::RepeatedPtrField<proto::PoseGraph::Constraint>&
constraint_protos) {
std::vector<PoseGraph::Constraint> 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<int, proto::Trajectory* const> trajectory_protos;
const auto trajectory = [&proto, &trajectory_protos](

View File

@ -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<NodeId, TrajectoryNode> GetTrajectoryNodes() = 0;
// Serializes the constraints and trajectories.
proto::SparsePoseGraph ToProto();
proto::PoseGraph ToProto();
// Returns the IMU data.
virtual sensor::MapByTime<sensor::ImuData> GetImuData() = 0;
@ -165,7 +165,7 @@ class PoseGraph {
std::vector<PoseGraph::Constraint> FromProto(
const ::google::protobuf::RepeatedPtrField<
::cartographer::mapping::proto::SparsePoseGraph::Constraint>&
::cartographer::mapping::proto::PoseGraph::Constraint>&
constraint_protos);
} // namespace mapping

View File

@ -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

View File

@ -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";