Internal cleanup (#1045)

Clean up the lint errors.
master
jie 2018-04-10 00:43:36 -07:00 committed by Wally B. Feed
parent 74b35caf6e
commit cf358e7640
11 changed files with 19 additions and 17 deletions

View File

@ -52,7 +52,7 @@ class InMemoryProtoStreamReader
public: public:
explicit InMemoryProtoStreamReader( explicit InMemoryProtoStreamReader(
std::queue<std::unique_ptr<google::protobuf::Message>>&& state_chunks) std::queue<std::unique_ptr<google::protobuf::Message>>&& state_chunks)
: state_chunks_(std::move(state_chunks)){}; : state_chunks_(std::move(state_chunks)) {}
InMemoryProtoStreamReader() = default; InMemoryProtoStreamReader() = default;
~InMemoryProtoStreamReader() = default; ~InMemoryProtoStreamReader() = default;

View File

@ -142,7 +142,6 @@ std::unique_ptr<Image> DrawProbabilityGrid(
probability_grid.IsKnown(index) probability_grid.IsKnown(index)
? ProbabilityToColor(probability_grid.GetProbability(index)) ? ProbabilityToColor(probability_grid.GetProbability(index))
: kUnknownValue; : kUnknownValue;
;
image->SetPixel(xy_index.x(), xy_index.y(), {{value, value, value}}); image->SetPixel(xy_index.x(), xy_index.y(), {{value, value, value}});
} }
return image; return image;

View File

