diff --git a/cartographer/io/internal/in_memory_proto_stream.h b/cartographer/io/internal/in_memory_proto_stream.h index 1ddb49d..14da01a 100644 --- a/cartographer/io/internal/in_memory_proto_stream.h +++ b/cartographer/io/internal/in_memory_proto_stream.h @@ -52,7 +52,7 @@ class InMemoryProtoStreamReader public: explicit InMemoryProtoStreamReader( std::queue>&& state_chunks) - : state_chunks_(std::move(state_chunks)){}; + : state_chunks_(std::move(state_chunks)) {} InMemoryProtoStreamReader() = default; ~InMemoryProtoStreamReader() = default; diff --git a/cartographer/io/probability_grid_points_processor.cc b/cartographer/io/probability_grid_points_processor.cc index 799abda..358ef74 100644 --- a/cartographer/io/probability_grid_points_processor.cc +++ b/cartographer/io/probability_grid_points_processor.cc @@ -142,7 +142,6 @@ std::unique_ptr DrawProbabilityGrid( probability_grid.IsKnown(index) ? ProbabilityToColor(probability_grid.GetProbability(index)) : kUnknownValue; - ; image->SetPixel(xy_index.x(), xy_index.y(), {{value, value, value}}); } return image; diff --git a/cartographer/io/proto_stream_interface.h b/cartographer/io/proto_stream_interface.h index 6b39c2a..18ca2e4 100644 --- a/cartographer/io/proto_stream_interface.h +++ b/cartographer/io/proto_stream_interface.h @@ -26,7 +26,7 @@ namespace io { // A writer for writing proto messages to a pbstream. class ProtoStreamWriterInterface { public: - virtual ~ProtoStreamWriterInterface(){}; + virtual ~ProtoStreamWriterInterface() {} // Serializes, compressed and writes the 'proto' to the file. virtual void WriteProto(const google::protobuf::Message& proto) = 0; @@ -39,7 +39,7 @@ class ProtoStreamWriterInterface { class ProtoStreamReaderInterface { public: ProtoStreamReaderInterface() = default; - virtual ~ProtoStreamReaderInterface(){}; + virtual ~ProtoStreamReaderInterface() {} // Deserialize compressed proto from the pb stream. virtual bool ReadProto(google::protobuf::Message* proto) = 0; diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.h b/cartographer/mapping/internal/2d/pose_graph_2d.h index 18219a1..2d4030a 100644 --- a/cartographer/mapping/internal/2d/pose_graph_2d.h +++ b/cartographer/mapping/internal/2d/pose_graph_2d.h @@ -284,7 +284,7 @@ class PoseGraph2D : public PoseGraph { std::vector GetConstraints() const override; void MarkSubmapAsTrimmed(const SubmapId& submap_id) REQUIRES(parent_->mutex_) override; - bool IsFinished(int trajectory_id) const override REQUIRES(parent_->mutex); + bool IsFinished(int trajectory_id) const override REQUIRES(parent_->mutex_); private: PoseGraph2D* const parent_; diff --git a/cartographer/mapping/internal/2d/scan_matching/fast_correlative_scan_matcher_2d.cc b/cartographer/mapping/internal/2d/scan_matching/fast_correlative_scan_matcher_2d.cc index e5ed349..a2eaeee 100644 --- a/cartographer/mapping/internal/2d/scan_matching/fast_correlative_scan_matcher_2d.cc +++ b/cartographer/mapping/internal/2d/scan_matching/fast_correlative_scan_matcher_2d.cc @@ -69,7 +69,7 @@ class SlidingWindowMaximum { private: // Maximum of the current sliding window at the front. Then the maximum of the - // remaining window that came after this values first occurence, and so on. + // remaining window that came after this values first occurrence, and so on. std::deque non_ascending_maxima_; }; diff --git a/cartographer/mapping/internal/2d/scan_matching/occupied_space_cost_function_2d.h b/cartographer/mapping/internal/2d/scan_matching/occupied_space_cost_function_2d.h index 7f0fb8d..a8f91d4 100644 --- a/cartographer/mapping/internal/2d/scan_matching/occupied_space_cost_function_2d.h +++ b/cartographer/mapping/internal/2d/scan_matching/occupied_space_cost_function_2d.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_H_ -#define CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_H_ +#ifndef CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_2D_H_ +#define CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_2D_H_ #include "Eigen/Core" #include "Eigen/Geometry" @@ -126,4 +126,4 @@ class OccupiedSpaceCostFunction2D { } // namespace mapping } // namespace cartographer -#endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_H_ +#endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_2D_H_ diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.h b/cartographer/mapping/internal/3d/pose_graph_3d.h index 515e982..ec09f94 100644 --- a/cartographer/mapping/internal/3d/pose_graph_3d.h +++ b/cartographer/mapping/internal/3d/pose_graph_3d.h @@ -158,7 +158,8 @@ class PoseGraph3D : 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_); @@ -284,9 +285,11 @@ class PoseGraph3D : 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/range_data_collator.cc b/cartographer/mapping/internal/range_data_collator.cc index ea1ff09..d6ef0ca 100644 --- a/cartographer/mapping/internal/range_data_collator.cc +++ b/cartographer/mapping/internal/range_data_collator.cc @@ -28,7 +28,7 @@ namespace mapping { sensor::TimedPointCloudOriginData RangeDataCollator::AddRangeData( const std::string& sensor_id, const sensor::TimedPointCloudData& timed_point_cloud_data) { - CHECK(expected_sensor_ids_.count(sensor_id) != 0); + CHECK_NE(expected_sensor_ids_.count(sensor_id), 0); // TODO(gaschler): These two cases can probably be one. if (id_to_pending_data_.count(sensor_id) != 0) { current_start_ = current_end_; diff --git a/cartographer/mapping/pose_graph.h b/cartographer/mapping/pose_graph.h index ffec3aa..2c57826 100644 --- a/cartographer/mapping/pose_graph.h +++ b/cartographer/mapping/pose_graph.h @@ -53,7 +53,7 @@ class PoseGraph : public PoseGraphInterface { }; PoseGraph() {} - virtual ~PoseGraph() override {} + ~PoseGraph() override {} PoseGraph(const PoseGraph&) = delete; PoseGraph& operator=(const PoseGraph&) = delete; diff --git a/cartographer/sensor/internal/trajectory_collator.cc b/cartographer/sensor/internal/trajectory_collator.cc index 7d8409d..5aec1ce 100644 --- a/cartographer/sensor/internal/trajectory_collator.cc +++ b/cartographer/sensor/internal/trajectory_collator.cc @@ -23,7 +23,7 @@ void TrajectoryCollator::AddTrajectory( const int trajectory_id, const std::unordered_set& expected_sensor_ids, const Callback& callback) { - CHECK(trajectory_to_queue_.count(trajectory_id) == 0); + CHECK_EQ(trajectory_to_queue_.count(trajectory_id), 0); for (const auto& sensor_id : expected_sensor_ids) { const auto queue_key = QueueKey{trajectory_id, sensor_id}; trajectory_to_queue_[trajectory_id].AddQueue( diff --git a/cartographer/sensor/internal/voxel_filter.h b/cartographer/sensor/internal/voxel_filter.h index 9429ccd..480ceea 100644 --- a/cartographer/sensor/internal/voxel_filter.h +++ b/cartographer/sensor/internal/voxel_filter.h @@ -34,7 +34,7 @@ namespace sensor { class VoxelFilter { public: // 'size' is the length of a voxel edge. - explicit VoxelFilter(float size) : resolution_(size){}; + explicit VoxelFilter(float size) : resolution_(size) {} VoxelFilter(const VoxelFilter&) = delete; VoxelFilter& operator=(const VoxelFilter&) = delete;