compatibilitymobile-robot-toolkit

About ROS_RMPT_SLAM package compiling issue


While doing catkin_make ROS_MRPT_SLAM, I got following error

In file included from /usr/include/mrpt/base/include/mrpt/utils/CFileGZInputStream.h:12:0,
                 from /home/ian/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/include/mrpt_ekf_slam_2d/mrpt_ekf_slam_2d.h:11,
                 from /home/ian/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/src/mrpt_ekf_slam_2d.cpp:7:
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In member function ‘void mrpt::utils::CStream::WriteVariant(T)’:
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:313:15: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14
   t.match([&](auto& o) { this->WriteObject(o); });
               ^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In lambda function:
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:313:45: error: no matching function for call to ‘mrpt::utils::CStream::WriteObject(int&)’
   t.match([&](auto& o) { this->WriteObject(o); });

I guess it's compatibility matter or something because there were missing header files and so on.

This is the ROS_PACKAGE wiki: http://wiki.ros.org/mrpt_slam

And I just followed instruction from official MRPT website.

If the developer or anyone who is familiar with mrpt toolkit sees this question, may I get some advice about these errors?

By the way, I installed mrpt toolkit using the following website's instruction: http://www.mrpt.org/MRPT_in_GNU/Linux_repositories.


Solution

  • I'm the main author of MRPT and of part of the ROS packages.

    Sorry for the mess, but you found us in the transition between the mrpt series 1.5.* and a new mayor rewrite based on C++14 which currently is published in git as mrpt 1.9.9 and eventually will be released as 2.0.0.

    This transition must be propagated to the ros nodes, but so far we have upgraded mrpt_navigation only, mrpt_slam is in the to-do list.

    So: a solution is to install an mrpt version of the 1.5.* series, and to build the ros packages from sources, paying attention to checking out the branches named compat-mrpt-1.5.

    Hope this helps!