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

ROS Indigo Install on RPI3 - URDF Compile Errors

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

Tardoe gravatar image

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

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 image alienmon  ( 2016-09-14 22:13:34 -0500 )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 image Tardoe  ( 2016-09-14 22:59:25 -0500 )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 image alienmon  ( 2016-09-15 00:14:03 -0500 )edit

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

nickxiang0306 gravatar image nickxiang0306  ( 2016-10-17 01:35:02 -0500 )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 image ElGalloGringo  ( 2016-10-18 17:08:38 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted
1

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

ElGalloGringo gravatar image

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

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

Comments

I have replaced my ArchLinux system package urdfdom_headers by one compiled with the reverted commit, and then the build error has changed, but still build failing: it is still trying to assign std::shared_ptr to a boost::shared_ptr

4ronie4 gravatar image 4ronie4  ( 2017-04-26 17:04:45 -0500 )edit
0

answered 2017-11-10 06:05:35 -0500

cxxzju gravatar image

updated 2017-11-10 06:10:09 -0500

This is an annoying problem, I have spend the whole day to figure it out!!!! Finally, I get the correct solution. Following is the process:

when you follow the tutorial: http://wiki.ros.org/ROSberryPi/Instal... . In the step of install package: liburdfdom-headers-dev and liburdfdom-dev. Don't use git clone!!!Just download the older version , here is the link: https://github.com/ros/urdfdom_header... https://github.com/ros/urdfdom/releas... then unzip these 2 package, go into the folder, use

cmake . 
sudo checkinstall make install

to install the 2 packages. Then it should be Ok when you run the compile.

I found the solution in a blog, thanks for his/her contribution,here is the source, http://blog.csdn.net/walleva96/articl... .

edit flag offensive delete link more
0

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

Alix12 gravatar image

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

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 image gvdhoorn  ( 2017-02-02 07:46:44 -0500 )edit
0

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

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 image Tardoe  ( 2016-09-14 21:26:32 -0500 )edit

Question Tools

3 followers

Stats

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

Seen: 3,291 times

Last updated: Nov 10 '17