From e2c67a7bdef63441ee8b437b18677ee5310c8d8a Mon Sep 17 00:00:00 2001 From: jie Date: Thu, 31 Aug 2017 04:39:47 -0700 Subject: [PATCH] Fix Lint and ClangTidy warnings. (#485) --- cartographer/io/draw_trajectories.cc | 3 ++- cartographer/io/draw_trajectories.h | 3 ++- cartographer/mapping/pose_extrapolator.cc | 4 ++-- cartographer/mapping_3d/local_trajectory_builder.cc | 2 +- .../scan_matching/fast_correlative_scan_matcher_test.cc | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cartographer/io/draw_trajectories.cc b/cartographer/io/draw_trajectories.cc index 2b21253..0af139b 100644 --- a/cartographer/io/draw_trajectories.cc +++ b/cartographer/io/draw_trajectories.cc @@ -23,7 +23,8 @@ namespace cartographer { namespace io { void DrawTrajectory(const mapping::proto::Trajectory& trajectory, - const FloatColor& color, PoseToPixelFunction pose_to_pixel, + const FloatColor& color, + const PoseToPixelFunction& pose_to_pixel, cairo_surface_t* surface) { if (trajectory.node_size() == 0) { return; diff --git a/cartographer/io/draw_trajectories.h b/cartographer/io/draw_trajectories.h index 16b9612..e519698 100644 --- a/cartographer/io/draw_trajectories.h +++ b/cartographer/io/draw_trajectories.h @@ -32,7 +32,8 @@ using PoseToPixelFunction = // 'pose_to_pixel' function must translate a trajectory node's position into the // pixel on 'surface'. void DrawTrajectory(const mapping::proto::Trajectory& trajectory, - const FloatColor& color, PoseToPixelFunction pose_to_pixel, + const FloatColor& color, + const PoseToPixelFunction& pose_to_pixel, cairo_surface_t* surface); } // namespace io diff --git a/cartographer/mapping/pose_extrapolator.cc b/cartographer/mapping/pose_extrapolator.cc index d4b3e37..b0e034f 100644 --- a/cartographer/mapping/pose_extrapolator.cc +++ b/cartographer/mapping/pose_extrapolator.cc @@ -26,9 +26,9 @@ namespace cartographer { namespace mapping { PoseExtrapolator::PoseExtrapolator(const common::Duration pose_queue_duration, - double gravity_time_constant) + double imu_gravity_time_constant) : pose_queue_duration_(pose_queue_duration), - gravity_time_constant_(gravity_time_constant) {} + gravity_time_constant_(imu_gravity_time_constant) {} std::unique_ptr PoseExtrapolator::InitializeWithImu( const common::Duration pose_queue_duration, diff --git a/cartographer/mapping_3d/local_trajectory_builder.cc b/cartographer/mapping_3d/local_trajectory_builder.cc index 906f87b..e43aeee 100644 --- a/cartographer/mapping_3d/local_trajectory_builder.cc +++ b/cartographer/mapping_3d/local_trajectory_builder.cc @@ -131,7 +131,7 @@ LocalTrajectoryBuilder::AddAccumulatedRangeData( const sensor::PointCloud filtered_point_cloud_in_tracking = adaptive_voxel_filter.Filter(filtered_range_data.returns); if (options_.use_online_correlative_scan_matching()) { - // We take a copy since we use 'intial_ceres_pose' as an output argument. + // We take a copy since we use 'initial_ceres_pose' as an output argument. const transform::Rigid3d initial_pose = initial_ceres_pose; real_time_correlative_scan_matcher_->Match( initial_pose, filtered_point_cloud_in_tracking, diff --git a/cartographer/mapping_3d/scan_matching/fast_correlative_scan_matcher_test.cc b/cartographer/mapping_3d/scan_matching/fast_correlative_scan_matcher_test.cc index 421b3c9..8e51934 100644 --- a/cartographer/mapping_3d/scan_matching/fast_correlative_scan_matcher_test.cc +++ b/cartographer/mapping_3d/scan_matching/fast_correlative_scan_matcher_test.cc @@ -37,7 +37,7 @@ class FastCorrelativeScanMatcherTest : public ::testing::Test { protected: FastCorrelativeScanMatcherTest() : range_data_inserter_(CreateRangeDataInserterTestOptions()), - options_(CreateFastCorrelativeScanMatcherTestOptions(5)){}; + options_(CreateFastCorrelativeScanMatcherTestOptions(5)) {} void SetUp() override { point_cloud_ = {