Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force C++ over C math function #3087

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/include/pcl/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace pcl
template<typename T> bool
equal (T val1, T val2, T eps = std::numeric_limits<T>::min ())
{
return (fabs (val1 - val2) < eps);
return (std::fabs (val1 - val2) < eps);
}
}
}
28 changes: 14 additions & 14 deletions common/include/pcl/range_image/impl/range_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ RangeImage::createFromPointCloud (const PointCloudType& point_cloud,
{
setAngularResolution (angular_resolution_x, angular_resolution_y);

width = static_cast<uint32_t> (pcl_lrint (floor (max_angle_width*angular_resolution_x_reciprocal_)));
height = static_cast<uint32_t> (pcl_lrint (floor (max_angle_height*angular_resolution_y_reciprocal_)));
width = static_cast<uint32_t> (pcl_lrint (std::floor (max_angle_width*angular_resolution_x_reciprocal_)));
height = static_cast<uint32_t> (pcl_lrint (std::floor (max_angle_height*angular_resolution_y_reciprocal_)));

int full_width = static_cast<int> (pcl_lrint (floor (pcl::deg2rad (360.0f)*angular_resolution_x_reciprocal_))),
full_height = static_cast<int> (pcl_lrint (floor (pcl::deg2rad (180.0f)*angular_resolution_y_reciprocal_)));
int full_width = static_cast<int> (pcl_lrint (std::floor (pcl::deg2rad (360.0f)*angular_resolution_x_reciprocal_))),
full_height = static_cast<int> (pcl_lrint (std::floor (pcl::deg2rad (180.0f)*angular_resolution_y_reciprocal_)));
image_offset_x_ = (full_width -static_cast<int> (width) )/2;
image_offset_y_ = (full_height-static_cast<int> (height))/2;
is_dense = false;
Expand Down Expand Up @@ -175,8 +175,8 @@ RangeImage::createFromPointCloudWithKnownSize (const PointCloudType& point_cloud
to_range_image_system_ = to_world_system_.inverse (Eigen::Isometry);

float max_angle_size = getMaxAngleSize (sensor_pose, point_cloud_center, point_cloud_radius);
int pixel_radius_x = pcl_lrint (ceil (0.5f*max_angle_size*angular_resolution_x_reciprocal_)),
pixel_radius_y = pcl_lrint (ceil (0.5f*max_angle_size*angular_resolution_y_reciprocal_));
int pixel_radius_x = pcl_lrint (std::ceil (0.5f*max_angle_size*angular_resolution_x_reciprocal_)),
pixel_radius_y = pcl_lrint (std::ceil (0.5f*max_angle_size*angular_resolution_y_reciprocal_));
width = 2*pixel_radius_x;
height = 2*pixel_radius_y;
is_dense = false;
Expand Down Expand Up @@ -254,8 +254,8 @@ RangeImage::doZBuffer (const PointCloudType& point_cloud, float noise_level, flo
//std::cout << " ("<<current_point[0]<<", "<<current_point[1]<<", "<<current_point[2]<<") falls into pixel "<<x<<","<<y<<".\n";

// Do some minor interpolation by checking the three closest neighbors to the point, that are not filled yet.
int floor_x = pcl_lrint (floor (x_real)), floor_y = pcl_lrint (floor (y_real)),
ceil_x = pcl_lrint (ceil (x_real)), ceil_y = pcl_lrint (ceil (y_real));
int floor_x = pcl_lrint (std::floor (x_real)), floor_y = pcl_lrint (std::floor (y_real)),
ceil_x = pcl_lrint (std::ceil (x_real)), ceil_y = pcl_lrint (std::ceil (y_real));

int neighbor_x[4], neighbor_y[4];
neighbor_x[0]=floor_x; neighbor_y[0]=floor_y;
Expand Down Expand Up @@ -299,7 +299,7 @@ RangeImage::doZBuffer (const PointCloudType& point_cloud, float noise_level, flo
{
replace_with_current_point = true;
}
else if (fabs (range_of_current_point-range_at_image_point)<=noise_level)
else if (std::fabs (range_of_current_point-range_at_image_point)<=noise_level)
{
addCurrentPoint = true;
}
Expand Down Expand Up @@ -652,7 +652,7 @@ RangeImage::getAcutenessValue (const PointWithRange& point1, const PointWithRang
float impact_angle = getImpactAngle (point1, point2);
if (std::isinf (impact_angle))
return -std::numeric_limits<float>::infinity ();
float ret = 1.0f - float (fabs (impact_angle)/ (0.5f*M_PI));
float ret = 1.0f - float (std::fabs (impact_angle)/ (0.5f*M_PI));
if (impact_angle < 0.0f)
ret = -ret;
//if (fabs (ret)>1)
Expand Down Expand Up @@ -1228,10 +1228,10 @@ RangeImage::integrateFarRanges (const PointCloudType& far_ranges)

this->getImagePoint (current_point, x_real, y_real, range_of_current_point);

int floor_x = static_cast<int> (pcl_lrint (floor (x_real))),
floor_y = static_cast<int> (pcl_lrint (floor (y_real))),
ceil_x = static_cast<int> (pcl_lrint (ceil (x_real))),
ceil_y = static_cast<int> (pcl_lrint (ceil (y_real)));
int floor_x = static_cast<int> (pcl_lrint (std::floor (x_real))),
floor_y = static_cast<int> (pcl_lrint (std::floor (y_real))),
ceil_x = static_cast<int> (pcl_lrint (std::ceil (x_real))),
ceil_y = static_cast<int> (pcl_lrint (std::ceil (y_real)));

int neighbor_x[4], neighbor_y[4];
neighbor_x[0]=floor_x; neighbor_y[0]=floor_y;
Expand Down
6 changes: 3 additions & 3 deletions common/src/gaussian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pcl::GaussianKernel::compute (float sigma,
kernel[k] = kernel[j] = expf (-static_cast<float>(i) * static_cast<float>(i) * sigma_sqr);
kernel[hw] = 1;
unsigned g_width = kernel_width;
for (unsigned i = 0; fabs (kernel[i]/max_gauss) < factor; i++, g_width-= 2) ;
for (unsigned i = 0; std::fabs (kernel[i]/max_gauss) < factor; i++, g_width-= 2) ;
if (g_width == kernel_width)
{
PCL_THROW_EXCEPTION (pcl::KernelWidthTooSmallException,
Expand Down Expand Up @@ -98,8 +98,8 @@ pcl::GaussianKernel::compute (float sigma,
// Compute kernel and derivative true width
unsigned g_width = kernel_width;
unsigned d_width = kernel_width;
for (unsigned i = 0; fabs (derivative[i]/max_deriv) < factor; i++, d_width-= 2) ;
for (unsigned i = 0; fabs (kernel[i]/max_gauss) < factor; i++, g_width-= 2) ;
for (unsigned i = 0; std::fabs (derivative[i]/max_deriv) < factor; i++, d_width-= 2) ;
for (unsigned i = 0; std::fabs (kernel[i]/max_gauss) < factor; i++, g_width-= 2) ;
if (g_width == kernel_width || d_width == kernel_width)
{
PCL_THROW_EXCEPTION (KernelWidthTooSmallException,
Expand Down
8 changes: 4 additions & 4 deletions common/src/projection_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ pcl::getCameraMatrixFromProjectionMatrix (
{
camera_matrix.coeffRef (2) = cam.coeff (2);
camera_matrix.coeffRef (5) = cam.coeff (5);
camera_matrix.coeffRef (4) = static_cast<float> (sqrt (cam.coeff (4) - cam.coeff (5) * cam.coeff (5)));
camera_matrix.coeffRef (4) = static_cast<float> (std::sqrt (cam.coeff (4) - cam.coeff (5) * cam.coeff (5)));
camera_matrix.coeffRef (1) = (cam.coeff (1) - cam.coeff (2) * cam.coeff (5)) / camera_matrix.coeff (4);
camera_matrix.coeffRef (0) = static_cast<float> (sqrt (cam.coeff (0) - camera_matrix.coeff (1) * camera_matrix.coeff (1) - cam.coeff (2) * cam.coeff (2)));
camera_matrix.coeffRef (0) = static_cast<float> (std::sqrt (cam.coeff (0) - camera_matrix.coeff (1) * camera_matrix.coeff (1) - cam.coeff (2) * cam.coeff (2)));
}
else
{
camera_matrix.coeffRef (6) = cam.coeff (2);
camera_matrix.coeffRef (7) = cam.coeff (5);
camera_matrix.coeffRef (4) = static_cast<float> (sqrt (cam.coeff (4) - cam.coeff (5) * cam.coeff (5)));
camera_matrix.coeffRef (4) = static_cast<float> (std::sqrt (cam.coeff (4) - cam.coeff (5) * cam.coeff (5)));
camera_matrix.coeffRef (3) = (cam.coeff (1) - cam.coeff (2) * cam.coeff (5)) / camera_matrix.coeff (4);
camera_matrix.coeffRef (0) = static_cast<float> (sqrt (cam.coeff (0) - camera_matrix.coeff (3) * camera_matrix.coeff (3) - cam.coeff (2) * cam.coeff (2)));
camera_matrix.coeffRef (0) = static_cast<float> (std::sqrt (cam.coeff (0) - camera_matrix.coeff (3) * camera_matrix.coeff (3) - cam.coeff (2) * cam.coeff (2)));
}
}

8 changes: 4 additions & 4 deletions common/src/range_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ RangeImage::createEmpty (float angular_resolution_x, float angular_resolution_y,
RangeImage::CoordinateFrame coordinate_frame, float angle_width, float angle_height)
{
setAngularResolution(angular_resolution_x, angular_resolution_y);
width = static_cast<uint32_t> (pcl_lrint (floor (angle_width * angular_resolution_x_reciprocal_)));
height = static_cast<uint32_t> (pcl_lrint (floor (angle_height * angular_resolution_y_reciprocal_)));
width = static_cast<uint32_t> (pcl_lrint (std::floor (angle_width * angular_resolution_x_reciprocal_)));
height = static_cast<uint32_t> (pcl_lrint (std::floor (angle_height * angular_resolution_y_reciprocal_)));

int full_width = static_cast<int> (pcl_lrint (floor (pcl::deg2rad (360.0f)*angular_resolution_x_reciprocal_))),
full_height = static_cast<int> (pcl_lrint (floor (pcl::deg2rad (180.0f)*angular_resolution_y_reciprocal_)));
int full_width = static_cast<int> (pcl_lrint (std::floor (pcl::deg2rad (360.0f)*angular_resolution_x_reciprocal_))),
full_height = static_cast<int> (pcl_lrint (std::floor (pcl::deg2rad (180.0f)*angular_resolution_y_reciprocal_)));
image_offset_x_ = (full_width-width)/2;
image_offset_y_ = (full_height-height)/2;
is_dense = false;
Expand Down
6 changes: 3 additions & 3 deletions common/src/range_image_planar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace pcl
float original_angular_resolution = atanf (0.5f * static_cast<float> (di_width) / static_cast<float> (focal_length)) / (0.5f * static_cast<float> (di_width));
int skip = 1;
if (desired_angular_resolution >= 2.0f*original_angular_resolution)
skip = static_cast<int> (pcl_lrint (floor (desired_angular_resolution / original_angular_resolution)));
skip = static_cast<int> (pcl_lrint (std::floor (desired_angular_resolution / original_angular_resolution)));

setAngularResolution (original_angular_resolution * static_cast<float> (skip));
width = di_width / skip;
Expand Down Expand Up @@ -124,7 +124,7 @@ namespace pcl
float original_angular_resolution = asinf (0.5f*static_cast<float> (di_width)/static_cast<float> (di_focal_length_x)) / (0.5f*static_cast<float> (di_width));
int skip = 1;
if (desired_angular_resolution >= 2.0f*original_angular_resolution)
skip = static_cast<int> (pcl_lrint (floor (desired_angular_resolution / original_angular_resolution)));
skip = static_cast<int> (pcl_lrint (std::floor (desired_angular_resolution / original_angular_resolution)));

setAngularResolution (original_angular_resolution * static_cast<float> (skip));
width = di_width / skip;
Expand Down Expand Up @@ -170,7 +170,7 @@ namespace pcl
float original_angular_resolution = asinf (0.5f*static_cast<float> (di_width)/static_cast<float> (di_focal_length_x)) / (0.5f*static_cast<float> (di_width));
int skip = 1;
if (desired_angular_resolution >= 2.0f*original_angular_resolution)
skip = static_cast<int> (pcl_lrint (floor (desired_angular_resolution/original_angular_resolution)));
skip = static_cast<int> (pcl_lrint (std::floor (desired_angular_resolution/original_angular_resolution)));

setAngularResolution (original_angular_resolution * static_cast<float> (skip));
width = di_width / skip;
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/board.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pcl::BOARDLocalReferenceFrameEstimation<PointInT, PointNT, PointOutT>::computePo
surface_->at (curr_neigh_idx).getVector3fMap (), indicating_normal_vect);
float angle = getAngleBetweenUnitVectors (x_axis, indicating_normal_vect, fitted_normal);

int check_margin_array_idx = std::min (static_cast<int> (floor (angle / max_boundary_angle)), check_margin_array_size_ - 1);
int check_margin_array_idx = std::min (static_cast<int> (std::floor (angle / max_boundary_angle)), check_margin_array_size_ - 1);
check_margin_array_[check_margin_array_idx] = true;

if (angle < margin_array_min_angle_[check_margin_array_idx])
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/cppf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pcl::CPPFEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut

Eigen::Vector3f model_point_transformed = transform_mg * model_point;
float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
if (sin (angle) * model_point_transformed(2) < 0.0f)
if (std::sin (angle) * model_point_transformed(2) < 0.0f)
angle *= (-1);
p.alpha_m = -angle;
}
Expand Down
12 changes: 6 additions & 6 deletions features/include/pcl/features/impl/esf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ pcl::ESFEstimation<PointInT, PointOutT>::voxelize9 (PointCloudIn &cluster)
int xi,yi,zi,xx,yy,zz;
for (size_t i = 0; i < cluster.points.size (); ++i)
{
xx = cluster.points[i].x<0.0? static_cast<int>(floor(cluster.points[i].x)+GRIDSIZE_H) : static_cast<int>(ceil(cluster.points[i].x)+GRIDSIZE_H-1);
yy = cluster.points[i].y<0.0? static_cast<int>(floor(cluster.points[i].y)+GRIDSIZE_H) : static_cast<int>(ceil(cluster.points[i].y)+GRIDSIZE_H-1);
zz = cluster.points[i].z<0.0? static_cast<int>(floor(cluster.points[i].z)+GRIDSIZE_H) : static_cast<int>(ceil(cluster.points[i].z)+GRIDSIZE_H-1);
xx = cluster.points[i].x<0.0? static_cast<int>(std::floor(cluster.points[i].x)+GRIDSIZE_H) : static_cast<int>(std::ceil(cluster.points[i].x)+GRIDSIZE_H-1);
yy = cluster.points[i].y<0.0? static_cast<int>(std::floor(cluster.points[i].y)+GRIDSIZE_H) : static_cast<int>(std::ceil(cluster.points[i].y)+GRIDSIZE_H-1);
zz = cluster.points[i].z<0.0? static_cast<int>(std::floor(cluster.points[i].z)+GRIDSIZE_H) : static_cast<int>(std::ceil(cluster.points[i].z)+GRIDSIZE_H-1);

for (int x = -1; x < 2; x++)
for (int y = -1; y < 2; y++)
Expand All @@ -456,9 +456,9 @@ pcl::ESFEstimation<PointInT, PointOutT>::cleanup9 (PointCloudIn &cluster)
int xi,yi,zi,xx,yy,zz;
for (size_t i = 0; i < cluster.points.size (); ++i)
{
xx = cluster.points[i].x<0.0? static_cast<int>(floor(cluster.points[i].x)+GRIDSIZE_H) : static_cast<int>(ceil(cluster.points[i].x)+GRIDSIZE_H-1);
yy = cluster.points[i].y<0.0? static_cast<int>(floor(cluster.points[i].y)+GRIDSIZE_H) : static_cast<int>(ceil(cluster.points[i].y)+GRIDSIZE_H-1);
zz = cluster.points[i].z<0.0? static_cast<int>(floor(cluster.points[i].z)+GRIDSIZE_H) : static_cast<int>(ceil(cluster.points[i].z)+GRIDSIZE_H-1);
xx = cluster.points[i].x<0.0? static_cast<int>(std::floor(cluster.points[i].x)+GRIDSIZE_H) : static_cast<int>(std::ceil(cluster.points[i].x)+GRIDSIZE_H-1);
yy = cluster.points[i].y<0.0? static_cast<int>(std::floor(cluster.points[i].y)+GRIDSIZE_H) : static_cast<int>(std::ceil(cluster.points[i].y)+GRIDSIZE_H-1);
zz = cluster.points[i].z<0.0? static_cast<int>(std::floor(cluster.points[i].z)+GRIDSIZE_H) : static_cast<int>(std::ceil(cluster.points[i].z)+GRIDSIZE_H-1);

for (int x = -1; x < 2; x++)
for (int y = -1; y < 2; y++)
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/gfpfh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pcl::GFPFHEstimation<PointInT, PointNT, PointOutT>::computeDistanceHistogram (co
for (const float &distance : distances)
{
const float raw_bin = static_cast<float> (descriptorSize ()) * (distance - min_value) / range;
int bin = std::min (max_bin, static_cast<int> (floor (raw_bin)));
int bin = std::min (max_bin, static_cast<int> (std::floor (raw_bin)));
histogram[bin] += 1;
}
}
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 @@ -744,13 +744,13 @@ pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::computeFeature (PointCl
//const float depthDependendDepthChange = (max_depth_change_factor_ * (fabs(depth)+1.0f))/(500.0f*0.001f);
const float depthDependendDepthChange = (max_depth_change_factor_ * (fabsf (depth) + 1.0f) * 2.0f);

if (fabs (depth - depthR) > depthDependendDepthChange
if (std::fabs (depth - depthR) > depthDependendDepthChange
|| !std::isfinite (depth) || !std::isfinite (depthR))
{
depthChangeMap[index] = 0;
depthChangeMap[index+1] = 0;
}
if (fabs (depth - depthD) > depthDependendDepthChange
if (std::fabs (depth - depthD) > depthDependendDepthChange
|| !std::isfinite (depth) || !std::isfinite (depthD))
{
depthChangeMap[index] = 0;
Expand Down
8 changes: 4 additions & 4 deletions features/include/pcl/features/impl/intensity_spin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ pcl::IntensitySpinEstimation<PointInT, PointOutT>::computeIntensitySpinImage (
else
{
// Compute the bin indices that need to be updated (+/- 3 standard deviations)
int d_idx_min = (std::max)(static_cast<int> (floor (d - 3*sigma)), 0);
int d_idx_max = (std::min)(static_cast<int> (ceil (d + 3*sigma)), nr_distance_bins - 1);
int i_idx_min = (std::max)(static_cast<int> (floor (i - 3*sigma)), 0);
int i_idx_max = (std::min)(static_cast<int> (ceil (i + 3*sigma)), nr_intensity_bins - 1);
int d_idx_min = (std::max)(static_cast<int> (std::floor (d - 3*sigma)), 0);
int d_idx_max = (std::min)(static_cast<int> (std::ceil (d + 3*sigma)), nr_distance_bins - 1);
int i_idx_min = (std::max)(static_cast<int> (std::floor (i - 3*sigma)), 0);
int i_idx_max = (std::min)(static_cast<int> (std::ceil (i + 3*sigma)), nr_intensity_bins - 1);

// Update the appropriate bins of the histogram
for (int i_idx = i_idx_min; i_idx <= i_idx_max; ++i_idx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pcl::LinearLeastSquaresNormalEstimation<PointInT, PointOutT>::computePointNormal
float depthChangeThreshold = pz*pz * 0.05f * max_depth_change_factor_;
if (use_depth_dependent_smoothing_) depthChangeThreshold *= pz;

const float f = fabs (delta) > depthChangeThreshold ? 0 : 1;
const float f = std::fabs (delta) > depthChangeThreshold ? 0 : 1;

matA0 += f * i * i;
matA1 += f * i * j;
Expand Down Expand Up @@ -219,7 +219,7 @@ pcl::LinearLeastSquaresNormalEstimation<PointInT, PointOutT>::computeFeature (Po
const float j = qy - py;

const float depthDependendDepthChange = (max_depth_change_factor_ * (fabsf (pz) + 1.0f) * 2.0f);
const float f = fabs(delta) > depthDependendDepthChange ? 0 : 1;
const float f = std::fabs(delta) > depthDependendDepthChange ? 0 : 1;

//float f = fabs(delta) > (pz * 0.05f - 0.3f) ? 0 : 1;
//const float f = fabs(delta) > (pz*pz * 0.05f * max_depth_change_factor_) ? 0 : 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ pcl::MomentOfInertiaEstimation<PointT>::rotateVector (const Eigen::Vector3f& vec
const float y = axis (1);
const float z = axis (2);
const float rad = M_PI / 180.0f;
const float cosine = cos (angle * rad);
const float sine = sin (angle * rad);
const float cosine = std::cos (angle * rad);
const float sine = std::sin (angle * rad);
rotation_matrix << cosine + (1 - cosine) * x * x, (1 - cosine) * x * y - sine * z, (1 - cosine) * x * z + sine * y,
(1 - cosine) * y * x + sine * z, cosine + (1 - cosine) * y * y, (1 - cosine) * y * z - sine * x,
(1 - cosine) * z * x - sine * y, (1 - cosine) * z * y + sine * x, cosine + (1 - cosine) * z * z;
Expand Down Expand Up @@ -540,13 +540,13 @@ pcl::MomentOfInertiaEstimation<PointT>::computeEccentricity (const Eigen::Matrix
float eccentricity = 0.0f;

if (major >= middle && major >= minor && middle_value != 0.0f)
eccentricity = pow (1.0f - (minor_value * minor_value) / (middle_value * middle_value), 0.5f);
eccentricity = std::pow (1.0f - (minor_value * minor_value) / (middle_value * middle_value), 0.5f);

if (middle >= major && middle >= minor && major_value != 0.0f)
eccentricity = pow (1.0f - (minor_value * minor_value) / (major_value * major_value), 0.5f);
eccentricity = std::pow (1.0f - (minor_value * minor_value) / (major_value * major_value), 0.5f);

if (minor >= major && minor >= middle && major_value != 0.0f)
eccentricity = pow (1.0f - (middle_value * middle_value) / (major_value * major_value), 0.5f);
eccentricity = std::pow (1.0f - (middle_value * middle_value) / (major_value * major_value), 0.5f);

return (eccentricity);
}
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/ppf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pcl::PPFEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut

Eigen::Vector3f model_point_transformed = transform_mg * model_point;
float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
if (sin (angle) * model_point_transformed(2) < 0.0f)
if (std::sin (angle) * model_point_transformed(2) < 0.0f)
angle *= (-1);
p.alpha_m = -angle;
}
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/ppfrgb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pcl::PPFRGBEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudO

Eigen::Vector3f model_point_transformed = transform_mg * model_point;
float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
if (sin (angle) * model_point_transformed(2) < 0.0f)
if (std::sin (angle) * model_point_transformed(2) < 0.0f)
angle *= (-1);
p.alpha_m = -angle;
}
Expand Down
Loading