Ask Your Question
1

ROS Indigo Install on RPI3 - URDF Compile Errors

asked 2016-09-14 05:52:12 -0600

Tardoe gravatar image

updated 2016-09-14 21:26:20 -0600

I'm installing ROS Indigo on RPI 3 running Wheezy using the desktop version and following this wiki page: http://wiki.ros.org/ROSberryPi/Instal...

I get as far as compiling URDF from source and I get a bunch of compile-time errors and many more not shown.

    pi@raspberrypi ~/ros_install_ws $ cd /home/pi/ros_install_ws/build_isolated/urdf && /opt/ros/indigo/env.sh make -j4 -l4
    [100%] Building CXX object CMakeFiles/urdf.dir/src/model.cpp.o
    In file included from /usr/local/include/urdf_model/joint.h:43:0,
                     from /usr/local/include/urdf_model/link.h:44,
                     from /usr/local/include/urdf_model/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/include/urdf/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:37:
    /usr/local/include/urdf_model/pose.h: In member function 'void urdf::Vector3::init(const string&)':
    /usr/local/include/urdf_model/pose.h:78:25: error: 'stod' is not a member of 'std'
    In file included from /usr/local/include/urdf_model/joint.h:43:0,
                     from /usr/local/include/urdf_model/link.h:44,
                     from /usr/local/include/urdf_model/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/include/urdf/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:37:
    /usr/local/include/urdf_model/pose.h:90:42: error: 'to_string' is not a member of 'std'
    In file included from /usr/local/include/urdf_model/joint.h:44:0,
                     from /usr/local/include/urdf_model/link.h:44,
                     from /usr/local/include/urdf_model/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/include/urdf/model.h:42,
                     from /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp:37:
    /usr/local/include/urdf_model/types.h: At global scope:
    /usr/local/include/urdf_model/types.h:51:9: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:53:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:53:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:53:1: error: 'weak_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:54:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:54:1: error: 'shared_ptr' in namespace 'std' does not name a type
    /usr/local/include/urdf_model/types.h:54:1: error: 'weak_ptr' in namespace 'std' does not name a type

/usr/local/include/urdf_model/types.h:55:1: error: 'shared_ptr' in namespace 'std' does not name a type
/usr/local/include/urdf_model/types.h:55:1: error: 'shared_ptr' in namespace 'std' does not name a type

I have liburdfdom-dev and liburdfdom-headers-dev installed via compiled source as per the wiki page and confirmed (with dpkg).

Something appears to be missing here as this just isn't right...

UPDATE:

I've added:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

Which now results in a single error of:

/home/pi/ros_install_ws/src/robot_model/urdf ...
(more)
edit retag flag offensive close merge delete

Comments

open /home/pi/ros_install_ws/src/robot_model/urdf/src/model.cpp , what is it in line 174? You might want to check this

alienmon gravatar imagealienmon ( 2016-09-14 22:13:34 -0600 )edit

I don't quite understand - parseURDF() is mean to return a boost::shared_ptr<modelinterface> which is the same type as the model object. This is line 174: model = parseURDF(xml_string); The sig for parseURDL is: boost::shared_ptr<modelinterface> parseURDF(const std::string &xml_string)

Tardoe gravatar imageTardoe ( 2016-09-14 22:59:25 -0600 )edit

According to this bug report "We believe that the bug you reported is fixed in the latest version of ros-robot-model, which is due to be installed in the Debian FTP archive.". Did you install the atest version?

alienmon gravatar imagealienmon ( 2016-09-15 00:14:03 -0600 )edit

Hello, where did you add "set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")" ? Thanks in advanced

nickxiang0306 gravatar imagenickxiang0306 ( 2016-10-17 01:35:02 -0600 )edit

Did you ever get this figured out? I am running into the exact same problem. I have tried stopping by the IRC channel, but can't seem to get any help. I was hoping that you lack of follow-up indicated that you figured it out.

ElGalloGringo gravatar imageElGalloGringo ( 2016-10-18 17:08:38 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2016-10-18 17:51:38 -0600

ElGalloGringo gravatar image

updated 2016-10-18 17:52:22 -0600

I kept hammering away at this and found the solution (at least it got past that part). Apparently, ROS is moving away from boost::shared_ptr and moving toward using the std::shared_ptr available in c++11 and higher. Because the instructions at http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi are a mix of installing packages and installing from source, this caused a discrepency where urdfdom_headers was a newer version that had the conversion from boost::shared_ptr to std::shared_ptr completed, but the rest of ROS Indigo is still expecting boost::shared_ptr.

So, the solution was to go back and find the last commit at https://github.com/ros/urdfdom_header... that still had the boost::shared_ptr in the types.h file. Interestingly enough, you and I both originally thought that we needed to add c++11 support because types.h was using std::shared_ptr. This solved the problems of the std::shared_ptr support, but introduced new ones where it was trying to assign an std::shared_ptr to a boost::shared_ptr and vice versa.

The section should become

liburdfdom-headers-dev:

cd ~/ros_catkin_ws/external_src
$ git clone https://github.com/ros/urdfdom_headers.git
$ cd urdfdom_headers
$ git reset --hard 9aed725
$ cmake .
$ sudo checkinstall make install

Here the 'git reset --hard 9aed725' moved the revision back to the point where boost::shared_ptr is still in there. This also eliminated the need to add c++11 support in the CMakeLists.txt file.

edit flag offensive delete link more
0

answered 2016-09-14 12:11:57 -0600

jacobperron gravatar image

Looks like the source code is using C++11. You probably need to set compiler flag -std=c++11 somehow, perhaps during cmake.

edit flag offensive delete link more

Comments

I've done this and updated my Question with the results.

Tardoe gravatar imageTardoe ( 2016-09-14 21:26:32 -0600 )edit
0

answered 2017-02-02 07:28:34 -0600

Alix12 gravatar image

updated 2017-02-02 07:46:17 -0600

gvdhoorn gravatar image
edit flag offensive delete link more

Comments

I've removed your spam @Alix12. Can you delete the rest of your answer if it doesn't contribute anything to the discussion?

gvdhoorn gravatar imagegvdhoorn ( 2017-02-02 07:46:44 -0600 )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

2 followers

Stats

Asked: 2016-09-14 05:52:12 -0600

Seen: 413 times

Last updated: Feb 02