Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawme committed Nov 14, 2022
1 parent d248f58 commit fab60ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
18 changes: 8 additions & 10 deletions common/src/PCLPointCloud2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ pcl::PCLPointCloud2::concatenate (pcl::PCLPointCloud2 &cloud1, const pcl::PCLPoi
const auto size1 = cloud1.width * cloud1.height;
const auto size2 = cloud2.width * cloud2.height;
//if one input cloud has no points, but the other input does, just select the cloud with points
switch ((static_cast<bool>(size1) << 1) + static_cast<bool>(size2))
auto chooser = (static_cast<bool>(size1) << 1) + static_cast<bool>(size2);
if (chooser == 1) {
cloud1 = cloud2;
}

if ((chooser == 0) || (chooser == 2))
{
case 1:
cloud1 = cloud2;
PCL_FALLTHROUGH
case 0:
case 2:
cloud1.header.stamp = std::max (cloud1.header.stamp, cloud2.header.stamp);
return (true);
default:
break;
cloud1.header.stamp = std::max(cloud1.header.stamp, cloud2.header.stamp);
return (true);
}

// Ideally this should be in PCLPointField class since this is global behavior
Expand Down
4 changes: 2 additions & 2 deletions features/include/pcl/features/impl/integral_image_normal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::computeFeatureFull (con
// top and bottom borders
// That sets the output density to false!
output.is_dense = false;
unsigned border = static_cast<int>(normal_smoothing_size_);
unsigned border = static_cast<unsigned>(normal_smoothing_size_);
PointOutT* vec1 = &output [0];
PointOutT* vec2 = vec1 + input_->width * (input_->height - border);

Expand Down Expand Up @@ -1027,7 +1027,7 @@ pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::computeFeaturePart (con
if (border_policy_ == BORDER_POLICY_IGNORE)
{
output.is_dense = false;
unsigned border = static_cast<int>(normal_smoothing_size_);
unsigned border = static_cast<unsigned>(normal_smoothing_size_);
unsigned bottom = input_->height > border ? input_->height - border : 0;
unsigned right = input_->width > border ? input_->width - border : 0;
if (use_depth_dependent_smoothing_)
Expand Down
2 changes: 1 addition & 1 deletion io/include/pcl/io/grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ namespace pcl
operator std::unique_ptr<Base>() const { return std::make_unique<Signal>(); }
};
// TODO: remove later for C++17 features: structured bindings and try_emplace
std::string signame{typeid (T).name ()};
#ifdef __cpp_structured_bindings
const auto [iterator, success] =
#else
typename decltype(signals_)::const_iterator iterator;
std::string signame{typeid (T).name ()};
bool success;
std::tie (iterator, success) =
#endif
Expand Down

0 comments on commit fab60ba

Please sign in to comment.