ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ros_controllers catkin_make fail

asked 2018-11-21 04:20:28 -0500

lzheng gravatar image

updated 2018-11-21 04:44:23 -0500

Hello everyone, I'm trying to catkin_make the ros_controllers package on ROS Kinetic but get this error

[100%] Built target diff_drive_controller
[100%] Built target vesc_msgs_generate_messages
[100%] Built target diff_drive_generate_messages
[100%] Built target driver_base_generate_messages
In file included from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.h:75:0,
                 from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/src/joint_trajectory_controller.cpp:34:
/home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/init_joint_trajectory.h: In function ‘Trajectory joint_trajectory_controller::initJointTrajectory(const JointTrajectory&, const ros::Time&, const joint_trajectory_controller::InitJointTrajectoryOptions<Trajectory>&)’:
/home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/init_joint_trajectory.h:336:40: error: ‘to_string’ is not a member of ‘std’
       error_string = "Dropping all " + std::to_string(msg.points.size());
                                        ^
/home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/init_joint_trajectory.h:336:40: note: suggested alternatives:

    In file included from /usr/include/boost/exception_ptr.hpp:9:0,
                     from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                     from /usr/include/boost/thread/future.hpp:23,
                     from /usr/include/boost/thread.hpp:24,
                 from /opt/ros/kinetic/include/actionlib/server/action_server.h:41,
                 from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.h:58,
                 from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/src/joint_trajectory_controller.cpp:34:
/u
sr/include/boost/exception/detail/exception_ptr.hpp:492:5: note:   ‘boost::to_string’

         to_string( exception_ptr const & p )
         ^
    In file included from /usr/include/boost/dynamic_bitset.hpp:15:0,
                     from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.h:43,
                     from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller

        /src/joint_trajectory_controller.cpp:34:
    /usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1167:1: note:   ‘boost::to_string’
     to_string(const dynamic_bitset<Block, Allocator>& b, stringT& s)
     ^
In file included from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.h:75:0,
                 from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/src/joint_trajectory_controller.cpp:34:
/home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller

    /init_joint_trajectory.h:338:42: error: ‘to_string’ is not a member of ‘std’
           error_string += "Last point is " + std::to_string(last_point_dur.toSec());
                                              ^
/home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/init_joint_trajectory.h:338:42: note: suggested alternatives:
In file included from /usr/include/boost/exception_ptr.hpp:9:0,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:23,
                 from /usr/include/boost/thread.hpp:24,
                 from /opt/ros/kinetic/include/actionlib/server/action_server.h:41,
                 from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller

    /joint_trajectory_controller.h:58,
                     from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller

    /src/joint_trajectory_controller.cpp:34:
    /usr/include/boost/exception/detail/exception_ptr.hpp:492:5: note:   ‘boost::to_string’
         to_string( exception_ptr const & p )
         ^
        In file included from /usr/include/boost/dynamic_bitset.hpp:15:0,
                         from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller.h:43,
                         from /home/stagiaire019/astek_ws/src/ros_controllers/joint_trajectory_controller/src/joint_trajectory_controller.cpp:34:
        /usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1167:1: note:   ‘boost::to_string’

     to_string(const dynamic_bitset<Block, Allocator>& b, stringT& s)
     ^
ros_controllers/joint_trajectory_controller/CMakeFiles/joint_trajectory_controller.dir/build.make:62: recipe for target 'ros_controllers/joint_trajectory_controller/CMakeFiles/joint_trajectory_controller.dir/src/joint_trajectory_controller.cpp.o' failed
make[2]: *** [ros_controllers/joint_trajectory_controller/CMakeFiles/joint_trajectory_controller.dir/src/joint_trajectory_controller ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2018-11-21 07:41:21 -0500

Delb gravatar image

Your issue is simply a C++ issue, the method to_string from the library <string> is available with C++11. With kinetic, the standard is C++03 (Cf REP 3), so you have to specify in the CMakeLists.txt to use the standard C++11 with this line (just after project(YOUR_PROJECT)) :

add_compile_options(-std=c++11)
edit flag offensive delete link more

Comments

Thank you so much !!! This solved the issue !

lzheng gravatar image lzheng  ( 2018-11-21 08:06:07 -0500 )edit

Glad it worked !

Delb gravatar image Delb  ( 2018-11-21 08:13:53 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-11-21 04:20:28 -0500

Seen: 517 times

Last updated: Nov 21 '18