Remove dead code. (#262)

master
Holger Rapp 2017-05-08 11:06:33 +02:00 committed by GitHub
parent 79dc1f848f
commit e2de27cded
6 changed files with 4 additions and 88 deletions

View File

@ -1,26 +0,0 @@
// Copyright 2016 The Cartographer Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto2";
package cartographer.mapping.proto;
// This is how proto2 calls the outer class since there is already a message
// with the same name in the file.
option java_outer_classname = "ScanMatchingProgressOuterClass";
message ScanMatchingProgress {
optional int64 num_scans_finished = 1;
optional int64 num_scans_total = 2;
}

View File

@ -23,7 +23,6 @@
#include <vector> #include <vector>
#include "cartographer/common/lua_parameter_dictionary.h" #include "cartographer/common/lua_parameter_dictionary.h"
#include "cartographer/mapping/proto/scan_matching_progress.pb.h"
#include "cartographer/mapping/proto/sparse_pose_graph.pb.h" #include "cartographer/mapping/proto/sparse_pose_graph.pb.h"
#include "cartographer/mapping/proto/sparse_pose_graph_options.pb.h" #include "cartographer/mapping/proto/sparse_pose_graph_options.pb.h"
#include "cartographer/mapping/submaps.h" #include "cartographer/mapping/submaps.h"
@ -106,12 +105,6 @@ class SparsePoseGraph {
// Computes optimized poses. // Computes optimized poses.
virtual void RunFinalOptimization() = 0; virtual void RunFinalOptimization() = 0;
// Will once return true whenever new optimized poses are available.
virtual bool HasNewOptimizedPoses() = 0;
// Returns the scan matching progress.
virtual proto::ScanMatchingProgress GetScanMatchingProgress() = 0;
// Get the current trajectory clusters. // Get the current trajectory clusters.
virtual std::vector<std::vector<const Submaps*>> virtual std::vector<std::vector<const Submaps*>>
GetConnectedTrajectories() = 0; GetConnectedTrajectories() = 0;
@ -129,15 +122,16 @@ class SparsePoseGraph {
// Returns the current optimized trajectory. // Returns the current optimized trajectory.
virtual std::vector<TrajectoryNode> GetTrajectoryNodes() = 0; virtual std::vector<TrajectoryNode> GetTrajectoryNodes() = 0;
// Serializes the constraints and trajectories.
proto::SparsePoseGraph ToProto();
protected:
// TODO(macmason, wohe): Consider replacing this with a GroupSubmapStates, // TODO(macmason, wohe): Consider replacing this with a GroupSubmapStates,
// which would have better separation of concerns. // which would have better separation of concerns.
virtual std::vector<SubmapState> GetSubmapStates() = 0; virtual std::vector<SubmapState> GetSubmapStates() = 0;
// Returns the collection of constraints. // Returns the collection of constraints.
virtual std::vector<Constraint> constraints() = 0; virtual std::vector<Constraint> constraints() = 0;
// Serializes the constraints and trajectories.
proto::SparsePoseGraph ToProto();
}; };
// Like TrajectoryNodes, SubmapStates arrive in a flat vector, but need to be // Like TrajectoryNodes, SubmapStates arrive in a flat vector, but need to be

View File

@ -30,7 +30,6 @@
#include "Eigen/Eigenvalues" #include "Eigen/Eigenvalues"
#include "cartographer/common/make_unique.h" #include "cartographer/common/make_unique.h"
#include "cartographer/common/math.h" #include "cartographer/common/math.h"
#include "cartographer/mapping/proto/scan_matching_progress.pb.h"
#include "cartographer/mapping/sparse_pose_graph/proto/constraint_builder_options.pb.h" #include "cartographer/mapping/sparse_pose_graph/proto/constraint_builder_options.pb.h"
#include "cartographer/sensor/compressed_point_cloud.h" #include "cartographer/sensor/compressed_point_cloud.h"
#include "cartographer/sensor/voxel_filter.h" #include "cartographer/sensor/voxel_filter.h"
@ -336,7 +335,6 @@ void SparsePoseGraph::RunOptimization() {
if (!submap_transforms_.empty()) { if (!submap_transforms_.empty()) {
optimization_problem_.Solve(constraints_, &submap_transforms_); optimization_problem_.Solve(constraints_, &submap_transforms_);
common::MutexLocker locker(&mutex_); common::MutexLocker locker(&mutex_);
has_new_optimized_poses_ = true;
const auto& node_data = optimization_problem_.node_data(); const auto& node_data = optimization_problem_.node_data();
const size_t num_optimized_poses = node_data.size(); const size_t num_optimized_poses = node_data.size();
@ -373,24 +371,6 @@ void SparsePoseGraph::RunOptimization() {
} }
} }
bool SparsePoseGraph::HasNewOptimizedPoses() {
common::MutexLocker locker(&mutex_);
if (!has_new_optimized_poses_) {
return false;
}
has_new_optimized_poses_ = false;
return true;
}
mapping::proto::ScanMatchingProgress
SparsePoseGraph::GetScanMatchingProgress() {
mapping::proto::ScanMatchingProgress progress;
common::MutexLocker locker(&mutex_);
progress.set_num_scans_total(trajectory_nodes_.size());
progress.set_num_scans_finished(constraint_builder_.GetNumFinishedScans());
return progress;
}
std::vector<mapping::TrajectoryNode> SparsePoseGraph::GetTrajectoryNodes() { std::vector<mapping::TrajectoryNode> SparsePoseGraph::GetTrajectoryNodes() {
common::MutexLocker locker(&mutex_); common::MutexLocker locker(&mutex_);
return trajectory_nodes_; return trajectory_nodes_;

View File

@ -41,7 +41,6 @@
#include "cartographer/common/thread_pool.h" #include "cartographer/common/thread_pool.h"
#include "cartographer/common/time.h" #include "cartographer/common/time.h"
#include "cartographer/kalman_filter/pose_tracker.h" #include "cartographer/kalman_filter/pose_tracker.h"
#include "cartographer/mapping/proto/scan_matching_progress.pb.h"
#include "cartographer/mapping/sparse_pose_graph.h" #include "cartographer/mapping/sparse_pose_graph.h"
#include "cartographer/mapping/trajectory_connectivity.h" #include "cartographer/mapping/trajectory_connectivity.h"
#include "cartographer/mapping_2d/sparse_pose_graph/constraint_builder.h" #include "cartographer/mapping_2d/sparse_pose_graph/constraint_builder.h"
@ -86,8 +85,6 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
const Eigen::Vector3d& angular_velocity); const Eigen::Vector3d& angular_velocity);
void RunFinalOptimization() override; void RunFinalOptimization() override;
bool HasNewOptimizedPoses() override;
mapping::proto::ScanMatchingProgress GetScanMatchingProgress() override;
std::vector<std::vector<const mapping::Submaps*>> GetConnectedTrajectories() std::vector<std::vector<const mapping::Submaps*>> GetConnectedTrajectories()
override; override;
std::vector<transform::Rigid3d> GetSubmapTransforms( std::vector<transform::Rigid3d> GetSubmapTransforms(
@ -179,9 +176,6 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_); std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_);
std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_); std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_);
// Whether to return true on the next call to HasNewOptimizedPoses().
bool has_new_optimized_poses_ GUARDED_BY(mutex_) = false;
// Connectivity structure of our trajectories. // Connectivity structure of our trajectories.
std::vector<std::vector<const mapping::Submaps*>> connected_components_; std::vector<std::vector<const mapping::Submaps*>> connected_components_;
// Trajectory to connected component ID. // Trajectory to connected component ID.

