Ask Your Question
2

Error Using Eigen 'sqrt' While Compiling ROS PCL

asked 2013-09-03 09:55:13 -0500

teddybouch gravatar image

updated 2013-09-03 10:40:32 -0500

I'm trying to re-install ROS in order to get a clean configuration to solve some other issues, and the build is failing when it gets to the 'pcl' package. It seems to just repeat this error:

In file included from /home/abouchard/ros_catkin_ws/src/pcl/common/include/pcl/common/vector_average.h:40:0,
                 from /home/abouchard/ros_catkin_ws/src/pcl/common/test/test_vector_average.cpp:42:
/home/abouchard/ros_catkin_ws/src/pcl/common/include/pcl/common/eigen.h: In function ‘void pcl::computeRoots(const Matrix&, Roots&)’:
/home/abouchard/ros_catkin_ws/src/pcl/common/include/pcl/common/eigen.h:168:30: error: ‘sqrt’ is not a member of ‘Eigen::internal’

The specific line numbers and such vary, of course, but they all have to do with a call to a sqrt function, and the namespace is either Eigen or pcl. I've Googled the error to little avail, and I am loathe to change the code much since I'm assuming there was some reason to call out a sqrt function other than the one in the 'math' library.

I found the documentation for the 'internal' namespace in Eigen, and it doesn't appear to have a sqrt function. However, looking at the file causing the issue (eigen.h), it seems to make some custom declarations of the sqrt function, but just for the pcl namespace.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2013-09-04 07:50:58 -0500

teddybouch gravatar image

In eigen.h: -replace all instances of Eigen::internal::sqrt with pcl::sqrt -replace all instances of Eigen::sin/cos with sin/cos

This allows it to compile successfully, but I haven't tested thoroughly to see whether it affects functionality. A co-worker of mine ran into the same problem and used std::sqrt instead of pcl::sqrt, and his compiles as well.

edit flag offensive delete link more

Comments

Until I find that either solution creates a problem, I am going to flag this as a solution.

teddybouch gravatar image teddybouch  ( 2013-09-20 06:22:13 -0500 )edit

Looks like Eigen did remove Eigen::internal::sqrt() and was okay with using std::sqrt() http://eigen.tuxfamily.org/bz/show_bu... and Eigen::internal::sin and cos as well http://listengine.tuxfamily.org/lists...

mz gravatar image mz  ( 2015-06-15 02:06:00 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-03 09:55:13 -0500

Seen: 2,713 times

Last updated: Sep 04 '13