Skip to content

Commit

Permalink
fix: resolve cppcheck issue
Browse files Browse the repository at this point in the history
Signed-off-by: Taekjin LEE <[email protected]>
  • Loading branch information
technolojin committed Nov 13, 2024
1 parent dcb0569 commit 980e054
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,11 @@ void GridGroundFilter::classify(pcl::PointIndices & out_no_ground_indices)
const int search_count = param_.gnd_grid_buffer_size;
const int check_cell_idx = cell.scan_grid_root_idx_;
recursiveSearch(check_cell_idx, search_count, grid_idcs);
if (grid_idcs.size() > 0) {
// calculate the gradient and intercept by least square method
float a, b;
fitLineFromGndGrid(grid_idcs, a, b);
cell.gradient_ = a;
cell.intercept_ = b;
} else {
// initialization failed. which should not happen. print error message
std::cerr << "Failed to initialize ground grid at cell index: " << cell.grid_idx_
<< std::endl;
}
// calculate the gradient and intercept by least square method
float a, b;
fitLineFromGndGrid(grid_idcs, a, b);
cell.gradient_ = a;
cell.intercept_ = b;
}

// segment the ground and non-ground points
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ void ScanGroundFilterComponent::faster_filter(
if (time_keeper_) st_ptr = std::make_unique<ScopedTimeTrack>(__func__, *time_keeper_);

std::scoped_lock lock(mutex_);
stop_watch_ptr_->toc("processing_time", true);
if (stop_watch_ptr_) stop_watch_ptr_->toc("processing_time", true);

if (!data_accessor_.isInitialized()) {
data_accessor_.setField(input);
Expand Down

0 comments on commit 980e054

Please sign in to comment.