View File

@ -30,7 +30,6 @@
#include "Eigen/Eigenvalues" #include "Eigen/Eigenvalues"
#include "cartographer/common/make_unique.h" #include "cartographer/common/make_unique.h"
#include "cartographer/common/math.h" #include "cartographer/common/math.h"
#include "cartographer/mapping/proto/scan_matching_progress.pb.h"
#include "cartographer/mapping/sparse_pose_graph/proto/constraint_builder_options.pb.h" #include "cartographer/mapping/sparse_pose_graph/proto/constraint_builder_options.pb.h"
#include "cartographer/sensor/compressed_point_cloud.h" #include "cartographer/sensor/compressed_point_cloud.h"
#include "cartographer/sensor/voxel_filter.h" #include "cartographer/sensor/voxel_filter.h"
@ -331,7 +330,6 @@ void SparsePoseGraph::RunOptimization() {
if (!submap_transforms_.empty()) { if (!submap_transforms_.empty()) {
optimization_problem_.Solve(constraints_, &submap_transforms_); optimization_problem_.Solve(constraints_, &submap_transforms_);
common::MutexLocker locker(&mutex_); common::MutexLocker locker(&mutex_);
has_new_optimized_poses_ = true;
const auto& node_data = optimization_problem_.node_data(); const auto& node_data = optimization_problem_.node_data();
const size_t num_optimized_poses = node_data.size(); const size_t num_optimized_poses = node_data.size();
@ -367,24 +365,6 @@ void SparsePoseGraph::RunOptimization() {
} }
} }
bool SparsePoseGraph::HasNewOptimizedPoses() {
common::MutexLocker locker(&mutex_);
if (!has_new_optimized_poses_) {
return false;
}
has_new_optimized_poses_ = false;
return true;
}
mapping::proto::ScanMatchingProgress
SparsePoseGraph::GetScanMatchingProgress() {
mapping::proto::ScanMatchingProgress progress;
common::MutexLocker locker(&mutex_);
progress.set_num_scans_total(trajectory_nodes_.size());
progress.set_num_scans_finished(constraint_builder_.GetNumFinishedScans());
return progress;
}
std::vector<mapping::TrajectoryNode> SparsePoseGraph::GetTrajectoryNodes() { std::vector<mapping::TrajectoryNode> SparsePoseGraph::GetTrajectoryNodes() {
common::MutexLocker locker(&mutex_); common::MutexLocker locker(&mutex_);
return trajectory_nodes_; return trajectory_nodes_;

View File

@ -41,7 +41,6 @@
#include "cartographer/common/thread_pool.h" #include "cartographer/common/thread_pool.h"
#include "cartographer/common/time.h" #include "cartographer/common/time.h"
#include "cartographer/kalman_filter/pose_tracker.h" #include "cartographer/kalman_filter/pose_tracker.h"
#include "cartographer/mapping/proto/scan_matching_progress.pb.h"
#include "cartographer/mapping/sparse_pose_graph.h" #include "cartographer/mapping/sparse_pose_graph.h"
#include "cartographer/mapping/trajectory_connectivity.h" #include "cartographer/mapping/trajectory_connectivity.h"
#include "cartographer/mapping_3d/sparse_pose_graph/constraint_builder.h" #include "cartographer/mapping_3d/sparse_pose_graph/constraint_builder.h"
@ -88,8 +87,6 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
const Eigen::Vector3d& angular_velocity); const Eigen::Vector3d& angular_velocity);
void RunFinalOptimization() override; void RunFinalOptimization() override;
bool HasNewOptimizedPoses() override;
mapping::proto::ScanMatchingProgress GetScanMatchingProgress() override;
std::vector<std::vector<const mapping::Submaps*>> GetConnectedTrajectories() std::vector<std::vector<const mapping::Submaps*>> GetConnectedTrajectories()
override; override;
std::vector<transform::Rigid3d> GetSubmapTransforms( std::vector<transform::Rigid3d> GetSubmapTransforms(
@ -199,9 +196,6 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_); std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_);
std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_); std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_);
// Whether to return true on the next call to HasNewOptimizedPoses().
bool has_new_optimized_poses_ GUARDED_BY(mutex_) = false;
// Connectivity structure of our trajectories. // Connectivity structure of our trajectories.
std::vector<std::vector<const mapping::Submaps*>> connected_components_; std::vector<std::vector<const mapping::Submaps*>> connected_components_;
// Trajectory to connected component ID. // Trajectory to connected component ID.