yayaneath / GeoGrasp

Fast geometry-based method for computing grasping points on 3D point clouds.
BSD 2-Clause "Simplified" License
28 stars 13 forks source link

compiling error 'getVector3fMap' #1

Closed ri-ceres closed 5 years ago

ri-ceres commented 5 years ago

When trying to build catkin workspace, build fails with: error: ‘const class Eigen::Map<Eigen::Matrix<float, 3, 1>, 0, Eigen::Stride<0, 0> >’ has no member named ‘getVector3fMap’

Full trace:

In file included from /home/user/src/geograsp/geograsp/include/geograsp/GeoGrasp.h:14:0,
                 from /home/user/src/geograsp/geograsp/lib/geograsp/GeoGrasp.cpp:1:
/usr/include/pcl-1.8/pcl/common/geometry.h: In instantiation of ‘float pcl::geometry::distance(const PointT&, const PointT&) [with PointT = Eigen::Map<Eigen::Matrix<float, 3, 1>, 0, Eigen::Stride<0, 0> >]’:
/home/user/src/geograsp/geograsp/lib/geograsp/GeoGrasp.cpp:232:44:   required from here
/usr/include/pcl-1.8/pcl/common/geometry.h:62:33: error: ‘const class Eigen::Map<Eigen::Matrix<float, 3, 1>, 0, Eigen::Stride<0, 0> >’ has no member named ‘getVector3fMap’
       Eigen::Vector3f diff = p1.getVector3fMap () - p2.getVector3fMap ();
                              ~~~^~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/common/geometry.h:62:56: error: ‘const class Eigen::Map<Eigen::Matrix<float, 3, 1>, 0, Eigen::Stride<0, 0> >’ has no member named ‘getVector3fMap’
       Eigen::Vector3f diff = p1.getVector3fMap () - p2.getVector3fMap ();
                                                     ~~~^~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/common/geometry.h: In instantiation of ‘float pcl::geometry::distance(const PointT&, const PointT&) [with PointT = Eigen::Matrix<float, 3, 1>]’:
/home/user/src/geograsp/geograsp/lib/geograsp/GeoGrasp.cpp:484:21:   required from here
/usr/include/pcl-1.8/pcl/common/geometry.h:62:33: error: ‘const class Eigen::Matrix<float, 3, 1>’ has no member named ‘getVector3fMap’
       Eigen::Vector3f diff = p1.getVector3fMap () - p2.getVector3fMap ();
                              ~~~^~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/common/geometry.h:62:56: error: ‘const class Eigen::Matrix<float, 3, 1>’ has no member named ‘getVector3fMap’
       Eigen::Vector3f diff = p1.getVector3fMap () - p2.getVector3fMap ();
yayaneath commented 5 years ago

Hi @ri-ceres

It seems that the code of the function pcl::geometry::distance has changed from the PCL version 1.7 to the 1.8 and above. GeoGrasp was tested on the PCL 1.7, as stated in the README page. In that version, this function must be called passing the Vector3fMap from the points (find more here). From the PCL 1.8, the function itself performs this call inside of it (find more here).

Hence, the quick fix for your PCL version would be changing this line in GeoGrasp.cpp:

float objWidth = pcl::geometry::distance(this->firstGraspPoint.getVector3fMap(), this->secondGraspPoint.getVector3fMap());

For this call:

float objWidth = pcl::geometry::distance(this->firstGraspPoint, this->secondGraspPoint);

ri-ceres commented 5 years ago

That looks like it should resolve the issue. I'll confirm that this is the case when I am able to resume work on my project next week. Thanks!

ri-ceres commented 5 years ago

Following up to confirm that this issue has been resolved. Thanks!