Skip to content

planeWithPlaneIntersection, error in parallel plane test #1695

@sand-box

Description

@sand-box

The function template <typename Scalar> bool pcl::planeWithPlaneIntersection (const Eigen::Matrix<Scalar, 4, 1> &plane_a, const Eigen::Matrix<Scalar, 4, 1> &plane_b, Eigen::Matrix<Scalar, Eigen::Dynamic, 1> &line, double angular_tolerance) in file intersections.hpp checks for parallel planes like this:

  double test_cos = plane_a_norm.dot (plane_b_norm);
  double upper_limit = 1 + angular_tolerance;
  double lower_limit = 1 - angular_tolerance;
  if ((test_cos > lower_limit) && (test_cos < upper_limit))
  {
      PCL_DEBUG ("Plane A and Plane B are parallel.\n");
      return (false);
  }

I think there a three issues with this code

  • check for anti-parallel plane is missing (cos ~= -1)
  • no need for second condition (test_cos < upper_limit)
  • documentation says: \param[in] angular_tolerance tolerance in radians. In code the parameter is not used in radian domain.

Your Environment

  • Operating System and version: ubuntu 14.04
  • Compiler: gcc 4.8.5
  • PCL Version: 1.7.2

Expected Behavior

Checking for anti-parallel planes, correct documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions