src/shape_detector/src/cylinder_computer.cpp
/* Compute the distance from pt1 to pt2, projected onto the given direction
 * vector. The distance is positive, if the distance vector (pt2-pt1) points
 * into the same direction as 'direction' does.
 * The returned length is the real length, multiplied by the length of
 * the 'direction' vector.
 */
Compute the distance from pt1 to pt2, projected onto the given direction
vector. The distance is positive, if the distance vector (pt2-pt1) points
into the same direction as 'direction' does.
The returned length is the real length, multiplied by the length of
the 'direction' vector.
Compute the distance from pt1 to pt2 projected onto the given direction vector . The distance is positive if the distance vector ( pt2 - pt1 ) points into the same direction as ' direction ' does . The returned length is the real length multiplied by the length of the ' direction ' vector .
inline double computeSignedProjectedDistance(const PointT& pt1, const PointT& pt2,
                                      const Eigen::Vector3d& direction)
{
  Eigen::Vector3d vec1 {convertPCLPointToEigenVector(pt1)};
  Eigen::Vector3d vec2 {convertPCLPointToEigenVector(pt2)};
  Eigen::Vector3d distance_vec {vec2 - vec1};
  return distance_vec.dot(direction);
}
inline double computeSignedProjectedDistance ( const PointT & pt1 , const PointT & pt2 , const Eigen :: Vector3d & direction ) { Eigen :: Vector3d vec1 { convertPCLPointToEigenVector ( pt1 ) } ; Eigen :: Vector3d vec2 { convertPCLPointToEigenVector ( pt2 ) } ; Eigen :: Vector3d distance_vec { vec2 - vec1 } ; return distance_vec . dot ( direction ) ; }
Compute the distance from pt1 to pt2, projected onto the given direction
 vector.
Compute the distance from pt1 to pt2 projected onto the given direction vector .