From d1161b5f8ea120326fb38c3c316fac63393a152f Mon Sep 17 00:00:00 2001 From: jie Date: Wed, 11 Apr 2018 00:56:22 -0700 Subject: [PATCH] Internal cleanup (#1051) Fix lint errors. --- .../mapping/internal/2d/local_trajectory_builder_2d.h | 6 +++--- cartographer/mapping/internal/2d/pose_graph_2d.h | 11 +++++++---- .../mapping/internal/testing/fake_trimmable.h | 9 +++++++++ .../mapping/internal/testing/mock_map_builder.h | 6 +++--- .../mapping/internal/testing/mock_pose_graph.h | 6 +++--- cartographer/mapping/local_slam_result_data.h | 6 +++--- cartographer/sensor/internal/dispatchable.h | 6 +++--- 7 files changed, 31 insertions(+), 19 deletions(-) diff --git a/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h b/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h index 86b7d96..77de6db 100644 --- a/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h +++ b/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef CARTOGRAPHER_MAPPING_INTERNAL_2D_LOCAL_TRAJECTORY_BUILDER_H_ -#define CARTOGRAPHER_MAPPING_INTERNAL_2D_LOCAL_TRAJECTORY_BUILDER_H_ +#ifndef CARTOGRAPHER_MAPPING_INTERNAL_2D_LOCAL_TRAJECTORY_BUILDER_2D_H_ +#define CARTOGRAPHER_MAPPING_INTERNAL_2D_LOCAL_TRAJECTORY_BUILDER_2D_H_ #include #include @@ -119,4 +119,4 @@ class LocalTrajectoryBuilder2D { } // namespace mapping } // namespace cartographer -#endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_LOCAL_TRAJECTORY_BUILDER_H_ +#endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_LOCAL_TRAJECTORY_BUILDER_2D_H_ diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.h b/cartographer/mapping/internal/2d/pose_graph_2d.h index 2d4030a..3276f42 100644 --- a/cartographer/mapping/internal/2d/pose_graph_2d.h +++ b/cartographer/mapping/internal/2d/pose_graph_2d.h @@ -153,7 +153,8 @@ class PoseGraph2D : public PoseGraph { SubmapState state = SubmapState::kActive; }; - MapById GetSubmapDataUnderLock(); + MapById GetSubmapDataUnderLock() + REQUIRES(mutex_); // Handles a new work item. void AddWorkItem(const std::function& work_item) REQUIRES(mutex_); @@ -279,9 +280,11 @@ class PoseGraph2D : public PoseGraph { int num_submaps(int trajectory_id) const override; std::vector GetSubmapIds(int trajectory_id) const override; MapById GetAllSubmapData() - const override; - MapById GetTrajectoryNodes() const override; - std::vector GetConstraints() const override; + const override REQUIRES(parent_->mutex_); + MapById GetTrajectoryNodes() const override + REQUIRES(parent_->mutex_); + std::vector GetConstraints() const override + REQUIRES(parent_->mutex_); void MarkSubmapAsTrimmed(const SubmapId& submap_id) REQUIRES(parent_->mutex_) override; bool IsFinished(int trajectory_id) const override REQUIRES(parent_->mutex_); diff --git a/cartographer/mapping/internal/testing/fake_trimmable.h b/cartographer/mapping/internal/testing/fake_trimmable.h index c86066d..f6cb885 100644 --- a/cartographer/mapping/internal/testing/fake_trimmable.h +++ b/cartographer/mapping/internal/testing/fake_trimmable.h @@ -14,6 +14,13 @@ * limitations under the License. */ +#ifndef CARTOGRAPHER_MAPPING_INTERNAL_TESTING_FAKE_TRIMMABLE_H_ +#define CARTOGRAPHER_MAPPING_INTERNAL_TESTING_FAKE_TRIMMABLE_H_ + +#include + +#include "cartographer/mapping/pose_graph_trimmer.h" + namespace cartographer { namespace mapping { namespace testing { @@ -64,3 +71,5 @@ class FakeTrimmable : public Trimmable { } // namespace testing } // namespace mapping } // namespace cartographer + +#endif // CARTOGRAPHER_MAPPING_INTERNAL_TESTING_FAKE_TRIMMABLE_H_ diff --git a/cartographer/mapping/internal/testing/mock_map_builder.h b/cartographer/mapping/internal/testing/mock_map_builder.h index c5075d1..92f2412 100644 --- a/cartographer/mapping/internal/testing/mock_map_builder.h +++ b/cartographer/mapping/internal/testing/mock_map_builder.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_MAP_BUILDER_H -#define CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_MAP_BUILDER_H +#ifndef CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_MAP_BUILDER_H_ +#define CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_MAP_BUILDER_H_ #include "cartographer/mapping/map_builder_interface.h" #include "cartographer/mapping/trajectory_builder_interface.h" @@ -60,4 +60,4 @@ class MockMapBuilder : public mapping::MapBuilderInterface { } // namespace mapping } // namespace cartographer -#endif // CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_MAP_BUILDER_H +#endif // CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_MAP_BUILDER_H_ diff --git a/cartographer/mapping/internal/testing/mock_pose_graph.h b/cartographer/mapping/internal/testing/mock_pose_graph.h index fccd967..780c39b 100644 --- a/cartographer/mapping/internal/testing/mock_pose_graph.h +++ b/cartographer/mapping/internal/testing/mock_pose_graph.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_POSE_GRAPH_H -#define CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_POSE_GRAPH_H +#ifndef CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_POSE_GRAPH_H_ +#define CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_POSE_GRAPH_H_ #include "cartographer/mapping/pose_graph_interface.h" #include "glog/logging.h" @@ -55,4 +55,4 @@ class MockPoseGraph : public mapping::PoseGraphInterface { } // namespace mapping } // namespace cartographer -#endif // CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_POSE_GRAPH_H +#endif // CARTOGRAPHER_MAPPING_INTERNAL_TESTING_MOCK_POSE_GRAPH_H_ diff --git a/cartographer/mapping/local_slam_result_data.h b/cartographer/mapping/local_slam_result_data.h index b24d272..2af12cf 100644 --- a/cartographer/mapping/local_slam_result_data.h +++ b/cartographer/mapping/local_slam_result_data.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef CARTOGRAPHER_MAPPING_LOCAL_SLAM_RESULT_DATA_H -#define CARTOGRAPHER_MAPPING_LOCAL_SLAM_RESULT_DATA_H +#ifndef CARTOGRAPHER_MAPPING_LOCAL_SLAM_RESULT_DATA_H_ +#define CARTOGRAPHER_MAPPING_LOCAL_SLAM_RESULT_DATA_H_ #include "cartographer/mapping/pose_graph.h" #include "cartographer/sensor/data.h" @@ -39,4 +39,4 @@ class LocalSlamResultData : public sensor::Data { } // namespace mapping } // namespace cartographer -#endif // CARTOGRAPHER_MAPPING_LOCAL_SLAM_RESULT_DATA_H +#endif // CARTOGRAPHER_MAPPING_LOCAL_SLAM_RESULT_DATA_H_ diff --git a/cartographer/sensor/internal/dispatchable.h b/cartographer/sensor/internal/dispatchable.h index f694ea5..50eadbb 100644 --- a/cartographer/sensor/internal/dispatchable.h +++ b/cartographer/sensor/internal/dispatchable.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef CARTOGRAPHER_SENSOR_INTERNAL_MAPPING_DISPATCHABLE_H_ -#define CARTOGRAPHER_SENSOR_INTERNAL_MAPPING_DISPATCHABLE_H_ +#ifndef CARTOGRAPHER_SENSOR_INTERNAL_DISPATCHABLE_H_ +#define CARTOGRAPHER_SENSOR_INTERNAL_DISPATCHABLE_H_ #include "cartographer/mapping/trajectory_builder_interface.h" #include "cartographer/sensor/data.h" @@ -49,4 +49,4 @@ std::unique_ptr> MakeDispatchable( } // namespace sensor } // namespace cartographer -#endif // CARTOGRAPHER_SENSOR_INTERNAL_MAPPING_DISPATCHABLE_H_ +#endif // CARTOGRAPHER_SENSOR_INTERNAL_DISPATCHABLE_H_