@ -26,7 +26,7 @@ namespace io {
// A writer for writing proto messages to a pbstream. // A writer for writing proto messages to a pbstream.
class ProtoStreamWriterInterface { class ProtoStreamWriterInterface {
public: public:
virtual ~ProtoStreamWriterInterface(){}; virtual ~ProtoStreamWriterInterface() {}
// Serializes, compressed and writes the 'proto' to the file. // Serializes, compressed and writes the 'proto' to the file.
virtual void WriteProto(const google::protobuf::Message& proto) = 0; virtual void WriteProto(const google::protobuf::Message& proto) = 0;
@ -39,7 +39,7 @@ class ProtoStreamWriterInterface {
class ProtoStreamReaderInterface { class ProtoStreamReaderInterface {
public: public:
ProtoStreamReaderInterface() = default; ProtoStreamReaderInterface() = default;
virtual ~ProtoStreamReaderInterface(){}; virtual ~ProtoStreamReaderInterface() {}
// Deserialize compressed proto from the pb stream. // Deserialize compressed proto from the pb stream.
virtual bool ReadProto(google::protobuf::Message* proto) = 0; virtual bool ReadProto(google::protobuf::Message* proto) = 0;

View File

@ -284,7 +284,7 @@ class PoseGraph2D : public PoseGraph {
std::vector<PoseGraphInterface::Constraint> GetConstraints() const override; std::vector<PoseGraphInterface::Constraint> GetConstraints() const override;
void MarkSubmapAsTrimmed(const SubmapId& submap_id) void MarkSubmapAsTrimmed(const SubmapId& submap_id)
REQUIRES(parent_->mutex_) override; 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: private:
PoseGraph2D* const parent_; PoseGraph2D* const parent_;

View File

@ -69,7 +69,7 @@ class SlidingWindowMaximum {
private: private:
// Maximum of the current sliding window at the front. Then the maximum of the // 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<float> non_ascending_maxima_; std::deque<float> non_ascending_maxima_;
}; };

View File

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef 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_H_ #define CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_OCCUPIED_SPACE_COST_FUNCTION_2D_H_
#include "Eigen/Core" #include "Eigen/Core"
#include "Eigen/Geometry" #include "Eigen/Geometry"
@ -126,4 +126,4 @@ class OccupiedSpaceCostFunction2D {
} // namespace mapping } // namespace mapping
} // namespace cartographer } // 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_

View File

@ -158,7 +158,8 @@ class PoseGraph3D : public PoseGraph {
SubmapState state = SubmapState::kActive; SubmapState state = SubmapState::kActive;
}; };
MapById<SubmapId, PoseGraphInterface::SubmapData> GetSubmapDataUnderLock(); MapById<SubmapId, PoseGraphInterface::SubmapData> GetSubmapDataUnderLock()
REQUIRES(mutex_);
// Handles a new work item. // Handles a new work item.
void AddWorkItem(const std::function<void()>& work_item) REQUIRES(mutex_); void AddWorkItem(const std::function<void()>& work_item) REQUIRES(mutex_);
@ -284,9 +285,11 @@ class PoseGraph3D : public PoseGraph {
int num_submaps(int trajectory_id) const override; int num_submaps(int trajectory_id) const override;
std::vector<SubmapId> GetSubmapIds(int trajectory_id) const override; std::vector<SubmapId> GetSubmapIds(int trajectory_id) const override;
MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData() MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
const override; const override REQUIRES(parent_->mutex_);
MapById<NodeId, TrajectoryNode> GetTrajectoryNodes() const override; MapById<NodeId, TrajectoryNode> GetTrajectoryNodes() const override
std::vector<PoseGraphInterface::Constraint> GetConstraints() const override; REQUIRES(parent_->mutex_);
std::vector<PoseGraphInterface::Constraint> GetConstraints() const override
REQUIRES(parent_->mutex_);
void MarkSubmapAsTrimmed(const SubmapId& submap_id) void MarkSubmapAsTrimmed(const SubmapId& submap_id)
REQUIRES(parent_->mutex_) override; REQUIRES(parent_->mutex_) override;
bool IsFinished(int trajectory_id) const override REQUIRES(parent_->mutex_); bool IsFinished(int trajectory_id) const override REQUIRES(parent_->mutex_);

View File

@ -28,7 +28,7 @@ namespace mapping {
sensor::TimedPointCloudOriginData RangeDataCollator::AddRangeData( sensor::TimedPointCloudOriginData RangeDataCollator::AddRangeData(
const std::string& sensor_id, const std::string& sensor_id,
const sensor::TimedPointCloudData& timed_point_cloud_data) { 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. // TODO(gaschler): These two cases can probably be one.
if (id_to_pending_data_.count(sensor_id) != 0) { if (id_to_pending_data_.count(sensor_id) != 0) {
current_start_ = current_end_; current_start_ = current_end_;

View File

@ -53,7 +53,7 @@ class PoseGraph : public PoseGraphInterface {
}; };
PoseGraph() {} PoseGraph() {}
virtual ~PoseGraph() override {} ~PoseGraph() override {}
PoseGraph(const PoseGraph&) = delete; PoseGraph(const PoseGraph&) = delete;
PoseGraph& operator=(const PoseGraph&) = delete; PoseGraph& operator=(const PoseGraph&) = delete;

View File

@ -23,7 +23,7 @@ void TrajectoryCollator::AddTrajectory(
const int trajectory_id, const int trajectory_id,
const std::unordered_set<std::string>& expected_sensor_ids, const std::unordered_set<std::string>& expected_sensor_ids,
const Callback& callback) { 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) { for (const auto& sensor_id : expected_sensor_ids) {
const auto queue_key = QueueKey{trajectory_id, sensor_id}; const auto queue_key = QueueKey{trajectory_id, sensor_id};
trajectory_to_queue_[trajectory_id].AddQueue( trajectory_to_queue_[trajectory_id].AddQueue(

View File

@ -34,7 +34,7 @@ namespace sensor {
class VoxelFilter { class VoxelFilter {
public: public:
// 'size' is the length of a voxel edge. // '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(const VoxelFilter&) = delete;
VoxelFilter& operator=(const VoxelFilter&) = delete; VoxelFilter& operator=(const VoxelFilter&) = delete;